From 7e08bcdf86f32779c8e8381233ec0516e68fe56f Mon Sep 17 00:00:00 2001 From: "ced@b2ck.com" Date: Tue, 25 Dec 2007 15:29:20 +0100 Subject: [PATCH] Better error message for selection check --- trytond/osv/orm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index b0f2344ef8..5f4e926d7c 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -1213,14 +1213,14 @@ class ORM(object): raise ExceptORM('ValidateError', 'The value "%s" for the field "%s" ' \ 'is not in the selection' % \ - (vals[field], field)) + (val, field)) else: if val not in dict(self._columns[field].selection( self, cursor, user, context=context)): raise ExceptORM('ValidateError', 'The value "%s" for the field "%s" ' \ 'is not in the selection' % \ - (vals[field], field)) + (val, field)) if self._log_access: upd0.append('write_uid=%d') @@ -1360,14 +1360,14 @@ class ORM(object): raise ExceptORM('ValidateError', 'The value "%s" for the field "%s" ' \ 'is not in the selection' % \ - (vals[field], field)) + (val, field)) else: if val not in dict(self._columns[field].selection( self, cursor, user, context=context)): raise ExceptORM('ValidateError', 'The value "%s" for the field "%s" ' \ 'is not in the selection' % \ - (vals[field], field)) + (val, field)) if self._log_access: upd0 += ', create_uid, create_date' upd1 += ', %d, now()'