[FIX] sale_margin:-to calculate the Cost Price it now takes the pricelist from Sales Order

lp bug: https://launchpad.net/bugs/800721 fixed

bzr revid: mtr@mtr-20110701085324-2t30i3x1d0yoh6vi
This commit is contained in:
mtr 2011-07-01 14:23:24 +05:30
parent eedefe1ebc
commit baafca3403
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ class sale_order_line(osv.osv):
uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id,
lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag)
frm_cur = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id
to_cur = self.pool.get('res.partner').browse(cr, uid, partner_id).property_product_pricelist.currency_id.id
to_cur = self.pool.get('product.pricelist').browse(cr, uid, [pricelist])[0].currency_id.id
if product:
purchase_price = self.pool.get('product.product').browse(cr, uid, product).standard_price
price = self.pool.get('res.currency').compute(cr, uid, frm_cur, to_cur, purchase_price, round=False)