[IMP] hr: Display certificate on employee form

closes odoo/odoo#33496

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Yannick Tivisse
2019-05-27 14:06:11 +00:00
parent 316b33c869
commit d83890dd14
4 changed files with 18 additions and 2 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ class Employee(models.Model):
('bachelor', 'Bachelor'),
('master', 'Master'),
('other', 'Other'),
], 'Certificate Level', default='master', groups="hr.group_hr_user", tracking=True)
], 'Certificate Level', default='other', groups="hr.group_hr_user", tracking=True)
study_field = fields.Char("Field of Study", placeholder='Computer Science', groups="hr.group_hr_user", tracking=True)
study_school = fields.Char("School", groups="hr.group_hr_user", tracking=True)
emergency_contact = fields.Char("Emergency Contact", groups="hr.group_hr_user", tracking=True)
+7 -1
View File
@@ -48,6 +48,9 @@ class User(models.Model):
additional_note = fields.Text(related='employee_id.additional_note', readonly=False, related_sudo=False)
barcode = fields.Char(related='employee_id.barcode', readonly=False, related_sudo=False)
pin = fields.Char(related='employee_id.pin', readonly=False, related_sudo=False)
certificate = fields.Selection(related='employee_id.certificate', readonly=False, related_sudo=False)
study_field = fields.Char(related='employee_id.study_field', readonly=False, related_sudo=False)
study_school = fields.Char(related='employee_id.study_school', readonly=False, related_sudo=False)
employee_warning = fields.Char("Missing employee warning", compute='_compute_employee_warning')
@api.depends('groups_id', 'employee_ids', 'active')
@@ -109,7 +112,10 @@ class User(models.Model):
'visa_no',
'work_email',
'work_location',
'work_phone'
'work_phone',
'certificate',
'study_field',
'study_school',
]
init_res = super(User, self).__init__(pool, cr)
+5
View File
@@ -253,6 +253,11 @@
<field name="spouse_complete_name" attrs="{'invisible': [('marital', 'not in', ['married', 'cohabitant'])]}" groups="hr.group_hr_user"/>
<field name="spouse_birthdate" attrs="{'invisible': [('marital', 'not in', ['married', 'cohabitant'])]}" groups="hr.group_hr_user"/>
</group>
<group string="Education">
<field name="certificate"/>
<field name="study_field"/>
<field name="study_school"/>
</group>
<group string="Dependant">
<field name="children"/>
</group>
+5
View File
@@ -104,6 +104,11 @@
<field name="spouse_complete_name" attrs="{'invisible': [('marital', 'not in', ['married', 'cohabitant'])]}"/>
<field name="spouse_birthdate" attrs="{'invisible': [('marital', 'not in', ['married', 'cohabitant'])]}"/>
</group>
<group string="Education">
<field name="certificate"/>
<field name="study_field"/>
<field name="study_school"/>
</group>
<group string="Dependant">
<field name="children"/>
</group>