From a5e74f4bacf88e083e278c3131957960f9c02711 Mon Sep 17 00:00:00 2001 From: younes Date: Sun, 4 Jan 2026 09:32:28 +0100 Subject: [PATCH] [IMP] odex_benefit: IMP benefit --- odex25_benefit/odex_benefit/models/benefit.py | 2 +- .../odex_benefit/models/family_members.py | 42 +++---------------- .../odex_benefit/views/family_members.xml | 2 +- 3 files changed, 8 insertions(+), 38 deletions(-) diff --git a/odex25_benefit/odex_benefit/models/benefit.py b/odex25_benefit/odex_benefit/models/benefit.py index 09dfc46e9..3f3f37ea5 100644 --- a/odex25_benefit/odex_benefit/models/benefit.py +++ b/odex25_benefit/odex_benefit/models/benefit.py @@ -1619,7 +1619,7 @@ class GrantBenefitProfile(models.Model): partner_ids.append(self.env['mail.followers'].search([('id', '=', id)]).partner_id) self.state = "second_approve" self.action_type = "approved" - self.sudo()._send_notification(partner_ids, rec.state) + #self.sudo()._send_notification(partner_ids, rec.state) # for member in self.member_ids: # member.create_member_partner() diff --git a/odex25_benefit/odex_benefit/models/family_members.py b/odex25_benefit/odex_benefit/models/family_members.py index f233fcb18..be09c9d81 100644 --- a/odex25_benefit/odex_benefit/models/family_members.py +++ b/odex25_benefit/odex_benefit/models/family_members.py @@ -589,23 +589,10 @@ class FamilyMemberProfile(models.Model): rec.member_status = 'non_benefit' reasons.append( _("He has a physical or intellectual disability but is over %s years of age.") % exceptional_age_has_disabilities) - elif current_education_status_id.specialization_ids.is_scientific_specialty and rec.age > exceptional_age_scientific_specialty and not rec.minor_siblings: + if rec.education_status not in [ + 'educated'] and current_education_status_id.case_study != 'continuous': rec.member_status = 'non_benefit' - reasons.append( - _("He is enrolled in a scientific or vocational specialization but is over %s years of age.") % exceptional_age_scientific_specialty) - elif current_education_status_id.specialization_ids.is_medical_specialty and rec.age > exceptional_age_medical_specialty and not rec.minor_siblings: - rec.member_status = 'non_benefit' - reasons.append( - _("He is enrolled in a medical specialization but is over %s years of age.") % exceptional_age_medical_specialty) - elif not any([current_education_status_id.specialization_ids.is_scientific_specialty, - current_education_status_id.specialization_ids.is_medical_specialty]): - rec.member_status = 'non_benefit' - reasons.append( - _("He is over %s years of age and not enrolled in a scientific or medical specialization.") % exceptional_age_medical_specialty) - if not rec.minor_siblings: - rec.member_status = 'non_benefit' - reasons.append( - _("He is over %s years of age and not enrolled in an educational institution.") % male_benefit_age) + reasons.append(_("He has exceeded the maximum age limit of %s years.") % male_benefit_age) if rec.is_work: if rec.member_income > max_income_for_benefit: rec.member_status = 'non_benefit' @@ -629,7 +616,7 @@ class FamilyMemberProfile(models.Model): _("Failure to complete the required documents or official proofs, or the family’s ineligibility for the association’s services, and the application has been rejected.")) elif rec.relationn.relation_type == 'daughter': - if rec.age < female_benefit_age and rec.is_married: + if rec.is_married: rec.member_status = 'non_benefit' reasons.append(_("Married")) if rec.age < female_benefit_age and rec.is_work and rec.education_status not in [ @@ -637,25 +624,8 @@ 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: - 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) - # elif rec.is_work and current_education_status_id.education_status in ['illiterate'] and current_education_status_id.case_study in [ - # 'graduate', 'intermittent']: - # rec.member_status = 'non_benefit' - elif rec.is_married: - rec.member_status = 'non_benefit' - reasons.append(_("Married")) - # elif not rec.minor_siblings: - # rec.member_status = 'non_benefit' + rec.member_status = 'non_benefit' + reasons.append(_("She has exceeded the maximum age limit of %s years.") % female_benefit_age) if rec.is_work and rec.member_income > max_income_for_benefit and rec.education_status in [ 'educated'] and current_education_status_id.case_study == 'continuous': rec.member_status = 'non_benefit' diff --git a/odex25_benefit/odex_benefit/views/family_members.xml b/odex25_benefit/odex_benefit/views/family_members.xml index 69de9fe0f..d00379880 100644 --- a/odex25_benefit/odex_benefit/views/family_members.xml +++ b/odex25_benefit/odex_benefit/views/family_members.xml @@ -56,7 +56,7 @@