[imp] set currency id
authorHardik Ansodariy (OpenERP) <han@tinyerp.com>
Tue, 20 Sep 2011 08:58:46 +0000 (14:28 +0530)
committerHardik Ansodariy (OpenERP) <han@tinyerp.com>
Tue, 20 Sep 2011 08:58:46 +0000 (14:28 +0530)
bzr revid: han@tinyerp.com-20110920085846-dxdr6fbjtw7ltedy

addons/purchase/edi_purchase_order.py
addons/sale/edi_sale_order.py

index 31017da..9119485 100644 (file)
@@ -73,12 +73,13 @@ class purchase_order(osv.osv, ir_edi.edi):
             if not edi_doc:
                 continue
             edi_doc = edi_doc[0]
+            currency = order.company_id.currency_id
 
             # Add company info and address
             edi_company_document = company_pool.edi_export_address(cr, uid, [order.company_id], context=context)[order.company_id.id]
             edi_doc.update({
                     'company_address': edi_company_document['company_address'],
-                    'currency_id': edi_company_document['currency_id'],
+                    'currency_id': currency and self.edi_m2o(cr, uid, currency, context=context) or False,
                     #'company_logo': edi_company_document['company_logo'],#TODO
             })
             edi_doc_list.append(edi_doc)
index eddeb61..69165de 100644 (file)
@@ -77,12 +77,12 @@ class sale_order(osv.osv, ir_edi.edi):
             if not edi_doc:
                 continue
             edi_doc = edi_doc[0]
-
+            currency = order.company_id.currency_id
             # Add company info and address
             edi_company_document = company_pool.edi_export_address(cr, uid, [order.company_id], context=context)[order.company_id.id]
             edi_doc.update({
                     'company_address': edi_company_document['company_address'],
-                    'currency_id': edi_company_document['currency_id'],
+                    'currency_id': currency and self.edi_m2o(cr, uid, currency, context=context) or False,
                     #'company_logo': edi_company_document['company_logo'],#TODO
             })
             edi_doc_list.append(edi_doc)