diff --git a/bin/osv/orm.py b/bin/osv/orm.py index a639a775b01..e64f59f626b 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -3201,9 +3201,11 @@ class orm(orm_template): ids_to_check.extend([id, update_date]) if not ids_to_check: continue - cr.execute("SELECT 1 FROM %s WHERE %s" % (self._table, " OR ".join([check_clause]*(len(ids_to_check)/2))), tuple(ids_to_check)) - if cr.fetchone(): - raise except_orm('ConcurrencyException', _('Records were modified in the meanwhile')) + cr.execute("SELECT id FROM %s WHERE %s" % (self._table, " OR ".join([check_clause]*(len(ids_to_check)/2))), tuple(ids_to_check)) + res = cr.fetchone() + if res: + # mention the first one only to keep the error message readable + raise except_orm('ConcurrencyException', _('A document was modified since you last viewed it (%s:%d)') % (self._description, res[0])) def check_access_rule(self, cr, uid, ids, operation, context=None): """Verifies that the operation given by ``operation`` is allowed for the user