Merge pull request #4326 from expsa/younes_dev_odex25_ensan

IMP benefit
This commit is contained in:
kchyounes19 2025-08-25 10:34:39 +01:00 committed by GitHub
commit e90975039f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View File

@ -408,7 +408,7 @@ class GrantBenefitProfile(models.Model):
('exception_second_approve', 'Exception Second Approve'),
('not_leaving', 'Not Leaving'),
('black_list', 'Black List'),
], string='state', default="draft", tracking=True)
], string='state', default="draft", tracking=True, group_expand='_expand_states')
branch_custom_id = fields.Many2one('branch.settings', string="Branch")
district_id = fields.Many2one('res.districts', string="District", domain="[('branch_custom_id','=',branch_custom_id)]")
meal_card = fields.Boolean(string="Meal Card",related="district_id.meal_card", store=True,related_sudo=True)
@ -587,6 +587,9 @@ class GrantBenefitProfile(models.Model):
('unique_code', "unique (code) WHERE state NOT IN ('draft', 'new')", 'This code already exists')
]
def _expand_states(self, states, domain, order):
return [key for key, val in type(self).state.selection]
@api.constrains('father_name', 'father_second_name', 'father_third_name', 'father_family_name',
'mother_name', 'mother_second_name', 'mother_third_name', 'mother_family_name',
'replacement_mother_name','replacement_mother_second_name','replacement_mother_third_name','replacement_mother_family_name')

View File

@ -622,6 +622,7 @@ class Committees(models.Model):
],
required=False, )
branch_custom_id = fields.Many2one("branch.settings", string="Branch")
active = fields.Boolean('Active', default=True)
def get_benefit_ids(self):
obj = self.env["grant.benefit"].search([])

View File

@ -7,9 +7,8 @@
<field name="arch" type="xml">
<tree string="committees">
<field name="name"/>
<!-- <field name="employee_id"/>-->
<!-- <field name="benefit_ids" string="Assign files"/>-->
<!-- <field name="type" invisible="1"/>-->
<field name="type" />
<field name="branch_custom_id"/>
</tree>
</field>
</record>