diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 77b75ede513..374a48eace4 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/document/document.py b/addons/document/document.py index 35261b798fe..238e4562349 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -103,10 +103,13 @@ class document_file(osv.osv): visible_parent_ids = self.pool.get('document.directory').search(cr, uid, [('id', 'in', list(parent_ids))]) # null parents means allowed + orig_ids = ids # save the ids, to keep order ids = parents.get(None,[]) for parent_id in visible_parent_ids: ids.extend(parents[parent_id]) + # sort result according to the original sort ordering + ids = [id for id in orig_ids if id in ids] return len(ids) if count else ids def copy(self, cr, uid, id, default=None, context=None): diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 199f8c5998d..7186d9bf1db 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -433,7 +433,8 @@ 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( diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 0e8d3ed273b..396b1f05f7b 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -726,12 +726,12 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({ }, do_show_more: function(evt) { var self = this; - var ids = self.view.dataset.ids.splice(0); + var ids = self.view.dataset.ids.slice(0); return this.dataset.read_slice(this.view.fields_keys.concat(['__last_update']), { 'limit': self.view.limit, 'offset': self.dataset_offset += self.view.limit }).then(function(records) { - self.view.dataset.ids = ids.concat(self.dataset.ids); + self.view.dataset.ids = ids.concat(_.difference(self.dataset.ids, ids)); self.do_add_records(records); self.compute_cards_auto_height(); self.view.postprocess_m2m_tags(); diff --git a/openerp/addons/base/ir/ir_filters.py b/openerp/addons/base/ir/ir_filters.py index dacacfd3d16..261403b7820 100644 --- a/openerp/addons/base/ir/ir_filters.py +++ b/openerp/addons/base/ir/ir_filters.py @@ -44,10 +44,11 @@ class ir_filters(osv.osv): ``context`` of the matching ``ir.filters``. """ # available filters: private filters (user_id=uid) and public filters (uid=NULL) + context = self.pool['res.users'].context_get(cr, uid) filter_ids = self.search(cr, uid, [('model_id','=',model),('user_id','in',[uid, False])]) my_filters = self.read(cr, uid, filter_ids, - ['name', 'is_default', 'domain', 'context', 'user_id']) + ['name', 'is_default', 'domain', 'context', 'user_id'], context=context) return my_filters def _check_global_default(self, cr, uid, vals, matching_filters, context=None):