[FIX] web: context/domain in move line tree

DO NOT FORWARD-PORT: the functionality is not used anymore in v9

Commit aaf9badb filters the returned ids by keeping the domain in the
request. However, `this.dataset.domain` might be empty, while
`self.dataset.get_domain()` will retrieve it from the model.

Since `get_domain` is not always defined on the dataset, we keep
`this.dataset.domain` as a fallback. The fix is not great, and a better
solution should be found in master branch when the web refactoring is
done.

opw-666755
This commit is contained in:
Nicolas Martinelli 2016-02-18 14:49:29 +01:00
parent 24158951f3
commit e5f184fe6d
1 changed files with 2 additions and 1 deletions

View File

@ -433,7 +433,8 @@
var self = this;
var on_write_callback = self.fields_view.arch.attrs.on_write;
if (!on_write_callback) { return $.when(); }
var context = new instance.web.CompoundContext(self.dataset.get_context(), {'on_write_domain': self.dataset.domain}).eval();
var on_write_domain = typeof self.dataset.get_domain === "function" && self.dataset.get_domain() || self.dataset.domain;
var context = new instance.web.CompoundContext(self.dataset.get_context(), {'on_write_domain': on_write_domain}).eval();
return this.dataset.call(on_write_callback, [source_record.get('id'), context])
.then(function (ids) {
return $.when.apply(