[IMP] point_of_sale: Remove pos_config_form js_class

Purpose
=======

The logic has been moved from the pos.config to the res.config.settings
model/views, and therefore this js_class is not used anymore.

closes odoo/odoo#98641

Taskid: 2958057
Related: odoo/enterprise#30658
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Yannick Tivisse
2022-08-23 15:05:43 +02:00
parent 789606f57d
commit 39f92c2993
4 changed files with 1 additions and 58 deletions
-1
View File
@@ -79,7 +79,6 @@
'point_of_sale/static/src/scss/pos_dashboard.scss',
'point_of_sale/static/src/backend/tours/point_of_sale.js',
'point_of_sale/static/src/backend/debug_manager.js',
'point_of_sale/static/src/backend/web_overrides/**/*.js',
],
'web.assets_tests': [
'point_of_sale/static/tests/tours/**/*',
-14
View File
@@ -667,20 +667,6 @@ class PosConfig(models.Model):
result = self.env.cr.fetchall()
return result
@api.model
def are_there_uninstalled_modules(self, changed_fields):
modules_to_check = self._get_modules_to_check(changed_fields)
n_installed = self.env['ir.module.module'].search_count([('name', 'in', modules_to_check), ('state', '=', 'installed')])
return n_installed != len(modules_to_check)
@api.model
def _get_modules_to_check(self, changed_fields):
modules_to_check = []
for field in changed_fields:
if field.startswith('module_'):
modules_to_check.append(field.replace('module_', ''))
return modules_to_check
def action_pos_config_modal_edit(self):
return {
'view_mode': 'form',
@@ -1,42 +0,0 @@
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 rpc = require('web.rpc');
var PosConfigFormController = FormController.extend({
saveRecord: async function (recordID) {
const _super = this._super;
const record = this.model.localData[recordID || this.handle];
const fieldsToChange = Object.keys(
this.model._generateChanges(record, { viewType: undefined, changesOnly: true })
);
let shouldReload = false;
if (fieldsToChange.length) {
shouldReload = await rpc.query(
rpc.buildQuery({
model: 'pos.config',
method: 'are_there_uninstalled_modules',
args: [fieldsToChange],
})
);
}
const result = await _super.apply(this, arguments);
if (shouldReload) {
window.location.reload();
}
return result;
},
});
var PosConfigFormView = FormView.extend({
config: _.extend({}, FormView.prototype.config, {
Controller: PosConfigFormController,
}),
});
viewRegistry.add('pos_config_form', PosConfigFormView);
return FormView;
});
@@ -27,7 +27,7 @@
<field name="name">pos.config.form.view</field>
<field name="model">pos.config</field>
<field name="arch" type="xml">
<form string="Point of Sale Configuration" js_class="pos_config_form">
<form string="Point of Sale Configuration">
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<field name="active" invisible="1"/>