[IMP] odex_benefit: IMP benefit

This commit is contained in:
younes 2026-01-20 08:42:45 +01:00
parent f7b80a7332
commit 68c4c924a6
3 changed files with 26 additions and 41 deletions

View File

@ -18368,14 +18368,6 @@ msgid ""
"specialization."
msgstr "أكبر من %s سنة وغير منتظم بتخصص علمي أو مهني."
#. module: odex_benefit
#: code:addons/odex_benefit/models/family_members.py:0
#, python-format
msgid ""
"The member is over %s years old and not enrolled in a scientific or "
"vocational specialization."
msgstr "أكبر من %s سنة وغير منتظم بتخصص علمي أو مهني."
#. module: odex_benefit
#: code:addons/odex_benefit/models/benefit.py:0
#, python-format
@ -18498,19 +18490,6 @@ msgstr "الإجراء غير مسموح: الأسرة لديها %s فرد مس
msgid "Governmental/Paid"
msgstr "حكومي /مقابل مادي"
#. module: odex_benefit
#: code:addons/odex_benefit/models/family_members.py:0
#: code:addons/odex_benefit/models/family_members.py:0
#, python-format
msgid "She is over %s years of age and has no underage brothers."
msgstr "تجاوزت عمر %s وليس لديها اخوة قصر"
#. module: odex_benefit
#: code:addons/odex_benefit/models/family_members.py:0
#, python-format
msgid "She is over %s years of age."
msgstr "تجاوزت عمر %s"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_location_settings__replacement_mother_is_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_marital_status__replacement_mother_is_benefit

View File

@ -617,6 +617,17 @@ class FamilyMemberProfile(models.Model):
benefiting_children = rec.benefit_id.member_ids.filtered(
lambda m: m.relationn.relation_type in ['son', 'daughter'] and m.member_status == 'benefit'
)
has_benefiting_son = any(
m.relationn.relation_type == 'son' and m.member_status == 'benefit'
for m in rec.benefit_id.member_ids
)
has_younger_benefiting_daughter = any(
m.relationn.relation_type == 'daughter'
and m.member_status == 'benefit'
and m.age < female_benefit_age
for m in rec.benefit_id.member_ids
if m.id != rec.id
)
if rec.relationn.relation_type == 'mother':
if not benefiting_children:
@ -638,7 +649,8 @@ class FamilyMemberProfile(models.Model):
# Gender-specific checks
elif rec.relationn.relation_type == 'son':
if age_exceeded:
if rec.age <= exceptional_age_has_disabilities and rec.disabilities_attachment_ids and rec.minor_siblings:
if rec.age <= exceptional_age_has_disabilities and rec.disabilities_attachment_ids and (
has_benefiting_son or has_younger_benefiting_daughter):
rec.member_status = 'benefit'
else:
if rec.age > exceptional_age_has_disabilities and rec.disabilities_attachment_ids:
@ -651,18 +663,12 @@ class FamilyMemberProfile(models.Model):
_("Over %s years old and not enrolled in any educational institution.") % male_benefit_age
)
elif current_education_status_id.case_study == 'continuous':
if current_education_status_id.specialization_ids.is_scientific_specialty and rec.age >= exceptional_age_scientific_specialty:
if rec.age >= exceptional_age_scientific_specialty:
rec.member_status = 'non_benefit'
reasons.append(
_("Over %s years old and not enrolled in a scientific or vocational specialization.")
% exceptional_age_scientific_specialty
)
if not current_education_status_id.specialization_ids.is_scientific_specialty:
rec.member_status = 'non_benefit'
reasons.append(
_("The member is over %s years old and not enrolled in a scientific or vocational specialization.")
% male_benefit_age
)
if rec.is_work:
if rec.member_income > max_income_for_benefit:
rec.member_status = 'non_benefit'
@ -694,17 +700,15 @@ class FamilyMemberProfile(models.Model):
rec.member_status = 'non_benefit'
reasons.append(_("She is employed and not enrolled in an educational institution."))
if age_exceeded:
if rec.age > minor_siblings_age and not rec.minor_siblings:
if has_benefiting_son or has_younger_benefiting_daughter:
rec.member_status = 'benefit'
else:
rec.member_status = 'non_benefit'
reasons.append(
_("She is over %s years of age and has no underage brothers.") % female_benefit_age)
elif not rec.minor_siblings:
rec.member_status = 'non_benefit'
reasons.append(
_("She is over %s years of age and has no underage brothers.") % female_benefit_age)
elif rec.minor_siblings and rec.age > minor_siblings_age:
rec.member_status = 'non_benefit'
reasons.append(_("She is over %s years of age.") % minor_siblings_age)
_("She exceeded the age limit (%s) and has no benefiting son "
"nor any younger benefiting daughter.")
% female_benefit_age
)
if rec.is_work and rec.member_income > max_income_for_benefit:
rec.member_status = 'non_benefit'
reasons.append(_("She works with a salary greater than %s.") % max_income_for_benefit)

View File

@ -528,7 +528,8 @@
</button>
<button name="action_view_non_benefit_members" type="object" icon="fa-users">
<field string="Non Benefit Members" name="non_member_count" force_save="1" class="custom_stat_value"
<field string="Non Benefit Members" name="non_member_count" force_save="1"
class="custom_stat_value"
widget="statinfo"/>
</button>
<button icon="fa-list-ul" name="action_open_related_move_line_records" type="object">
@ -802,7 +803,8 @@
options="{'no_create': True, 'no_create_edit': True,'no_quick_create': True, 'no_open': True}"
groups="!odex_benefit.group_benefit_manager"
required="1"/>
<field name="mother_status" invisible="1" readonly="1" widget="badge" force_save="1"
<field name="mother_status" invisible="1" readonly="1" widget="badge"
force_save="1"
decoration-success="mother_status == 'benefit'"
decoration-danger="mother_status == 'non_benefit'"/>
</group>
@ -856,7 +858,7 @@
<field name="mother_net_income" widget="monetary" force_save="1"
options="{'currency_field': 'currency_id', 'field_digits': False}"
digits="[16,0]"
attrs="{'invisible':[('is_mother_work','=',False)]}"/>
/>
<field name="mother_salary_certificate"
widget="many2many_attachment_preview"
invisible="1"/>