diff options
| author | Lucas Lefèvre <lul@odoo.com> | 2019-05-08 11:59:42 +0200 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2019-05-17 11:22:10 +0200 |
| commit | fac0df86cb9783a77a21bbdbec42e2d786de454a (patch) | |
| tree | 75c6e082f4cdcbb7f6dafd60399ed198c9b5d24a | |
| parent | 2b9aec24155e2ecc6164ad44a0b3d2dde14ea7f4 (diff) | |
[IMP] hr_holidays: Display approve view from systray
When clicking on an activity on the systray, the form
view should be the "approve view" (with the stats widget).
The view loaded by the systray JS is the default view.
Hence the approve view need to become the default view.
A few action that used the default view need to be adapted
since that default view has changed.
| -rw-r--r-- | addons/hr_holidays/tests/test_leave_requests.py | 2 | ||||
| -rw-r--r-- | addons/hr_holidays/views/hr_leave_views.xml | 45 |
2 files changed, 24 insertions, 23 deletions
diff --git a/addons/hr_holidays/tests/test_leave_requests.py b/addons/hr_holidays/tests/test_leave_requests.py index 9f32d96e6c6..737e904b438 100644 --- a/addons/hr_holidays/tests/test_leave_requests.py +++ b/addons/hr_holidays/tests/test_leave_requests.py @@ -157,7 +157,7 @@ class TestLeaveRequests(TestHrHolidaysBase): """ Create a department leave """ self.employee_hrmanager.write({'department_id': self.hr_dept.id}) self.assertFalse(self.env['hr.leave'].search([('employee_id', 'in', self.hr_dept.member_ids.ids)])) - leave_form = Form(self.env['hr.leave'].sudo(self.user_hrmanager)) + leave_form = Form(self.env['hr.leave'].sudo(self.user_hrmanager), view='hr_holidays.hr_leave_view_form_manager') leave_form.holiday_status_id = self.holidays_type_1 leave_form.holiday_type = 'department' leave_form.department_id = self.hr_dept diff --git a/addons/hr_holidays/views/hr_leave_views.xml b/addons/hr_holidays/views/hr_leave_views.xml index a87889e25a9..a82f725e543 100644 --- a/addons/hr_holidays/views/hr_leave_views.xml +++ b/addons/hr_holidays/views/hr_leave_views.xml @@ -46,7 +46,6 @@ domain="[('activity_ids.date_deadline', '<', context_today().strftime('%Y-%m-%d'))]" help="Show all records which has next action date is before today"/> <filter string="Today Activities" name="activities_today" - context="{'kanban_view_ref': 'hr_holidays.kanban_actty_view'}" domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/> <filter string="Future Activities" name="activities_upcoming_all" domain="[('activity_ids.date_deadline', '>', context_today().strftime('%Y-%m-%d')) @@ -137,26 +136,6 @@ </field> </record> - <record id="hr_leave_view_calendar" model="ir.ui.view"> - <field name="name">hr.leave.view.calendar</field> - <field name="model">hr.leave</field> - <field name="arch" type="xml"> - <calendar string="Time Off Request" event_open_popup="true" date_start="date_from" date_stop="date_to" mode="month" quick_add="False" color="employee_id"> - <field name="display_name"/> - </calendar> - </field> - </record> - - <record id="hr_leave_view_dashboard" model="ir.ui.view"> - <field name="name">hr.leave.view.dashboard</field> - <field name="model">hr.leave</field> - <field name="arch" type="xml"> - <calendar js_class="time_off_calendar" string="Time Off Request" event_open_popup="true" date_start="date_from" date_stop="date_to" mode="month" quick_add="False" color="employee_id"> - <field name="display_name"/> - </calendar> - </field> - </record> - <record id="hr_leave_view_activity" model="ir.ui.view"> <field name="name">hr.leave.view.activity</field> <field name="model">hr.leave</field> @@ -367,7 +346,7 @@ <field name="model">hr.leave</field> <field name="inherit_id" ref="hr_leave_view_form"/> <field name="mode">primary</field> - <field name="priority">16</field> + <field name="priority">5</field> <field name="arch" type="xml"> <xpath expr="//field[@name='holiday_status_id']" position="before"> <field name="employee_id"/> @@ -385,6 +364,16 @@ </field> </record> + <record id="hr_leave_view_calendar" model="ir.ui.view"> + <field name="name">hr.leave.view.calendar</field> + <field name="model">hr.leave</field> + <field name="arch" type="xml"> + <calendar string="Time Off Request" event_open_popup="true" readonly_form_view_id="%(hr_holidays.hr_leave_view_form_manager)d" form_view_id="%(hr_holidays.hr_leave_view_form_manager)d" date_start="date_from" date_stop="date_to" mode="month" quick_add="False" color="employee_id"> + <field name="display_name"/> + </calendar> + </field> + </record> + <record id="hr_leave_view_tree" model="ir.ui.view"> <field name="name">hr.holidays.view.tree</field> <field name="model">hr.leave</field> @@ -613,6 +602,18 @@ </p> </field> </record> + <record id="hr_leave_action_all_tree_form" model="ir.actions.act_window.view"> + <field name="sequence">2</field> + <field name="view_mode">tree</field> + <field name="act_window_id" ref="hr_leave_action_all"/> + <field name="view_id" ref="hr_leave_view_tree"/> + </record> + <record id="hr_leave_action_all_view_form" model="ir.actions.act_window.view"> + <field name="sequence">10</field> + <field name="view_mode">form</field> + <field name="act_window_id" ref="hr_leave_action_all"/> + <field name="view_id" ref="hr_leave_view_form_manager"/> + </record> <record id="hr_leave_action_action_approve_department" model="ir.actions.act_window"> <field name="name">Department Time Off</field> |
