summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2013-02-18 19:07:32 +0100
committerFabien Meghazi <fme@openerp.com>2013-02-18 19:07:32 +0100
commitb68f13d892b013f8e3e0d17d45406e38eaac63cb (patch)
tree111747684aba28c382d52e6ca0d90d86e4554eff /addons/web/static/src
parent58ca2f6e70fd02bd1370835a46e0ce29bf8f4e2b (diff)
[FIX] BufferedDataset ids should not be passed to on_changes
bzr revid: fme@openerp.com-20130218180732-ivdxvenc2flgl32p
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/view_form.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index b94b976bfff..43699721776 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -509,9 +509,13 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
var on_change = widget.node.attrs.on_change;
if (on_change) {
var change_spec = self.parse_on_change(on_change, widget);
- var id = [self.datarecord.id == null ? [] : [self.datarecord.id]];
+ var ids = [];
+ if (self.datarecord.id && !instance.web.BufferedDataSet.virtual_id_regex.test(self.datarecord.id)) {
+ // In case of a o2m virtual id, we should pass an empty ids list
+ ids.push(self.datarecord.id);
+ }
def = new instance.web.Model(self.dataset.model).call(
- change_spec.method, id.concat(change_spec.args));
+ change_spec.method, [ids].concat(change_spec.args));
} else {
def = $.when({});
}