diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index 4bf7241b06..472cbc83f1 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -522,6 +522,7 @@ class ORM(object): self._inherit_fields = [] self._order = [('id', 'ASC')] self._error_messages = {} + self._sql_error_messages = {} # reinit the cache on _columns and _defaults self.__columns = None self.__defaults = None diff --git a/trytond/osv/osv.py b/trytond/osv/osv.py index 9934c2c789..efd07060d3 100644 --- a/trytond/osv/osv.py +++ b/trytond/osv/osv.py @@ -136,6 +136,9 @@ class OSVService(Service): res.append(inst) for key, _, msg in inst._sql_constraints: self._sql_errors[inst._table + '_' + key] = msg + for key in inst._sql_error_messages.keys(): + self._sql_errors[inst._table + '_' + key] = \ + inst._sql_error_messages[key] return res osv_pool = OSVService