[IMP]
authorHardik Ansodariy (OpenERP) <han@tinyerp.com>
Tue, 23 Aug 2011 11:36:32 +0000 (17:06 +0530)
committerHardik Ansodariy (OpenERP) <han@tinyerp.com>
Tue, 23 Aug 2011 11:36:32 +0000 (17:06 +0530)
bzr revid: han@tinyerp.com-20110823113632-3k859oxwq5k7kwzw

openerp/addons/base/ir/ir_edi.py

index 44d6d8f..443a1d1 100644 (file)
@@ -129,14 +129,14 @@ class ir_edi_document(osv.osv):
         for edi_document in edi_documents:
             module = edi_document.get('__module')
             module_id = module_obj.search(cr, uid, [('name','=',module),('state','=','installed')])
-            if module_id:
+            if  not module_id:
+                raise Exception("The document you are trying to import requires the OpenERP" +module+ "application")
+            else:
                 model = edi_document.get('__model')
                 assert model, _('model should be provided in EDI Dict')
                 model_obj = self.pool.get(model)
                 record_id = model_obj.edi_import(cr, uid, edi_document, context=context)
                 res.append((model,record_id))
-            else:
-                raise osv.except_osv(_('Invalid action !'), _('Module is not Installed'))
         return res
     
     def deserialize(self, edi_document_string):
@@ -323,7 +323,7 @@ class edi(object):
         dict_list = []
         
         for record in records:
-            dict_list.append(self.edi_o2m(cr, uid, [record], context=None))
+            dict_list.append(self.edi_m2o(cr, uid, [record], context=None))
       
         return dict_list