summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2017-04-26 10:44:38 +0200
committerYannick Tivisse <yti@odoo.com>2017-04-26 15:08:09 +0200
commit7964b81ac8546ebfd495c8f7fcd96cd2f1a7c85f (patch)
tree0e84c4188255d6163a1422d75a44b304617e5d72
parentc63e869fb207db9ae23d2704ecb598771cc15ab5 (diff)
[IMP] hr: Add some default values and fields
- Default gender is male - Default marital status is single - Move some fields from the contract to the employee (permit number, visa number, visa expiration date)
-rw-r--r--addons/hr/models/hr.py10
-rw-r--r--addons/hr/views/hr_views.xml5
2 files changed, 12 insertions, 3 deletions
diff --git a/addons/hr/models/hr.py b/addons/hr/models/hr.py
index 1f1f7295e7a..1bc91893203 100644
--- a/addons/hr/models/hr.py
+++ b/addons/hr/models/hr.py
@@ -118,13 +118,13 @@ class Employee(models.Model):
('male', 'Male'),
('female', 'Female'),
('other', 'Other')
- ], groups="hr.group_hr_user")
+ ], groups="hr.group_hr_user", default="male")
marital = fields.Selection([
('single', 'Single'),
- ('married', 'Married'),
+ ('married', 'Married (or similar)'),
('widower', 'Widower'),
('divorced', 'Divorced')
- ], string='Marital Status', groups="hr.group_hr_user")
+ ], string='Marital Status', groups="hr.group_hr_user", default='single')
birthday = fields.Date('Date of Birth', groups="hr.group_hr_user")
ssnid = fields.Char('SSN No', help='Social Security Number', groups="hr.group_hr_user")
sinid = fields.Char('SIN No', help='Social Insurance Number', groups="hr.group_hr_user")
@@ -135,6 +135,10 @@ class Employee(models.Model):
domain="[('partner_id', '=', address_home_id)]",
groups="hr.group_hr_user",
help='Employee bank salary account')
+ permit_no = fields.Char('Work Permit No')
+ visa_no = fields.Char('Visa No')
+ visa_expire = fields.Date('Visa Expire Date')
+
# image: all image fields are base64 encoded and PIL-supported
image = fields.Binary(
"Photo", default=_default_image, attachment=True,
diff --git a/addons/hr/views/hr_views.xml b/addons/hr/views/hr_views.xml
index 8721a02057d..bdbe127e84c 100644
--- a/addons/hr/views/hr_views.xml
+++ b/addons/hr/views/hr_views.xml
@@ -95,6 +95,11 @@
<group string="Birth">
<field name="birthday"/>
</group>
+ <group string="Work Permit" name="work_permit">
+ <field name="visa_no"/>
+ <field name="permit_no"/>
+ <field name="visa_expire"/>
+ </group>
</group>
</page>
<page name="hr_settings" string="HR Settings" groups="hr.group_hr_user">