[FIX] l10n_be_hr_payroll: don't compute field dependent_children if no access

Once installed, a standard employee cannot open a employee form view since this
field was computed and that field children is not allowed without group hr_user
This commit is contained in:
Jeremy Kersten
2017-12-12 19:56:16 +01:00
parent a2ea4ba095
commit a9d58a3fc2
2 changed files with 2 additions and 2 deletions
@@ -221,7 +221,7 @@ class HrEmployee(models.Model):
disabled_children_bool = fields.Boolean(string='Disabled Children', help='if recipient children is/are declared disabled by law')
resident_bool = fields.Boolean(string='Nonresident', help='if recipient lives in a foreign country')
disabled_children_number = fields.Integer('Number of disabled children')
dependent_children = fields.Integer(compute='_compute_dependent_children', string='Considered number of dependent children')
dependent_children = fields.Integer(compute='_compute_dependent_children', string='Considered number of dependent children', groups="hr.group_hr_user")
other_dependent_people = fields.Boolean(string="Other Dependent People", help="If other people are dependent on the employee")
other_senior_dependent = fields.Integer('# seniors (>=65)', help="Number of seniors dependent on the employee, including the disabled ones")
other_disabled_senior_dependent = fields.Integer('# disabled seniors (>=65)')
@@ -141,7 +141,7 @@
<field name="disabled_children_bool"/>
<field name="disabled_children_number" attrs="{'invisible':[('disabled_children_bool','!=',True)]}" colspan="1" help="number of dependent children declared as disabled"/>
<field name="dependent_children" invisible="1"/>
<field name="other_dependent_people"/>
<field name="other_dependent_people" groups="hr.group_hr_user"/>
<field name="other_senior_dependent" attrs="{'invisible':[('other_dependent_people','!=',True)]}"/>
<field name="other_disabled_senior_dependent" attrs="{'invisible':[('other_dependent_people','!=',True)]}"/>
<field name="other_juniors_dependent" attrs="{'invisible':[('other_dependent_people','!=',True)]}"/>