[IMP] hr_holidays: Close the leave dialog on click of save

Currently when click on "NEW TIME OFF REQUESTS" from the dashboard,
popup with save and discard buttons visible,
after create/save new time off request, the dialog is not closed.
the dialog is still there with footer buttons "Edit" & "Create".

After this commit, The dialog will be cloased when user click on save button.
Creted new form view because previous form view is used at other
place so we can not add buttons directly on that view.

closes odoo/odoo#45137

Task-id: 2183096
Closes: #45137
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
koz-odoo
2020-02-20 05:35:14 +00:00
committed by Barad Mahendra
parent da591f5c6c
commit 9c4b75f8a0
+16 -1
View File
@@ -363,6 +363,21 @@
</field>
</record>
<record id="hr_leave_view_form_dashboard_new_time_off" model="ir.ui.view">
<field name="name">hr.leave.view.form.dashboard.new.time.off</field>
<field name="model">hr.leave</field>
<field name="inherit_id" ref="hr_holidays.hr_leave_view_form_dashboard"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//sheet" position="after">
<footer>
<button string="Save" special="save" class="oe_highlight" />
<button string="Discard" special="cancel" />
</footer>
</xpath>
</field>
</record>
<record id="hr_leave_view_form_manager" model="ir.ui.view">
<field name="name">hr.leave.view.form.manager</field>
<field name="model">hr.leave</field>
@@ -588,7 +603,7 @@
<record id="hr_leave_action_my_request_view_form" model="ir.actions.act_window.view">
<field name="view_mode">form</field>
<field name="act_window_id" ref="hr_leave_action_my_request"/>
<field name="view_id" ref="hr_leave_view_form_dashboard"/>
<field name="view_id" ref="hr_leave_view_form_dashboard_new_time_off"/>
</record>
<record id="hr_leave_action_my" model="ir.actions.act_window">