From 7c4caeefe5aec08491e3fc5fc0d31cabdff351c4 Mon Sep 17 00:00:00 2001 From: younes Date: Tue, 2 Sep 2025 08:36:09 +0100 Subject: [PATCH 1/2] IMP benefit --- .../views/empowerment_management.xml | 4 -- .../odex25_program_activity/views/program.xml | 4 -- odex25_ensan/odex_benefit/i18n/ar_001.po | 64 ------------------- odex25_ensan/odex_benefit/models/benefit.py | 19 ------ .../odex_benefit/models/family_members.py | 20 ++---- .../odex_benefit/models/service_request.py | 4 +- .../odex_benefit/views/benefit_view.xml | 27 +------- .../odex_benefit/views/family_members.xml | 9 --- .../models/service_request.py | 4 +- 9 files changed, 11 insertions(+), 144 deletions(-) diff --git a/odex25_ensan/odex25_empowermentmanagement/views/empowerment_management.xml b/odex25_ensan/odex25_empowermentmanagement/views/empowerment_management.xml index b187c7711..31dd77a49 100644 --- a/odex25_ensan/odex25_empowermentmanagement/views/empowerment_management.xml +++ b/odex25_ensan/odex25_empowermentmanagement/views/empowerment_management.xml @@ -180,8 +180,6 @@ - - @@ -206,8 +204,6 @@ - - - - @@ -445,8 +443,6 @@ - - male_benefit_age: - if rec.has_disabilities and rec.age > exceptional_age_has_disabilities: + if current_education_status_id.specialization_ids.is_scientific_specialty and rec.age > exceptional_age_scientific_specialty and not rec.minor_siblings : rec.member_status = 'non_benefit' - elif current_education_status_id.specialization_ids.is_scientific_specialty and rec.age > exceptional_age_scientific_specialty and not rec.has_disabilities and not rec.minor_siblings : + 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' - elif current_education_status_id.specialization_ids.is_medical_specialty and rec.age > exceptional_age_medical_specialty and not rec.has_disabilities and not rec.minor_siblings: - rec.member_status = 'non_benefit' - elif not any([current_education_status_id.specialization_ids.is_scientific_specialty, current_education_status_id.specialization_ids.is_medical_specialty, rec.has_disabilities]): + 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' if not rec.minor_siblings: rec.member_status = 'non_benefit' @@ -643,7 +633,7 @@ class FamilyMemberProfile(models.Model): # raise ValidationError( # _('The ID Number Already Exist!')) - @api.onchange('relationn','member_status','gender','birth_date', 'is_scientific_specialty', 'is_medical_specialty', 'has_disabilities', 'is_married', + @api.onchange('relationn','member_status','gender','birth_date', 'is_scientific_specialty', 'is_medical_specialty', 'is_married', 'minor_siblings','member_income','is_married','member_location_conf','education_status','case_study') def onchange_member_status(self): res ={} diff --git a/odex25_ensan/odex_benefit/models/service_request.py b/odex25_ensan/odex_benefit/models/service_request.py index 0ff876dca..cad17672c 100644 --- a/odex25_ensan/odex_benefit/models/service_request.py +++ b/odex25_ensan/odex_benefit/models/service_request.py @@ -742,11 +742,11 @@ class ServiceRequest(models.Model): daughter_members_above_age = rec.family_id.mapped('member_ids').filtered( lambda x: x.relationn.relation_type == 'daughter' and x.age > 18) disable_mother = rec.family_id.mapped('member_ids').filtered( - lambda x: x.relationn.relation_type == 'mother' and x.has_disabilities) + lambda x: x.relationn.relation_type == 'mother') work_mother = rec.family_id.mapped('member_ids').filtered( lambda x: x.relationn.relation_type == 'mother' and x.benefit.is_mother_work) disable_replacement_mother = rec.family_id.mapped('member_ids').filtered( - lambda x: x.relationn.relation_type == 'replacement_mother' and x.has_disabilities) + lambda x: x.relationn.relation_type == 'replacement_mother') work_replacement_mother = rec.family_id.mapped('member_ids').filtered(lambda x: x.relationn.relation_type == 'replacement_mother' and x.replacement_is_mother_work) if not rec.family_id.has_car: diff --git a/odex25_ensan/odex_benefit/views/benefit_view.xml b/odex25_ensan/odex_benefit/views/benefit_view.xml index 3a9325d95..391fbb6d1 100644 --- a/odex25_ensan/odex_benefit/views/benefit_view.xml +++ b/odex25_ensan/odex_benefit/views/benefit_view.xml @@ -497,10 +497,6 @@ attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/> - - @@ -586,10 +582,6 @@ attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/> - - @@ -661,7 +653,6 @@ - @@ -679,9 +670,6 @@ - - - @@ -1127,9 +1115,6 @@ - - - @@ -1251,16 +1236,8 @@ - - - - - @@ -1277,7 +1254,7 @@ - + diff --git a/odex25_ensan/odex_benefit/views/family_members.xml b/odex25_ensan/odex_benefit/views/family_members.xml index 4a1dd3f73..d948f9cba 100644 --- a/odex25_ensan/odex_benefit/views/family_members.xml +++ b/odex25_ensan/odex_benefit/views/family_members.xml @@ -121,8 +121,6 @@ attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/> - - - - @@ -170,7 +162,6 @@ - diff --git a/odex25_ensan/odex_benefit_project/models/service_request.py b/odex25_ensan/odex_benefit_project/models/service_request.py index 1e0b9e244..753dd86c5 100644 --- a/odex25_ensan/odex_benefit_project/models/service_request.py +++ b/odex25_ensan/odex_benefit_project/models/service_request.py @@ -248,9 +248,9 @@ class ServiceRequestInherit(models.Model): ('service_cat.service_type', '=', 'recruiting_driver'), ('id', '!=', self._origin.id)], limit=1) son_members_above_age = rec.family_id.mapped('member_ids').filtered(lambda x:x.relationn.relation_type == 'son' and x.age > 18) daughter_members_above_age = rec.family_id.mapped('member_ids').filtered(lambda x: x.relationn.relation_type == 'daughter' and x.age > 18) - disable_mother = rec.family_id.mapped('member_ids').filtered(lambda x: x.relationn.relation_type == 'mother' and x.has_disabilities) + disable_mother = rec.family_id.mapped('member_ids').filtered(lambda x: x.relationn.relation_type == 'mother') work_mother = rec.family_id.mapped('member_ids').filtered(lambda x: x.relationn.relation_type == 'mother' and x.benefit_id.is_mother_work) - disable_replacement_mother = rec.family_id.mapped('member_ids').filtered(lambda x: x.relationn.relation_type == 'replacement_mother' and x.has_disabilities) + disable_replacement_mother = rec.family_id.mapped('member_ids').filtered(lambda x: x.relationn.relation_type == 'replacement_mother') work_replacement_mother = rec.family_id.mapped('member_ids').filtered(lambda x: x.relationn.relation_type == 'replacement_mother' and x.replacement_is_mother_work) if not rec.family_id.has_car: raise UserError(_("You cannot request this service because you do not have a car")) From caddd2922d984d6ae47f570685b7962f62cd57b0 Mon Sep 17 00:00:00 2001 From: younes Date: Tue, 2 Sep 2025 08:46:37 +0100 Subject: [PATCH 2/2] IMP benefit --- .../odex25_program_activity/i18n/ar_001.po | 11 ++++++ .../odex25_program_activity/models/program.py | 12 +++--- .../odex25_program_activity/views/program.xml | 39 +++++++++++++++++++ 3 files changed, 57 insertions(+), 5 deletions(-) diff --git a/odex25_ensan/odex25_program_activity/i18n/ar_001.po b/odex25_ensan/odex25_program_activity/i18n/ar_001.po index 1a5ef65d7..9f38f1d30 100644 --- a/odex25_ensan/odex25_program_activity/i18n/ar_001.po +++ b/odex25_ensan/odex25_program_activity/i18n/ar_001.po @@ -517,6 +517,17 @@ msgstr "المسارات المرتبطة" msgid "Tracks that belong to this level" msgstr "المسارات التي تنتمي إلى هذا المستوى" +#. module: odex25_program_activity +#: model:ir.model.fields,field_description:odex25_program_activity.field_pa_program__program_type_id +msgid "Program Type" +msgstr "نوع البرنامج" + + +#. module: odex25_program_activity +#: model:ir.model.fields,field_description:odex25_program_activity.field_pa_program_type__pg_type +msgid "Name" +msgstr "نوع البرنامج" + diff --git a/odex25_ensan/odex25_program_activity/models/program.py b/odex25_ensan/odex25_program_activity/models/program.py index 87f3db529..611a2bc94 100644 --- a/odex25_ensan/odex25_program_activity/models/program.py +++ b/odex25_ensan/odex25_program_activity/models/program.py @@ -68,7 +68,9 @@ class PaProgramTrack(models.Model): name = fields.Char(string='Track Name', required=True) description = fields.Text(string='Track Description') - branch = fields.Char(string='Branch') + # branch = fields.Many2one('age.category',string='Branch') + branch = fields.Many2one("branch.settings", string='Branch', domain="[('branch_type','=','branches')]") + gender = fields.Selection( [('male', 'Male'), ('female', 'Female')], @@ -81,7 +83,7 @@ class PaProgramTrack(models.Model): help='Filter track based on age category', ) - study_category = fields.Char(string='Study Category') + study_category = fields.Many2one('education.level',string='Study Category') hobby = fields.Char(string='Hobby') study_status = fields.Char(string='Study Status') health_status = fields.Char(string='Health Status') @@ -125,8 +127,7 @@ class PaProgram(models.Model): program_type_id = fields.Many2one( 'pa.program.type', string='Program Type', - # required=True, - help='Program type registered in the program types settings' + ) payment_type = fields.Selection([ @@ -415,4 +416,5 @@ class PaProgram(models.Model): class PaProgramType(models.Model): _name = 'pa.program.type' - pg_type =fields.Char(string='نوع البرنامج') + + pg_type =fields.Char(string='Name') diff --git a/odex25_ensan/odex25_program_activity/views/program.xml b/odex25_ensan/odex25_program_activity/views/program.xml index 41d51fc2d..3334fa907 100644 --- a/odex25_ensan/odex25_program_activity/views/program.xml +++ b/odex25_ensan/odex25_program_activity/views/program.xml @@ -162,6 +162,7 @@ + @@ -183,6 +184,7 @@ + @@ -597,6 +599,42 @@ + + pa.program.type.tree + pa.program.type + + + + + + + + + + + pa.program.type.form + pa.program.type + +
+ + + + + +
+
+
+ + + انواع البرامج + pa.program.type + tree,form + + + + + + @@ -614,6 +652,7 @@ +