[FIX] web: avoid trying to access to deleted record message when change password

The onchange call can be made with empty ids list (which would fail). opw 610810
This commit is contained in:
Martin Trigaux 2014-07-24 12:12:33 +02:00
parent d0f259ee02
commit 8b41906bf8
1 changed files with 4 additions and 2 deletions

View File

@ -504,8 +504,10 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
// In case of a o2m virtual id, we should pass an empty ids list
ids.push(self.datarecord.id);
}
def = self.alive(new instance.web.Model(self.dataset.model).call(
"onchange", [ids, values, trigger_field_name, onchange_specs, context]));
if (ids.length) {
def = self.alive(new instance.web.Model(self.dataset.model).call(
"onchange", [ids, values, trigger_field_name, onchange_specs, context]));
}
}
return def.then(function(response) {
if (widget && widget.field['change_default']) {