Merge pull request #6256 from expsa/tre

Tre
This commit is contained in:
kchyounes19 2026-01-20 10:17:17 +01:00 committed by GitHub
commit 0d47c64401
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 58 additions and 3 deletions

View File

@ -18520,3 +18520,13 @@ msgstr "الحالة الاجتماعية للأم البديلة غير مؤه
msgid "The replacement mother's location is not eligible for benefits." msgid "The replacement mother's location is not eligible for benefits."
msgstr "مكان سكن الأم البديلة غير مؤهل للاستفادة." msgstr "مكان سكن الأم البديلة غير مؤهل للاستفادة."
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__can_request_temporary_exception
msgid "Can Request Temporary Exception"
msgstr "يمكن طلب استثناء مؤقت"
#. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
msgid "Exception Family Services Manager Approve"
msgstr "اعتماد مديرة خدمات المستفيدين للاستثناء"

View File

@ -293,6 +293,8 @@ class FamilyMemberProfile(models.Model):
resume_date = fields.Date(string="Return Date") resume_date = fields.Date(string="Return Date")
resume_notes = fields.Text(string="Return Notes") resume_notes = fields.Text(string="Return Notes")
exit_benefit_date = fields.Date(string="Exit Benefit Date") exit_benefit_date = fields.Date(string="Exit Benefit Date")
can_request_temporary_exception = fields.Boolean(string="Can Request Temporary Exception",
compute='_compute_can_request_temporary_exception', )
# def create(self, vals): # def create(self, vals):
# for line_vals in vals: # for line_vals in vals:
@ -343,6 +345,31 @@ class FamilyMemberProfile(models.Model):
rec.last_education_levels = False rec.last_education_levels = False
rec.case_study = False rec.case_study = False
@api.depends(
'relationn.relation_type',
'case_study',
'age',
'benefit_id',
)
def _compute_can_request_temporary_exception(self):
settings = self.env["family.validation.setting"].search([], limit=1)
exceptional_age_scientific = (
settings.exceptional_age_scientific_specialty
if settings else 22
)
for rec in self:
if not rec.relationn:
rec.can_request_temporary_exception = False
continue
is_son = rec.relationn.relation_type == 'son'
is_continuous = rec.case_study == 'continuous'
old_enough = (rec.age or 0) >= exceptional_age_scientific
rec.can_request_temporary_exception = is_son and is_continuous and old_enough
@api.model @api.model
def name_search(self, name='', args=None, operator='ilike', limit=100): def name_search(self, name='', args=None, operator='ilike', limit=100):
if self._context.get('members_domain_force_all'): if self._context.get('members_domain_force_all'):
@ -574,6 +601,7 @@ class FamilyMemberProfile(models.Model):
'state', 'state',
'is_dead', 'is_dead',
'is_work', 'is_work',
'case_study',
'benefit_id.member_ids.member_status', 'benefit_id.member_ids.member_status',
) )
def check_member_status(self): def check_member_status(self):
@ -1022,9 +1050,14 @@ class FamilyMemberProfile(models.Model):
def action_exception_second_accept(self): def action_exception_second_accept(self):
for rec in self: for rec in self:
rec.is_excluded_suspension = True rec.is_excluded_suspension = True
rec.state_a = 'exception_second_approve' rec.state_a = 'family_services_manager'
# rec.is_member_workflow = False # rec.is_member_workflow = False
def action_exception_third_accept(self):
for rec in self:
rec.is_excluded_suspension = True
rec.state_a = 'exception_second_approve'
def action_exception_final_accept(self): def action_exception_final_accept(self):
for rec in self: for rec in self:
rec.is_excluded_suspension = True rec.is_excluded_suspension = True

View File

@ -56,6 +56,12 @@
<button name="action_exception" type="object" <button name="action_exception" type="object"
string="Temporarily Exception" class="oe_highlight" string="Temporarily Exception" class="oe_highlight"
confirm="Are you sure you want to move to Temporarily Exception ?" confirm="Are you sure you want to move to Temporarily Exception ?"
groups="!odex_benefit.group_benefit_supervisor"
attrs="{'invisible': ['|','|',('action_type','=','exception'),('member_status','=','benefit'),('can_request_temporary_exception','=',False)]}"/>
<button name="action_exception" type="object"
string="Temporarily Exception" class="oe_highlight"
confirm="Are you sure you want to move to Temporarily Exception ?"
groups="odex_benefit.group_benefit_supervisor"
attrs="{'invisible': ['|',('action_type','=','exception'),('member_status','=','benefit')]}"/> attrs="{'invisible': ['|',('action_type','=','exception'),('member_status','=','benefit')]}"/>
<button name="action_exception_first_accept" type="object" <button name="action_exception_first_accept" type="object"
string="Exception First Approve" class="oe_highlight" string="Exception First Approve" class="oe_highlight"
@ -66,13 +72,18 @@
groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager" groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['first_approve'])]}" attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['first_approve'])]}"
/> />
<button name="action_exception_third_accept" type="object"
string="Exception Family Services Manager Approve" class="oe_highlight"
groups="odex_benefit.group_benefit_manager"
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['family_services_manager'])]}"
/>
<button name="action_exception_final_accept" type="object" <button name="action_exception_final_accept" type="object"
string="Exception Final Approve" class="oe_highlight" string="Exception Final Approve" class="oe_highlight"
attrs="{'invisible': [('state','not in',['exception_second_approve'])]}" attrs="{'invisible': [('state','not in',['exception_second_approve'])]}"
groups="odex_benefit.group_benefit_manager"/> groups="odex_benefit.group_benefit_manager"/>
<button name="action_exception_refuse" type="object" <button name="action_exception_refuse" type="object"
string="Exception Refuse" class="btn btn-danger" string="Exception Refuse" class="btn btn-danger"
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['waiting_approve','first_approve','exception_second_approve'])]}" attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['waiting_approve','first_approve','family_services_manager','exception_second_approve'])]}"
/> />
<field name="state" widget="statusbar" <field name="state" widget="statusbar"
statusbar_visible="draft,new,complete_info,waiting_approve,first_approve,second_approve"/> statusbar_visible="draft,new,complete_info,waiting_approve,first_approve,second_approve"/>
@ -195,12 +206,13 @@
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="last_education_levels" <field name="last_education_levels"
attrs="{'invisible':[('education_status','!=','educated')]}"/> attrs="{'invisible':[('education_status','!=','educated')]}"/>
<field name="case_study" <field name="case_study" force_save="1"
attrs="{'invisible':[('education_status','!=','educated')]}"/> attrs="{'invisible':[('education_status','!=','educated')]}"/>
</group> </group>
</group> </group>
<group> <group>
<group> <group>
<field name="can_request_temporary_exception" invisible="1"/>
<field name="sponsor_related_id" <field name="sponsor_related_id"
readonly="1"/> readonly="1"/>
<field name="sponsor_id" <field name="sponsor_id"