diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index ac9e67b7876..2341b92e169 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -4067,9 +4067,13 @@ class BaseModel(object): ir_values_obj.unlink(cr, uid, ir_value_ids, context=context) for order, object, store_ids, fields in result_store: - if object != self._name: + if object == self._name: + effective_store_ids = list(set(store_ids) - set(ids)) + else: + effective_store_ids = store_ids + if effective_store_ids: obj = self.pool.get(object) - cr.execute('select id from '+obj._table+' where id IN %s', (tuple(store_ids),)) + cr.execute('select id from '+obj._table+' where id IN %s', (tuple(effective_store_ids),)) rids = map(lambda x: x[0], cr.fetchall()) if rids: obj._store_set_values(cr, uid, rids, fields, context)