[IMP] odex_benefit: IMP benefit

This commit is contained in:
younes 2026-01-04 09:32:28 +01:00
parent 3b98973e2a
commit a5e74f4bac
3 changed files with 8 additions and 38 deletions

View File

@ -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()

View File

@ -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 familys ineligibility for the associations 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'

View File

@ -56,7 +56,7 @@
<button name="action_exception" type="object"
string="Temporarily Exception" class="oe_highlight"
confirm="Are you sure you want to move to Temporarily Exception ?"
attrs="{'invisible': [('state','not in',['suspended_second_approve'])]}"/>
attrs="{'invisible': [('member_status','=','benefit')]}"/>
<button name="action_exception_first_accept" type="object"
string="Exception First Approve" class="oe_highlight"
groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager"