Revert commit "[FIX] sale_margin: purchase price calculated using the currency of the price type"
Reasons: - the currency conversion is done assuming that the cost price currency is the company currency - we support only one price type per field. Defining several price types on the same field using different price types is not supported.
This commit is contained in:
parent
737728a7a0
commit
d246e36c82
|
@ -37,7 +37,7 @@ class sale_order_line(osv.osv):
|
||||||
to_cur = self.pool.get('product.pricelist').browse(cr, uid, [pricelist])[0].currency_id.id
|
to_cur = self.pool.get('product.pricelist').browse(cr, uid, [pricelist])[0].currency_id.id
|
||||||
if product:
|
if product:
|
||||||
product = self.pool['product.product'].browse(cr, uid, product, context=context)
|
product = self.pool['product.product'].browse(cr, uid, product, context=context)
|
||||||
purchase_price = product.price_get(ptype='standard_price', context=dict(context, currency_id=to_cur))[product.id]
|
purchase_price = product.standard_price
|
||||||
to_uom = res.get('product_uom', uom)
|
to_uom = res.get('product_uom', uom)
|
||||||
if to_uom != product.uom_id.id:
|
if to_uom != product.uom_id.id:
|
||||||
purchase_price = self.pool['product.uom']._compute_price(cr, uid, product.uom_id.id, purchase_price, to_uom)
|
purchase_price = self.pool['product.uom']._compute_price(cr, uid, product.uom_id.id, purchase_price, to_uom)
|
||||||
|
|
Loading…
Reference in New Issue