diff --git a/TODO b/TODO index 9cd51e7cd5..7fadb2d973 100644 --- a/TODO +++ b/TODO @@ -10,4 +10,3 @@ - Change _constraint to pass a BrowseRecordList instead of a list of ids - Change action, menu on res.user into a Many2Many - Add order attribute on page tag -- Allow to pass a context in xxx2xxx operation (it will allow to pass _timestamp) diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index c3f6edf3e1..2bb203d744 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -1492,9 +1492,10 @@ class ORM(object): ' > %s)' args = [] for i in sub_ids: - if context['_timestamp'].get(i): + if context['_timestamp'].get(self._name + ',' + str(i)): args.append(i) - args.append(context['_timestamp'][i]) + args.append(context['_timestamp'][ + self._name + ',' +str(i)]) if args: cursor.execute("SELECT id " \ 'FROM "' + self._table + '" ' \ @@ -1503,7 +1504,9 @@ class ORM(object): if cursor.rowcount: raise Exception('ConcurrencyException', 'Records were modified in the meanwhile') - del context['_timestamp'] + for i in ids: + if context['_timestamp'].get(self._name + ',' + str(i)): + del context['_timestamp'][self._name + ',' +str(i)] self.pool.get('ir.model.access').check(cursor, user, self._name, 'delete', context=context) @@ -1633,9 +1636,10 @@ class ORM(object): ' > %s)' args = [] for i in sub_ids: - if context['_timestamp'].get(i): + if context['_timestamp'].get(self._name + ',' + str(i)): args.append(i) - args.append(context['_timestamp'][i]) + args.append(context['_timestamp'][ + self._name + ',' +str(i)]) if args: cursor.execute("SELECT id " \ 'FROM "' + self._table + '" ' \ @@ -1644,7 +1648,9 @@ class ORM(object): if cursor.rowcount: raise Exception('ConcurrencyException', 'Records were modified in the meanwhile') - del context['_timestamp'] + for i in ids: + if context['_timestamp'].get(self._name + ',' + str(i)): + del context['_timestamp'][self._name + ',' +str(i)] self.pool.get('ir.model.access').check(cursor, user, self._name, 'write', context=context)