[IMP] hr_employee: improve form usability

Improve slightly the layout of some forms related to employee and contracts.

Modified modules:
hr
hr_expense
hr_holidays
timesheet_grid
hr_contract_salary
hr_payroll_account

Task ID 2277298

closes odoo/odoo#52981

Related: odoo/enterprise#11156
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Simon Genin (ges)
2020-08-04 09:21:00 +00:00
parent 4abe3ea9c7
commit 8a6a4766d9
7 changed files with 35 additions and 13 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ class HrEmployeePrivate(models.Model):
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)
emergency_phone = fields.Char("Emergency Phone", groups="hr.group_hr_user", tracking=True)
km_home_work = fields.Integer(string="Km Home-Work", groups="hr.group_hr_user", tracking=True)
km_home_work = fields.Integer(string="Home-Work Distance", groups="hr.group_hr_user", tracking=True)
image_1920 = fields.Image(default=_default_image)
phone = fields.Char(related='address_home_id.phone', related_sudo=False, string="Private Phone", groups="hr.group_hr_user")
+3 -2
View File
@@ -62,6 +62,7 @@
<field name="department_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="parent_id"/>
<field name="coach_id"/>
</group>
</group>
<notebook>
@@ -73,8 +74,8 @@
context="{'show_address': 1}"
options='{"always_reload": True, "highlight_first_line": True}'/>
</group>
<group name="managers" string="Responsibles">
<field name="coach_id"/>
<group name="managers" string="Approvers" invisible="1">
<!-- overridden in other modules -->
</group>
<group string="Schedule" groups="base.group_no_one">
<field name="resource_calendar_id"/>
+10 -4
View File
@@ -89,12 +89,12 @@
<field name="mobile_phone" widget="phone"/>
<field name="work_phone" widget="phone"/>
<field name="work_email" widget="email"/>
<field name="work_location"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group>
<field name="department_id"/>
<field name="parent_id"/>
<field name="coach_id"/>
</group>
</group>
<notebook>
@@ -105,9 +105,10 @@
<field name="address_id"
context="{'show_address': 1}"
options='{"always_reload": True, "highlight_first_line": True}'/>
<field name="work_location"/>
</group>
<group name="managers" string="Responsibles">
<field name="coach_id"/>
<group name="managers" string="Approvers" class="hide-group-if-empty">
<!-- is overridden in other hr related modules -->
</group>
<group name="departure" string="Departure" attrs="{'invisible': [('active', '=', True)]}">
<field name="departure_reason"/>
@@ -133,7 +134,12 @@
<field name="private_email" string="Email"/>
<field name="phone" class="o_force_ltr" groups="hr.group_hr_user" string="Phone"/>
<field name="bank_account_id" context="{'default_partner_id': address_home_id}"/>
<field name="km_home_work" groups="hr.group_hr_user"/>
<label for="km_home_work"/>
<div class="o_row">
<field name="km_home_work" groups="hr.group_hr_user"/>
<span>Km</span>
</div>
</group>
<group string="Citizenship">
<field name="country_id" options='{"no_open": True, "no_create": True}'/>
+6 -3
View File
@@ -93,6 +93,10 @@
<field name="work_location" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="company_id" invisible="1"/>
</group>
<group>
<field name="employee_parent_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="coach_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</group>
</group>
<notebook>
<page name="preferences" string="Preferences">
@@ -108,9 +112,8 @@
options='{"always_reload": True, "highlight_first_line": True}'
attrs="{'readonly': [('can_edit', '=', False)]}"/>
</group>
<group name="managers" string="Responsibles">
<field name="employee_parent_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<field name="coach_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
<group name="managers" string="Approvers" class="hide-group-if-empty">
<!-- overridden in other modules -->
</group>
</div>
</div>
@@ -195,7 +195,7 @@
</group>
<notebook>
<page string="Contract Details" name="other">
<group string="Notes">
<group name="notes_group" string="Notes">
<field name="notes" nolabel="1"/>
</group>
</page>
+7 -1
View File
@@ -9,6 +9,9 @@
<xpath expr="//group[@name='managers']" position="inside">
<field name="expense_manager_id" context="{'default_company_id': company_id}"/>
</xpath>
<xpath expr="//group[@name='managers']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
</field>
</record>
@@ -18,7 +21,7 @@
<field name="inherit_id" ref="hr.view_employee_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='work_location']" position="after">
<field name="expense_manager_id" optional="hide"/>
<field name="expense_manager_id" optional="hide" string="Expense Approver"/>
</xpath>
</field>
</record>
@@ -31,6 +34,9 @@
<xpath expr="//group[@name='managers']" position="inside">
<field name="expense_manager_id" attrs="{'readonly': [('can_edit', '=', False)]}" context="{'default_company_id': company_id}"/>
</xpath>
<xpath expr="//group[@name='managers']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
</field>
</record>
+7 -1
View File
@@ -118,6 +118,9 @@
<xpath expr="//group[@name='managers']" position="inside">
<field name="leave_manager_id"/>
</xpath>
<xpath expr="//group[@name='managers']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<div name="button_box" position="inside">
<field name="current_leave_id" invisible="1"/>
<field name="show_leaves" invisible="1"/>
@@ -163,7 +166,7 @@
<field name="inherit_id" ref="hr.view_employee_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='work_location']" position="after">
<field name="leave_manager_id" optional="hide"/>
<field name="leave_manager_id" optional="hide" string="Time Off Approver"/>
</xpath>
</field>
</record>
@@ -215,6 +218,9 @@
<xpath expr="//group[@name='managers']" position="inside">
<field name="leave_manager_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</xpath>
<xpath expr="//group[@name='managers']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<field name="show_leaves" invisible="1"/>
<field name="employee_ids" invisible="1"/>