[IMP] odex_benefit: IMP benefit
This commit is contained in:
parent
1b3fd677a8
commit
a1520fffd7
|
|
@ -1077,6 +1077,19 @@ class GrantBenefitProfile(models.Model):
|
|||
res['domain'] = {'items': [('room_id', 'in', items_ids)]}
|
||||
return res
|
||||
|
||||
@api.onchange('branch_family_id')
|
||||
def _onchange_branch_family_id(self):
|
||||
if self.branch_family_id:
|
||||
branch = self.branch_family_id
|
||||
if branch.has_employees:
|
||||
chosen_branch = branch
|
||||
else:
|
||||
chosen_branch = branch.replacement_branch_id
|
||||
|
||||
self.branch_custom_id = chosen_branch
|
||||
else:
|
||||
self.branch_custom_id = False
|
||||
|
||||
@api.onchange("father_country_id", 'mother_country_id')
|
||||
def onchange_father_mother_country_id(self):
|
||||
res = {}
|
||||
|
|
|
|||
|
|
@ -744,6 +744,10 @@ class BranchSettings(models.Model):
|
|||
string='Branch Type')
|
||||
city_id = fields.Many2one('res.country.city')
|
||||
has_employees = fields.Boolean('Has Employees' ,defualt=True)
|
||||
replacement_branch_id = fields.Many2one(
|
||||
'branch.settings',
|
||||
string="Replacement Branch"
|
||||
)
|
||||
|
||||
class RelationSettings(models.Model):
|
||||
_name = 'relation.settings'
|
||||
|
|
|
|||
|
|
@ -992,6 +992,8 @@
|
|||
</group>
|
||||
<group>
|
||||
<field name="has_employees"/>
|
||||
<field name="replacement_branch_id"
|
||||
attrs="{'required':[('has_employees','=',False)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
|
|
|
|||
|
|
@ -569,13 +569,13 @@
|
|||
invisible="1"
|
||||
string="City" options="{'no_create': True, 'no_create_edit': True}"
|
||||
groups="!odex_benefit.group_benefit_manager"/>
|
||||
<field name="branch_family_id"
|
||||
readonly="1"
|
||||
options="{'no_create': True, 'no_create_edit': True}"/>
|
||||
<field name="branch_custom_id"
|
||||
readonly="1"
|
||||
options="{'no_create': True, 'no_create_edit': True}"
|
||||
groups="!odex_benefit.group_benefit_manager"/>
|
||||
<field name="branch_family_id"
|
||||
readonly="1"
|
||||
options="{'no_create': True, 'no_create_edit': True}"/>
|
||||
<field name="branch_has_employees" invisible="1"/>
|
||||
<field name="district_id"
|
||||
attrs="{'readonly':[('state', 'not in', ['draft', 'new', 'complete_info'])]}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue