diff --git a/odex25_benefit/odex_benefit/i18n/ar_001.po b/odex25_benefit/odex_benefit/i18n/ar_001.po index cc70568e2..e9d13a1b8 100644 --- a/odex25_benefit/odex_benefit/i18n/ar_001.po +++ b/odex25_benefit/odex_benefit/i18n/ar_001.po @@ -15910,34 +15910,6 @@ msgstr "" msgid "He has a physical or intellectual disability but is over %s years of age." msgstr "لديه إعاقة جسدية أو فكرية ولكنه تجاوز عمر %s" -#. module: odex_benefit -#: code:addons/odex_benefit/models/family_members.py:0 -#, python-format -msgid "" -"He is enrolled in a scientific or vocational specialization but is over %s years " -"of age." -msgstr "منتظم في أحد التخصصات العلمية أو المهنية ولكنه تجاوز عمر %s" - -#. module: odex_benefit -#: code:addons/odex_benefit/models/family_members.py:0 -#, python-format -msgid "He is enrolled in a medical specialization but is over %s years of age." -msgstr "منتظم في أحد التخصصات الطبية ولكنه تجاوز عمر %s" - -#. module: odex_benefit -#: code:addons/odex_benefit/models/family_members.py:0 -#, python-format -msgid "" -"He is over %s years of age and not enrolled in a scientific or medical " -"specialization." -msgstr "تجاوز عمر %s وليس منتظم في تخصص علمي أو طبي" - -#. module: odex_benefit -#: code:addons/odex_benefit/models/family_members.py:0 -#, python-format -msgid "He is over %s years of age and not enrolled in an educational institution." -msgstr "تجاوز عمر %s وغير منتظم بجهة تعلمية" - #. module: odex_benefit #: code:addons/odex_benefit/models/family_members.py:0 #, python-format @@ -18369,3 +18341,9 @@ msgstr "يجب أن تكون فترة الإيجار المطلوبة بالكا #, python-format msgid "Requested start date cannot be before the contract start date." msgstr "لا يمكن أن يكون تاريخ البدء المطلوب قبل تاريخ بدء العقد." + +#. module: odex_benefit +#: code:addons/odex_benefit/models/family_members.py:0 +#, python-format +msgid "Over %s years old and not enrolled in any educational institution." +msgstr "أكبر من %s سنة وغير منتظم بجهة تعليمية." \ No newline at end of file diff --git a/odex25_benefit/odex_benefit/models/family_members.py b/odex25_benefit/odex_benefit/models/family_members.py index dd6c95be3..741f11bac 100644 --- a/odex25_benefit/odex_benefit/models/family_members.py +++ b/odex25_benefit/odex_benefit/models/family_members.py @@ -250,8 +250,8 @@ class FamilyMemberProfile(models.Model): suspend_reason = fields.Many2one('suspend.reason', string='Suspend Reason') reason = fields.Text(string='Reason') suspend_description = fields.Text(string='Suspend Description') - suspend_attachment = fields.Many2many('ir.attachment','rel_suspend_member_attachment', - 'member_id','attachment_id',string='Suspend Attachment') + suspend_attachment = fields.Many2many('ir.attachment', 'rel_suspend_member_attachment', + 'member_id', 'attachment_id', string='Suspend Attachment') suspend_type = fields.Selection( selection=[('temporarily_suspend', 'Temporarily Suspended'), ('suspend', 'Suspend')], string="Suspend Type") suspend_method = fields.Selection(selection=[('manual', 'Manual'), ('auto', 'Auto')], string="Suspend Method", @@ -302,7 +302,6 @@ class FamilyMemberProfile(models.Model): def _expand_states(self, states, domain, order): return [key for key, val in type(self).state.selection] - @api.model def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None): if not args: @@ -589,16 +588,25 @@ 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 rec.education_status not in [ + if rec.education_status not in [ 'educated'] and current_education_status_id.case_study != 'continuous': rec.member_status = 'non_benefit' reasons.append( _("Over %s years old and not enrolled in any educational institution.") % male_benefit_age ) - elif current_education_status_id.case_study == 'continuous' and rec.age > exceptional_age_scientific_specialty: - rec.member_status = 'non_benefit' - reasons.append( - _("He has exceeded the maximum age limit of %s years for scientific specialties.") % exceptional_age_scientific_specialty) + 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: + 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' @@ -782,10 +790,11 @@ class FamilyMemberProfile(models.Model): family = rec.benefit_id if rec.relationn.relation_type in ['mother', 'replacement_mother']: - allowed_ids = [family.mother_id_number,family.replacement_mother_id_number] + allowed_ids = [family.mother_id_number, family.replacement_mother_id_number] if rec.member_id_number in allowed_ids: continue - if rec.member_id_number in [family.father_id_number,family.mother_id_number,family.replacement_mother_id_number]: + if rec.member_id_number in [family.father_id_number, family.mother_id_number, + family.replacement_mother_id_number]: raise ValidationError( _("Member ID %s cannot match father/mother/replacement mother ID.") % rec.member_id_number @@ -858,7 +867,8 @@ class FamilyMemberProfile(models.Model): 'suspend_type': 'suspend', }) else: - raise UserError(_("Final suspension cannot be executed until after the specified final suspension date.")) + raise UserError( + _("Final suspension cannot be executed until after the specified final suspension date.")) def action_suspend_first_accept(self): for rec in self: