diff --git a/web_widget_one2many_product_picker/README.rst b/web_widget_one2many_product_picker/README.rst
index bd6dc7ef0..21ec5ffbe 100644
--- a/web_widget_one2many_product_picker/README.rst
+++ b/web_widget_one2many_product_picker/README.rst
@@ -14,16 +14,16 @@ Web Widget One2Many Product Picker
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
- :target: https://github.com/OCA/web/tree/12.0/web_widget_one2many_product_picker
+ :target: https://github.com/OCA/web/tree/13.0/web_widget_one2many_product_picker
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_widget_one2many_product_picker
+ :target: https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_widget_one2many_product_picker
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/162/12.0
+ :target: https://runbot.odoo-community.org/runbot/162/13.0
:alt: Try me on Runbot
-|badge1| |badge2| |badge3| |badge4| |badge5|
+|badge1| |badge2| |badge3| |badge4| |badge5|
Adds the 'one2many_product_picker' friendly mobile widget to create one2many lines linked with product.product records.
@@ -196,12 +196,12 @@ accept changes.
Parts of the widget:
~~~~~~~~~~~~~~~~~~~~
- .. image:: https://raw.githubusercontent.com/OCA/web/12.0/web_widget_one2many_product_picker/static/img/product_picker_anat.png
+ .. image:: https://raw.githubusercontent.com/OCA/web/13.0/web_widget_one2many_product_picker/static/img/product_picker_anat.png
Preview:
~~~~~~~~
- .. image:: https://raw.githubusercontent.com/OCA/web/12.0/web_widget_one2many_product_picker/static/img/product_picker.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/13.0/web_widget_one2many_product_picker/static/img/product_picker.gif
Known issues / Roadmap
======================
@@ -215,7 +215,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -249,6 +249,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/web `_ project on GitHub.
+This module is part of the `OCA/web `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/web_widget_one2many_product_picker/__manifest__.py b/web_widget_one2many_product_picker/__manifest__.py
index 75eecd4ca..f9b68f363 100644
--- a/web_widget_one2many_product_picker/__manifest__.py
+++ b/web_widget_one2many_product_picker/__manifest__.py
@@ -4,14 +4,14 @@
{
"name": "Web Widget One2Many Product Picker",
"summary": "Widget to select products on one2many fields",
- "version": "12.0.2.3.0",
+ "version": "13.0.1.0.0",
"category": "Website",
- "author": "Tecnativa, " "Odoo Community Association (OCA)",
- "website": "https://www.tecnativa.com",
+ "author": "Tecnativa, Odoo Community Association (OCA)",
+ "website": "https://github.com/OCA/web",
"license": "AGPL-3",
- "depends": ["product",],
- "data": ["templates/assets.xml",],
- "qweb": ["static/src/xml/one2many_product_picker.xml",],
+ "depends": ["product"],
+ "data": ["templates/assets.xml"],
+ "qweb": ["static/src/xml/one2many_product_picker.xml"],
"installable": True,
"auto_install": False,
}
diff --git a/web_widget_one2many_product_picker/i18n/web_widget_one2many_product_picker.pot b/web_widget_one2many_product_picker/i18n/web_widget_one2many_product_picker.pot
index 8e01a53b5..ad2e0a011 100644
--- a/web_widget_one2many_product_picker/i18n/web_widget_one2many_product_picker.pot
+++ b/web_widget_one2many_product_picker/i18n/web_widget_one2many_product_picker.pot
@@ -107,4 +107,3 @@ msgstr ""
#, python-format
msgid "[No widget %s]"
msgstr ""
-
diff --git a/web_widget_one2many_product_picker/models/product_product.py b/web_widget_one2many_product_picker/models/product_product.py
index f27dc8c7f..2e477a44e 100644
--- a/web_widget_one2many_product_picker/models/product_product.py
+++ b/web_widget_one2many_product_picker/models/product_product.py
@@ -1,37 +1,21 @@
# Copyright 2020 Tecnativa - Alexandre D. Díaz
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
-from odoo import api, fields, models, tools
+from odoo import fields, models
class ProductProduct(models.Model):
_inherit = "product.product"
image_variant_medium = fields.Binary(
- "Variant Image Medium (Computed)",
- compute="_compute_variant_image",
+ "Variant Image Medium (Related)",
+ related="image_512",
help="This field holds the image used as image for the product variant"
"or product image medium, limited to 512x512px.",
)
image_variant_big = fields.Binary(
- "Variant Image Big (Computed)",
- compute="_compute_variant_image",
+ "Variant Image Big (Related)",
+ related="image_1024",
help="This field holds the image used as image for the product variant"
"or product image, limited to 1024x1024px.",
)
-
- @api.depends("image_variant", "product_tmpl_id.image")
- def _compute_variant_image(self):
- for record in self:
- if record.image_variant:
- resized_images = tools.image_get_resized_images(
- record.image_variant,
- return_big=False,
- return_small=False,
- avoid_resize_medium=True,
- )
- record.image_variant_medium = resized_images["image_medium"]
- record.image_variant_big = record.image_variant
- else:
- record.image_variant_medium = record.product_tmpl_id.image_medium
- record.image_variant_big = record.product_tmpl_id.image
diff --git a/web_widget_one2many_product_picker/static/description/index.html b/web_widget_one2many_product_picker/static/description/index.html
index de595921c..a83807324 100644
--- a/web_widget_one2many_product_picker/static/description/index.html
+++ b/web_widget_one2many_product_picker/static/description/index.html
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

Adds the ‘one2many_product_picker’ friendly mobile widget to create one2many lines linked with product.product records.
Table of contents
@@ -579,13 +579,13 @@ accept changes.
-
+
@@ -601,7 +601,7 @@ accept changes.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -633,7 +633,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-
This module is part of the OCA/web project on GitHub.
+
This module is part of the OCA/web project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/web_widget_one2many_product_picker/static/src/js/tools.js b/web_widget_one2many_product_picker/static/src/js/tools.js
index 361aa3bbb..5181b1de4 100644
--- a/web_widget_one2many_product_picker/static/src/js/tools.js
+++ b/web_widget_one2many_product_picker/static/src/js/tools.js
@@ -3,7 +3,7 @@
odoo.define("web_widget_one2many_product_picker.tools", function(require) {
"use strict";
- var field_utils = require("web.field_utils");
+ const field_utils = require("web.field_utils");
/**
* Calculate the price with discount
diff --git a/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_create_form.js b/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_create_form.js
index 478b0622d..63a54b389 100644
--- a/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_create_form.js
+++ b/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_create_form.js
@@ -1,3 +1,4 @@
+/* global py */
// Copyright 2020 Tecnativa - Alexandre Díaz
// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
odoo.define("web_widget_one2many_product_picker.ProductPickerQuickCreateForm", function(
@@ -5,18 +6,18 @@ odoo.define("web_widget_one2many_product_picker.ProductPickerQuickCreateForm", f
) {
"use strict";
- var core = require("web.core");
- var Widget = require("web.Widget");
- var widgetRegistry = require("web.widget_registry");
- var ProductPickerQuickCreateFormView = require("web_widget_one2many_product_picker.ProductPickerQuickCreateFormView")
+ const core = require("web.core");
+ const Widget = require("web.Widget");
+ const widgetRegistry = require("web.widget_registry");
+ const ProductPickerQuickCreateFormView = require("web_widget_one2many_product_picker.ProductPickerQuickCreateFormView")
.ProductPickerQuickCreateFormView;
- var qweb = core.qweb;
+ const qweb = core.qweb;
/**
* This widget render a Form. Used by FieldOne2ManyProductPicker
*/
- var ProductPickerQuickCreateForm = Widget.extend({
+ const ProductPickerQuickCreateForm = Widget.extend({
className: "oe_one2many_product_picker_quick_create",
xmlDependencies: [
"/web_widget_one2many_product_picker/static/src/xml/one2many_product_picker_quick_create.xml",
@@ -50,10 +51,9 @@ odoo.define("web_widget_one2many_product_picker.ProductPickerQuickCreateForm", f
* @override
*/
start: function() {
- var self = this;
- var def1 = this._super.apply(this, arguments);
- var form_arch = this._generateFormArch();
- var fieldsView = {
+ const def1 = this._super.apply(this, arguments);
+ const form_arch = this._generateFormArch();
+ const fieldsView = {
arch: form_arch,
fields: this.fields,
viewFields: this.fields,
@@ -62,11 +62,11 @@ odoo.define("web_widget_one2many_product_picker.ProductPickerQuickCreateForm", f
model: this.basicFieldParams.field.relation,
};
- var node_context = this.node.attr("context") || "{}";
+ const node_context = this.node.attr("context") || "{}";
this.nodeContext = py.eval(node_context, {
active_id: this.res_id || false,
});
- var refinedContext = _.extend(
+ const refinedContext = _.extend(
{},
this.main_state.getContext(),
this.nodeContext
@@ -92,13 +92,13 @@ odoo.define("web_widget_one2many_product_picker.ProductPickerQuickCreateForm", f
// If (this.id) {
// this.basicFieldParams.model.save(this.id, {savePoint: true});
// }
- var def2 = this.formView.getController(this).then(function(controller) {
- self.controller = controller;
- self.$el.empty();
- self.controller.appendTo(self.$el);
+ const def2 = this.formView.getController(this).then(controller => {
+ this.controller = controller;
+ this.$el.empty();
+ this.controller.appendTo(this.$el);
});
- return $.when(def1, def2);
+ return Promise.all([def1, def2]);
},
on_attach_callback: function() {
@@ -112,7 +112,7 @@ odoo.define("web_widget_one2many_product_picker.ProductPickerQuickCreateForm", f
* @returns {String}
*/
_generateFormArch: function() {
- var template =
+ let template =
"";
template += this.basicFieldParams.field.views.form.arch;
template += "";
@@ -140,21 +140,20 @@ odoo.define("web_widget_one2many_product_picker.ProductPickerQuickCreateForm", f
this.id = evt.data.baseRecordID;
this.start();
} else {
- var self = this;
this.getParent()
._generateVirtualState({}, this.editContext)
- .then(function(state) {
- var data = {};
- data[self.compareKey] = {
+ .then(state => {
+ const data = {};
+ data[this.compareKey] = {
operation: "ADD",
id: evt.data.compareValue,
};
- self.basicFieldParams.model
+ this.basicFieldParams.model
._applyChange(state.id, data)
- .then(function() {
- self.res_id = state.res_id;
- self.id = state.id;
- self.start();
+ .then(() => {
+ this.res_id = state.res_id;
+ this.id = state.id;
+ this.start();
});
});
}
diff --git a/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_create_form_view.js b/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_create_form_view.js
index 8418987fa..6fc6c12f9 100644
--- a/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_create_form_view.js
+++ b/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_create_form_view.js
@@ -10,20 +10,19 @@ odoo.define(
* is used by the RecordQuickCreate in One2ManyProductPicker views.
*/
- var QuickCreateFormView = require("web.QuickCreateFormView");
- var BasicModel = require("web.BasicModel");
- var core = require("web.core");
+ const QuickCreateFormView = require("web.QuickCreateFormView");
+ const BasicModel = require("web.BasicModel");
+ const core = require("web.core");
- var qweb = core.qweb;
+ const qweb = core.qweb;
BasicModel.include({
_applyOnChange: function(values, record, viewType) {
- var vt = viewType || record.viewType;
// Ignore changes by record context 'ignore_onchanges' fields
if ("ignore_onchanges" in record.context) {
- var ignore_changes = record.context.ignore_onchanges;
- for (var index in ignore_changes) {
- var field_name = ignore_changes[index];
+ const ignore_changes = record.context.ignore_onchanges;
+ for (const index in ignore_changes) {
+ const field_name = ignore_changes[index];
delete values[field_name];
}
delete record.context.ignore_onchanges;
@@ -32,7 +31,7 @@ odoo.define(
},
});
- var ProductPickerQuickCreateFormRenderer = QuickCreateFormView.prototype.config.Renderer.extend(
+ const ProductPickerQuickCreateFormRenderer = QuickCreateFormView.prototype.config.Renderer.extend(
{
/**
* @override
@@ -46,7 +45,7 @@ odoo.define(
}
);
- var ProductPickerQuickCreateFormController = QuickCreateFormView.prototype.config.Controller.extend(
+ const ProductPickerQuickCreateFormController = QuickCreateFormView.prototype.config.Controller.extend(
{
events: _.extend({}, QuickCreateFormView.prototype.events, {
"click .oe_record_add": "_onClickAdd",
@@ -67,14 +66,14 @@ odoo.define(
* Create or accept changes
*/
auto: function() {
- var record = this.model.get(this.handle);
+ const record = this.model.get(this.handle);
if (
record.context.has_changes_confirmed ||
typeof record.context.has_changes_confirmed === "undefined"
) {
return;
}
- var state = this._getRecordState();
+ const state = this._getRecordState();
if (state === "new") {
this._add();
} else if (state === "dirty") {
@@ -87,18 +86,20 @@ odoo.define(
* - record: Normal
* - new: Is a new record
* - dirty: Has changes
+ *
+ * @returns {Object}
*/
_getRecordState: function() {
- var record = this.model.get(this.handle);
- var state = "record";
+ const record = this.model.get(this.handle);
+ let state = "record";
if (this.model.isNew(record.id)) {
state = "new";
} else if (record.isDirty()) {
state = "dirty";
}
if (state === "new") {
- for (var index in this.mainRecordData.data) {
- var recordData = this.mainRecordData.data[index];
+ for (const index in this.mainRecordData.data) {
+ const recordData = this.mainRecordData.data[index];
if (recordData.ref === record.ref) {
if (record.isDirty()) {
state = "dirty";
@@ -160,12 +161,12 @@ odoo.define(
/**
* @private
- * @param {Array[String]} fields_changed
+ * @param {Array} fields_changed
* @returns {Boolean}
*/
_needReloadCard: function(fields_changed) {
- for (var index in fields_changed) {
- var field = fields_changed[index];
+ for (const index in fields_changed) {
+ const field = fields_changed[index];
if (field === this.fieldMap[this.compareKey]) {
return true;
}
@@ -182,33 +183,33 @@ odoo.define(
* @param {ChangeEvent} ev
*/
_onFieldChanged: function(ev) {
- var fields_changed = Object.keys(ev.data.changes);
+ const fields_changed = Object.keys(ev.data.changes);
if (this._needReloadCard(fields_changed)) {
- var field = ev.data.changes[fields_changed[0]];
- var new_value = false;
+ const field = ev.data.changes[fields_changed[0]];
+ let new_value = false;
if (typeof field === "object") {
new_value = field.id;
} else {
new_value = field;
}
- var reload_values = {
+ const reload_values = {
compareValue: new_value,
};
- var record = this.model.get(this.handle);
- if (!("base_record_id" in record.context)) {
- var old_value = record.data[this.compareKey];
+ const record = this.model.get(this.handle);
+ if ("base_record_id" in record.context) {
+ reload_values.baseRecordID = record.context.base_record_id;
+ reload_values.baseRecordResID =
+ record.context.base_record_res_id;
+ reload_values.baseRecordCompareValue =
+ record.context.base_record_compare_value;
+ } else {
+ let old_value = record.data[this.compareKey];
if (typeof old_value === "object") {
old_value = old_value.data.id;
}
reload_values.baseRecordID = record.id;
reload_values.baseRecordResID = record.ref;
reload_values.baseRecordCompareValue = old_value;
- } else {
- reload_values.baseRecordID = record.context.base_record_id;
- reload_values.baseRecordResID =
- record.context.base_record_res_id;
- reload_values.baseRecordCompareValue =
- record.context.base_record_compare_value;
}
this.trigger_up("reload_view", reload_values);
@@ -237,28 +238,30 @@ odoo.define(
_add: function() {
if (this._disabled) {
// Don't do anything if we are already creating a record
- return $.Deferred();
+ return Promise.resolve();
}
this.model.updateRecordContext(this.handle, {
has_changes_confirmed: true,
});
- var self = this;
this._disableQuickCreate();
return this.saveRecord(this.handle, {
stayInEdit: true,
reload: true,
savePoint: true,
viewType: "form",
- }).then(function() {
- var record = self.model.get(self.handle);
- self.trigger_up("restore_flip_card", {
- success_callback: function() {
- self.trigger_up("create_quick_record", {
+ }).then(() => {
+ const record = this.model.get(this.handle);
+ this.model.updateRecordContext(this.handle, {saving: true});
+ this.trigger_up("restore_flip_card", {
+ success_callback: () => {
+ this.trigger_up("create_quick_record", {
id: record.id,
+ callback: () => {
+ this.model.unsetDirty(this.handle);
+ // Self._updateButtons();
+ this._enableQuickCreate();
+ },
});
- self.model.unsetDirty(self.handle);
- // Self._updateButtons();
- self._enableQuickCreate();
},
block: true,
});
@@ -267,51 +270,51 @@ odoo.define(
_remove: function() {
if (this._disabled) {
- // Don't do anything if we are already creating a record
- return $.Deferred();
+ return Promise.resolve();
}
this._disableQuickCreate();
this.trigger_up("restore_flip_card", {block: true});
- var record = this.model.get(this.handle);
+ const record = this.model.get(this.handle);
this.trigger_up("list_record_remove", {
id: record.id,
});
},
_change: function() {
- var self = this;
+ const self = this;
if (this._disabled) {
// Don't do anything if we are already creating a record
- return $.Deferred();
+ return Promise.resolve();
}
this._disableQuickCreate();
this.model.updateRecordContext(this.handle, {
has_changes_confirmed: true,
});
- var record = this.model.get(this.handle);
+ const record = this.model.get(this.handle);
this.trigger_up("restore_flip_card", {
success_callback: function() {
self.trigger_up("update_quick_record", {
id: record.id,
+ callback: function() {
+ self.model.unsetDirty(self.handle);
+ // Self._updateButtons();
+ self._enableQuickCreate();
+ },
});
- self.model.unsetDirty(self.handle);
- // Self._updateButtons();
- self._enableQuickCreate();
},
block: true,
});
},
_discard: function() {
- var self = this;
if (this._disabled) {
// Don't do anything if we are already creating a record
- return $.Deferred();
+ return Promise.resolve();
}
this._disableQuickCreate();
- var record = this.model.get(this.handle);
+ const record = this.model.get(this.handle);
this.model.discardChanges(this.handle, {
rollback: true,
});
@@ -324,11 +327,11 @@ odoo.define(
this._updateButtons();
this._enableQuickCreate();
} else {
- this.update({}, {reload: false}).then(function() {
- self.model.unsetDirty(self.handle);
- self.trigger_up("restore_flip_card");
- self._updateButtons();
- self._enableQuickCreate();
+ this.update({}, {reload: false}).then(() => {
+ this.model.unsetDirty(this.handle);
+ this.trigger_up("restore_flip_card");
+ this._updateButtons();
+ this._enableQuickCreate();
});
}
},
@@ -371,7 +374,7 @@ odoo.define(
}
);
- var ProductPickerQuickCreateFormView = QuickCreateFormView.extend({
+ const ProductPickerQuickCreateFormView = QuickCreateFormView.extend({
config: _.extend({}, QuickCreateFormView.prototype.config, {
Renderer: ProductPickerQuickCreateFormRenderer,
Controller: ProductPickerQuickCreateFormController,
diff --git a/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_modif_price_form.js b/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_modif_price_form.js
index 4520bd5f0..653e83a8a 100644
--- a/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_modif_price_form.js
+++ b/web_widget_one2many_product_picker/static/src/js/views/One2ManyProductPicker/quick_modif_price_form.js
@@ -5,21 +5,25 @@ odoo.define(
function(require) {
"use strict";
- var core = require("web.core");
- var Widget = require("web.Widget");
- var ProductPickerQuickModifPriceFormView = require("web_widget_one2many_product_picker.ProductPickerQuickModifPriceFormView")
+ const core = require("web.core");
+ const Widget = require("web.Widget");
+ const ProductPickerQuickModifPriceFormView = require("web_widget_one2many_product_picker.ProductPickerQuickModifPriceFormView")
.ProductPickerQuickModifPriceFormView;
- var qweb = core.qweb;
+ const qweb = core.qweb;
/**
* This widget render a Form. Used by FieldOne2ManyProductPicker
*/
- var ProductPickerQuickModifPriceForm = Widget.extend({
+ const ProductPickerQuickModifPriceForm = Widget.extend({
className: "oe_one2many_product_picker_quick_modif_price",
xmlDependencies: [
"/web_widget_one2many_product_picker/static/src/xml/one2many_product_picker_quick_modif_price.xml",
],
+ events: {
+ "click .oe_record_change": "_onClickChange",
+ "click .oe_record_discard": "_onClickDiscard",
+ },
/**
* @override
@@ -47,9 +51,8 @@ odoo.define(
* @override
*/
start: function() {
- var self = this;
- var def1 = this._super.apply(this, arguments);
- var fieldsView = {
+ const def1 = this._super.apply(this, arguments);
+ const fieldsView = {
arch: this._generateFormArch(),
fields: this.fields,
viewFields: this.fields,
@@ -78,19 +81,21 @@ odoo.define(
if (this.id) {
this.basicFieldParams.model.save(this.id, {savePoint: true});
}
- var def2 = this.formView.getController(this).then(function(controller) {
- self.controller = controller;
- self.$el.empty();
- self.controller.appendTo(self.$el);
+ const def2 = this.formView.getController(this).then(controller => {
+ this.controller = controller;
+ this.$(".modal-body").empty();
+ this.controller.appendTo(this.$(".modal-body"));
+ this.$el.on("hidden.bs.modal", this._onModalHidden.bind(this));
});
- return $.when(def1, def2);
+ return Promise.all([def1, def2]);
},
/**
* @override
*/
destroy: function() {
+ this.$el.off("hidden.bs.modal");
this._super.apply(this, arguments);
},
@@ -103,31 +108,33 @@ odoo.define(
* @returns {String}
*/
_generateFormArch: function() {
- var wanted_field_states = this._getWantedFieldState();
- var template =
+ const wanted_field_states = this._getWantedFieldState();
+ let template =
"";
template += this.basicFieldParams.field.views.form.arch;
template += "";
qweb.add_template(template);
- var $arch = $(
+ const $arch = $(
qweb.render("One2ManyProductPicker.QuickModifPrice.Form", {
field_map: this.fieldMap,
record_search: this.searchRecord,
})
);
- var field_names = Object.keys(wanted_field_states);
- var gen_arch = "