[IMP] price computation and yml testcase.
bzr revid: amb@tinyerp.com-20140110132921-klxgy71bas9jjef2
This commit is contained in:
@@ -587,6 +587,9 @@ class product_product(osv.osv):
|
||||
if field_value > 0.0:
|
||||
product = self.browse(cr, uid, product_id, context=context)
|
||||
price_extra = (field_value - product.list_price)
|
||||
if product.price_margin:
|
||||
price = (product.list_price + (product.list_price * (product.price_margin / 100)))
|
||||
price_extra = (field_value - price)
|
||||
return self.write(cr, uid, [product_id], {'price_extra': price_extra}, context=context)
|
||||
|
||||
def _get_partner_code_name(self, cr, uid, ids, product, partner_id, context=None):
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
product = self.pool.get('product.product').browse(cr,uid,variant_id.id,context=context)
|
||||
assert product.lst_price == (20 + ((20 * 10) / 100)) + 30, "Sell price is not correspond."
|
||||
-
|
||||
In order to check the Price Extra after setting 'public sale price(lst_price)' of a product.
|
||||
In order to check the Price Extra after setting 'public sale price(lst_price)' of a product. price extra is equal to 32 - (20 + ((20 * 10) / 100)).
|
||||
-
|
||||
!python {model: product.template}: |
|
||||
template = self.browse(cr, uid, ref("product_template_test1"))
|
||||
for variant_id in template.product_variant_ids:
|
||||
self.pool.get('product.product').write(cr,uid,variant_id.id,{'lst_price':30},context=context)
|
||||
self.pool.get('product.product').write(cr,uid,variant_id.id,{'lst_price':32},context=context)
|
||||
product = product = self.pool.get('product.product').browse(cr,uid,variant_id.id,context=context)
|
||||
assert product.price_extra == 10, "Price Extra should be 10."
|
||||
|
||||
Reference in New Issue
Block a user