From 7779f83e4a1b0745e890e4cb0d5861d77f050a55 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Mon, 13 Jun 2011 18:42:02 +0530 Subject: [PATCH] Improving error messages when writing invalid values to reference/selection fields lp bug: https://launchpad.net/bugs/777472 fixed bzr revid: nco@tinyerp.com-20110613131202-30bic6891ezlnq2e --- openerp/osv/orm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 52b1dbbd017..6dd01ecbc4f 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -2511,7 +2511,7 @@ class orm(orm_template): pass if not val_id: raise except_orm(_('ValidateError'), - _('Invalid value for reference field "%s" (last part must be a non-zero integer): "%s"') % (field, value)) + _('Invalid value for reference field "%s" of table "%s" (last part must be a non-zero integer): "%s"') % (field, self._table, value)) val = val_model else: val = value @@ -2521,7 +2521,7 @@ class orm(orm_template): elif val in dict(self._columns[field].selection(self, cr, uid, context=context)): return raise except_orm(_('ValidateError'), - _('The value "%s" for the field "%s" is not in the selection') % (value, field)) + _('The value "%s" for the field "%s" of table "%s" is not in the selection') % (value, field, self._table)) def _check_removed_columns(self, cr, log=False): # iterate on the database columns to drop the NOT NULL constraints