diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 8f6618d50ae..e79fde1df8f 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -306,7 +306,8 @@ class account_move_line(osv.osv): if not id: return [] ml = self.browse(cr, uid, id, context=context) - return map(lambda x: x.id, ml.move_id.line_id) + domain = (context or {}).get('on_write_domain', []) + return self.pool.get('account.move.line').search(cr, uid, domain + [['id', 'in', [l.id for l in ml.move_id.line_id]]], context=context) def _balance(self, cr, uid, ids, name, arg, context=None): if context is None: diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 98585fd6757..d1d70068964 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -430,7 +430,8 @@ openerp.web.list_editable = function (instance) { var self = this; var on_write_callback = self.fields_view.arch.attrs.on_write; if (!on_write_callback) { return $.when(); } - return this.dataset.call(on_write_callback, [source_record.get('id')]) + var context = new instance.web.CompoundContext(self.dataset.get_context(), {'on_write_domain': self.dataset.domain}).eval(); + return this.dataset.call(on_write_callback, [source_record.get('id'), context]) .then(function (ids) { return $.when.apply( null, _(ids).map(