[IMP] hr(_*), website_hr: replace actions menu by stat button
* attendance, contract, fleet, holidays, maintenance, presence, timesheet. For the model 'hr.employee', replace the actions menu 'Archive/Restore' by the stat button. That's why adapted changes regarding xpath. Also rename the actions menu 'Time Off' by 'Time off'. Linked to task 1984526 Related to PR #33720
This commit is contained in:
committed by
Thibault Delavallée
parent
2b7d899124
commit
b7c8cf1b60
@@ -46,7 +46,9 @@
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<!-- Used by other modules-->
|
||||
<button class="oe_stat_button" type="object" name="toggle_active" icon="fa-archive">
|
||||
<field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
|
||||
</button>
|
||||
</div>
|
||||
<field name="image" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image":"image_medium"}'/>
|
||||
<div class="oe_title">
|
||||
@@ -309,28 +311,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- TODO remove me in master -->
|
||||
<record id="hr_employee_action_subordinate_hierachy" model="ir.actions.act_window">
|
||||
<field name="name">Subordinate Hierarchy</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.employee</field>
|
||||
<field name="domain">['|', ('id','in',active_ids), ('parent_id', 'in', active_ids)]</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_partner_tree2"/>
|
||||
<field name="binding_model_id" ref="hr.model_hr_employee"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.server" id="hr_employee_action_toggle_active">
|
||||
<field name="name">Archive/Restore</field>
|
||||
<field name="model_id" ref="hr.model_hr_employee"/>
|
||||
<field name="binding_model_id" ref="hr.model_hr_employee"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
if records:
|
||||
records.toggle_active()
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="act_employee_from_department" model="ir.actions.act_window">
|
||||
<field name="name">Employees</field>
|
||||
<field name="res_model">hr.employee</field>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="priority">10</field>
|
||||
<field name="groups_id" eval="[(4,ref('hr_attendance.group_hr_attendance_user'))]"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<xpath expr="//button[@name='toggle_active']" position="before">
|
||||
<field name="attendance_state" invisible="1"/>
|
||||
<button name="%(hr_attendance_action_employee)d"
|
||||
class="oe_stat_button"
|
||||
@@ -18,8 +18,6 @@
|
||||
<span class="o_stat_text">Attendance</span>
|
||||
</div>
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="%(hr_attendance_action)d"
|
||||
class="oe_stat_button"
|
||||
icon="fa-calendar"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<field name="inherit_id" ref="hr.view_employee_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<xpath expr="//button[@name='toggle_active']" position="before">
|
||||
<button name="%(act_hr_employee_2_hr_contract)d"
|
||||
class="oe_stat_button"
|
||||
icon="fa-book"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
attrs="{'invisible': [('employee_cars_count','=', 0)]}"
|
||||
confirm="This report will contain only PDF files. If you want all documents, please go on vehicle page. Do you want to proceed?"/>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<xpath expr="//button[@name='toggle_active']" position="before">
|
||||
<button name="action_open_employee_cars" type="object"
|
||||
class="oe_stat_button" icon="fa-car" groups="fleet.fleet_group_manager"
|
||||
attrs="{'invisible': [('employee_cars_count','=', 0)]}">
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
</record>
|
||||
|
||||
<record id="act_hr_employee_holiday_request" model="ir.actions.act_window">
|
||||
<field name="name">Time Off</field>
|
||||
<field name="name">Time off</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.leave.report</field>
|
||||
<field name="binding_model_id" ref="hr.model_hr_employee"/>
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
<xpath expr="//group[@name='managers']" position="inside">
|
||||
<field name="leave_manager_id"/>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<xpath expr="//button[@name='toggle_active']" position="before">
|
||||
<field name="current_leave_id" invisible="1"/>
|
||||
<field name="show_leaves" invisible="1"/>
|
||||
<field name="is_absent" invisible="1"/>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="inherit_id" ref="hr.view_employee_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<xpath expr="//button[@name='toggle_active']" position="before">
|
||||
<button name="%(maintenance.hr_equipment_action)d"
|
||||
context="{'search_default_employee_id': id}"
|
||||
groups="maintenance.group_equipment_manager"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<field name="inherit_id" ref="hr.view_employee_form"/>
|
||||
<field name="groups_id" eval="[(4, ref('hr.group_hr_manager'))]"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<xpath expr="//button[@name='toggle_active']" position="before">
|
||||
<field name="hr_presence_state" invisible="1"/>
|
||||
<button name="%(ir_actions_server_action_open_presence_view)d"
|
||||
class="oe_stat_button"
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<xpath expr="//button[@name='toggle_active']" position="before">
|
||||
<button class="oe_stat_button" type="action" name="%(timesheet_action_from_employee)d" icon="fa-calendar" groups="hr_timesheet.group_timesheet_manager">
|
||||
<div class="o_stat_info">
|
||||
<span class="o_stat_text">Timesheets</span>
|
||||
|
||||
Reference in New Issue
Block a user