summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2019-08-23 08:40:16 +0000
committerAaron Bohy <aab@odoo.com>2019-08-23 11:08:27 +0000
commit6602e1cf2dccbd0cbdcdf3e5e4547dbc6f0c5b6d (patch)
tree412275b83a7b71d4ba351c92f6b31ebb3f766b07 /addons/web/static/src/js/views
parentedc710f75898bd3a4a795432ce387153f2730894 (diff)
[FIX] web: grouped list with <groupby> node and onchange
Let's assume an editable grouped list view with a <groupby> node containing subfields, and an onchange. Edit a row to trigger the onchange. Before this rev., it crashed because the onchange specs was incorrect: it followed the relation of the many2one and thus included its subfields (whereas it should only follow the relation for x2many fields). For example, go to Accounting > Accounting > Sales and edit the label of a move line. Task 2044187 closes odoo/odoo#36001 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js
index 3bd11a9722a..eca8388aaa4 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -2001,9 +2001,11 @@ var BasicModel = AbstractModel.extend({
if (field.onChange) {
hasOnchange = true;
}
- _.each(fieldInfo.views, function (view) {
- generateSpecs(view.fieldsInfo[view.type], view.fields, key + '.');
- });
+ if (field.type === 'one2many' || field.type === 'many2many') {
+ _.each(fieldInfo.views, function (view) {
+ generateSpecs(view.fieldsInfo[view.type], view.fields, key + '.');
+ });
+ }
});
}
return hasOnchange ? specs : false;