[FIX] Use currency of pricelist when creating PO from procurement
authorJosse Colpaert <jco@odoo.com>
Fri, 10 Oct 2014 16:06:48 +0000 (18:06 +0200)
committerJosse Colpaert <jco@odoo.com>
Mon, 13 Oct 2014 19:33:13 +0000 (21:33 +0200)
addons/purchase/purchase.py

index d3b1e04..9fe0238 100644 (file)
@@ -1353,6 +1353,7 @@ class procurement_order(osv.osv):
                         'location_id': procurement.location_id.id,
                         'picking_type_id': procurement.rule_id.picking_type_id.id,
                         'pricelist_id': partner.property_product_pricelist_purchase.id,
+                        'currency_id': partner.property_product_pricelist_purchase and partner.property_product_pricelist_purchase.currency_id.id or procurement.company_id.currency_id.id,
                         'date_order': purchase_date.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
                         'company_id': procurement.company_id.id,
                         'fiscal_position': partner.property_account_position and partner.property_account_position.id or False,