diff --git a/addons/point_of_sale/static/src/js/web_overrides/pos_config_form.js b/addons/point_of_sale/static/src/js/web_overrides/pos_config_form.js new file mode 100644 index 00000000000..62cc162af21 --- /dev/null +++ b/addons/point_of_sale/static/src/js/web_overrides/pos_config_form.js @@ -0,0 +1,37 @@ +odoo.define('point_of_sale.pos_config_form', function (require) { + 'use strict'; + + var FormController = require('web.FormController'); + var FormView = require('web.FormView'); + var viewRegistry = require('web.view_registry'); + + var PosConfigFormController = FormController.extend({ + _enableButtons: function (changedFields) { + let shouldReload = false; + for (let field of changedFields) { + if ( + field.startsWith('module_') || + field.startsWith('group_') || + field === 'is_posbox' + ) { + shouldReload = true; + break; + } + } + if (shouldReload) { + window.location.reload(); + } else { + this._super.apply(this, arguments); + } + }, + }); + + var PosConfigFormView = FormView.extend({ + config: _.extend({}, FormView.prototype.config, { + Controller: PosConfigFormController, + }), + }); + + viewRegistry.add('pos_config_form', PosConfigFormView); + return FormView; +}); diff --git a/addons/point_of_sale/views/pos_assets_common.xml b/addons/point_of_sale/views/pos_assets_common.xml index 7b9683c0505..e33150b7040 100644 --- a/addons/point_of_sale/views/pos_assets_common.xml +++ b/addons/point_of_sale/views/pos_assets_common.xml @@ -112,6 +112,7 @@ + diff --git a/addons/point_of_sale/views/pos_config_view.xml b/addons/point_of_sale/views/pos_config_view.xml index b8c27a75eda..0d7ab8e24ef 100644 --- a/addons/point_of_sale/views/pos_config_view.xml +++ b/addons/point_of_sale/views/pos_config_view.xml @@ -27,7 +27,7 @@ pos.config.form.view pos.config - + @@ -63,7 +63,11 @@ - + + + Save this page and come back here to set up the feature. + + Use employee credentials to log in to the PoS session and switch cashier - + + + Save this page and come back here to set up the feature. + + @@ -331,9 +339,9 @@ Allow global discounts on orders - - - + + + Save this page and come back here to set up the feature. @@ -359,8 +367,8 @@ Give customer rewards, free samples, etc. - - + + Save this page and come back here to set up the feature. diff --git a/addons/pos_discount/views/pos_discount_views.xml b/addons/pos_discount/views/pos_discount_views.xml index 0e38b16af64..a7839ca338f 100644 --- a/addons/pos_discount/views/pos_discount_views.xml +++ b/addons/pos_discount/views/pos_discount_views.xml @@ -5,7 +5,7 @@ pos.config - + diff --git a/addons/pos_hr/views/pos_config.xml b/addons/pos_hr/views/pos_config.xml index 668837c49ca..d5ca74a7f4c 100644 --- a/addons/pos_hr/views/pos_config.xml +++ b/addons/pos_hr/views/pos_config.xml @@ -5,7 +5,7 @@ pos.config - + Allowed Employees pos.config - +