From a52d21e1cb081cd0e99607b2486261b6d882faf2 Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Fri, 1 Feb 2013 15:57:50 +0530 Subject: [PATCH 1/2] [IMP]Improved code for the base_import requirde field bzr revid: pan@tinyerp.com-20130201102750-ozxa3xwqa4rsnt60 --- openerp/osv/orm.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 6056e405b78..16f0257fa9c 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -5318,11 +5318,9 @@ def convert_pgerror_23502(model, fields, info, e): field_name = m.group('field') if not m or field_name not in fields: return {'message': unicode(e)} - message = _(u"Missing required value for the field '%s'.") % field_name field = fields.get(field_name) if field: - message = _(u"%s This might be '%s' in the current model, or a field " - u"of the same name in an o2m.") % (message, field['string']) + message = _(u"Missing required value for the field '%s'") % (field['string']) return { 'message': message, 'field': field_name, From 8f91937bab596d27f4f9bc5aa1e714bf9c7903b4 Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Mon, 4 Feb 2013 18:26:42 +0530 Subject: [PATCH 2/2] [IMP]: Improve test case bzr revid: pan@tinyerp.com-20130204125642-fyf2r3uubk16md4t --- openerp/tests/addons/test_impex/tests/test_load.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/openerp/tests/addons/test_impex/tests/test_load.py b/openerp/tests/addons/test_impex/tests/test_load.py index fe01a267d58..067641cea42 100644 --- a/openerp/tests/addons/test_impex/tests/test_load.py +++ b/openerp/tests/addons/test_impex/tests/test_load.py @@ -393,18 +393,14 @@ class test_required_string_field(ImporterCase): def test_empty(self): result = self.import_(['value'], [[]]) self.assertEqual(result['messages'], [message( - u"Missing required value for the field 'value'. This might be " - u"'unknown' in the current model, or a field of the same name in " - u"an o2m.")]) + u"Missing required value for the field 'unknown'")]) self.assertIs(result['ids'], False) @mute_logger('openerp.sql_db', 'openerp.osv.orm') def test_not_provided(self): result = self.import_(['const'], [['12']]) self.assertEqual(result['messages'], [message( - u"Missing required value for the field 'value'. This might be " - u"'unknown' in the current model, or a field of the same name in " - u"an o2m.")]) + u"Missing required value for the field 'unknown'")]) self.assertIs(result['ids'], False) class test_text(ImporterCase):