[IMP+FIX] edi_service: fixed wrong method call to get_db into import_edi_url service and return list of tuple (mobel,record_id) from load_edi function. it will be useful to redirect document after import successful

bzr revid: hmo@tinyerp.com-20110711080017-chgth42d2409o81m
This commit is contained in:
Harry (OpenERP)
2011-07-11 13:30:17 +05:30
parent 583d4cfb23
commit 70b65e0922
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -122,13 +122,14 @@ class ir_edi_document(osv.osv):
:param edi_dicts: list of edi_dict
"""
res = []
for edi_document in edi_documents:
model = edi_document.get('__model')
assert model, _('model should be provided in EDI Dict')
model_obj = self.pool.get(model)
model_obj.edi_import(cr, uid, edi_document, context=context)
return True
record_id = model_obj.edi_import(cr, uid, edi_document, context=context)
res.append((model,record_id))
return res
def deserialize(self, edi_document_string):
""" Deserialized the edi document string
@@ -175,7 +176,6 @@ class ir_edi_document(osv.osv):
if edi_url and not edi_document:
edi_document = urllib2.urlopen(edi_url).read()
assert edi_document, _('EDI Document should be provided')
edi_documents = self.deserialize(edi_document)
return self.load_edi(cr, uid, edi_documents, context=context)
+1 -1
View File
@@ -69,7 +69,7 @@ class edi(netsvc.ExportService):
def exp_import_edi_url(self, db, uid, passwd, edi_url, context=None):
res = None
cr = pooler.get_db_only(db).cursor()
cr = pooler.get_db(db).cursor()
pool = pooler.get_pool(db)
edi_pool = pool.get('ir.edi.document')
try: