[FIX] hr: phone field on res.users is shadowed

- The added field `phone` on `res.users` shadow the field `phone`
inherited by `res.partner`.
The issue is that the field `phone` on `hr.employee` can be read only
by the employee or the HR team.

A lot of views tries to display the field `phone` expecting the one
declared in `res.partner` which should be readable by everyone.
But the one declared in `res.users` shadows it.

closes odoo/odoo#33569

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
This commit is contained in:
Toufik Ben Jaa
2019-05-22 12:31:41 +00:00
parent e9430ac5c1
commit 1569bef308
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ class User(models.Model):
job_title = fields.Char(related='employee_id.job_title', readonly=False)
work_phone = fields.Char(related='employee_id.work_phone', readonly=False)
mobile_phone = fields.Char(related='employee_id.mobile_phone', readonly=False)
phone = fields.Char(related='employee_id.phone', readonly=False, related_sudo=False)
employee_phone = fields.Char(related='employee_id.phone', readonly=False, related_sudo=False)
work_email = fields.Char(related='employee_id.work_email', readonly=False, related_sudo=False)
category_ids = fields.Many2many(related='employee_id.category_ids', string="Employee Tags", readonly=False, related_sudo=False)
department_id = fields.Many2one(related='employee_id.department_id', readonly=False, related_sudo=False)
@@ -90,7 +90,7 @@ class User(models.Model):
'parent_id',
'passport_id',
'permit_no',
'phone',
'employee_phone',
'pin',
'place_of_birth',
'spouse_birthdate',
+1 -1
View File
@@ -87,7 +87,7 @@
It should be different from the work address.
</div>
<field name="km_home_work"/>
<field name="phone"/>
<field name="employee_phone"/>
<field name="employee_bank_account_id"/>
</group>
<group string="Citizenship">