summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorKamesh Patel <kat@odoo.com>2020-09-25 06:21:34 +0000
committerKamesh Patel <kat@odoo.com>2020-09-28 11:16:15 +0000
commitcf8545e10062ba89ac0de5441cfcbdb65d921eaa (patch)
tree147008b656c9c9fed6fb294cf3c8a42d256a5663 /addons
parentf2a5476c52c1312d3dfc558f92b4a678d6aa5e25 (diff)
[FIX] sale_timesheet, web: disable autofocus on create invoce action
Before this commit: The date range widget opened by default when the 'create invoices' the wizard is opened. because the default focus is 'Timesheets Period' field. After this commit: Disable autofocus on 'create invoice' action, after this changes The date range widget is not opened by default when the 'create invoices' the wizard is opened. Task-2344289 closes odoo/odoo#58676 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/sale_timesheet/wizard/sale_make_invoice_advance_views.xml3
-rw-r--r--addons/web/static/src/js/views/form/form_view.js2
2 files changed, 4 insertions, 1 deletions
diff --git a/addons/sale_timesheet/wizard/sale_make_invoice_advance_views.xml b/addons/sale_timesheet/wizard/sale_make_invoice_advance_views.xml
index bf1d33fd9cf..676b618af38 100644
--- a/addons/sale_timesheet/wizard/sale_make_invoice_advance_views.xml
+++ b/addons/sale_timesheet/wizard/sale_make_invoice_advance_views.xml
@@ -5,6 +5,9 @@
<field name="model">sale.advance.payment.inv</field>
<field name="inherit_id" ref="sale.view_sale_advance_payment_inv"/>
<field name="arch" type="xml">
+ <xpath expr="//form" position="attributes">
+ <attribute name="disable_autofocus">true</attribute>
+ </xpath>
<xpath expr="//field[@name='deposit_taxes_id']" position="after">
<field name="invoicing_timesheet_enabled" invisible="1"/>
<label for="date_start_invoice_timesheet" string="Timesheets Period" attrs="{'invisible': [ '|', ('invoicing_timesheet_enabled', '=', False), ('advance_payment_method', '!=', 'delivered')]}"/>
diff --git a/addons/web/static/src/js/views/form/form_view.js b/addons/web/static/src/js/views/form/form_view.js
index e3ec5177df3..a7885e0c393 100644
--- a/addons/web/static/src/js/views/form/form_view.js
+++ b/addons/web/static/src/js/views/form/form_view.js
@@ -38,7 +38,7 @@ var FormView = BasicView.extend({
hasActionMenus = params.hasActionMenus;
}
this.controllerParams.hasActionMenus = hasActionMenus;
- this.controllerParams.disableAutofocus = params.disable_autofocus;
+ this.controllerParams.disableAutofocus = params.disable_autofocus || this.arch.attrs.disable_autofocus;
this.controllerParams.toolbarActions = viewInfo.toolbar;
this.controllerParams.footerToButtons = params.footerToButtons;