summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_model.js
diff options
context:
space:
mode:
authorChristopher Ormaza <chris.ormaza@gmail.com>2018-04-15 07:51:36 -0500
committerMartin Geubelle <mge@odoo.com>2018-04-23 17:35:03 +0200
commit30490cae89a3c528c01f470e828f11853df25126 (patch)
tree995d46f3e01607b1e94e3dd3ae07ca90170696be /addons/web/static/src/js/views/basic/basic_model.js
parente94702d8b9041c8cc55d829700d3cd04c4970e2f (diff)
[FIX] web: handle nested x2m default values
The initial rev. odoo/odoo@2d3ecf2 that was supposed to handle this use case was in fact only dealing with one command as default value for nested x2m, not more. The basic model can now handle multiple commands. Closes #24241
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js2
1 files changed, 1 insertions, 1 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 969e81576b1..e311378eee4 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -3636,7 +3636,7 @@ var BasicModel = AbstractModel.extend({
r._changes[fieldName] = rec.id;
many2ones[fieldName] = true;
} else if (_.contains(['one2many', 'many2many'], fieldType)) {
- var x2mCommands = commands[0][2][fieldName];
+ var x2mCommands = value[2][fieldName];
defs.push(self._processX2ManyCommands(r, fieldName, x2mCommands));
} else {
r._changes[fieldName] = self._parseServerValue(field, r._changes[fieldName]);