diff --git a/addons/product/__openerp__.py b/addons/product/__openerp__.py index da17f7d8f6a..bc08311fb80 100644 --- a/addons/product/__openerp__.py +++ b/addons/product/__openerp__.py @@ -62,6 +62,7 @@ Print product labels with barcode. 'product_pricelist_demo.yml', 'test/product_uom.yml', 'test/product_pricelist.yml', + 'test/compute_price_margin.yml', ], 'installable': True, 'auto_install': False, diff --git a/addons/product/test/compute_price_margin.yml b/addons/product/test/compute_price_margin.yml new file mode 100644 index 00000000000..aa511845683 --- /dev/null +++ b/addons/product/test/compute_price_margin.yml @@ -0,0 +1,25 @@ +- + I create a Product Template. +- + !record {model: product.template, id: product_template_test1}: + name: Tablate PC + type: service + categ_id: product_category_8 + uom_id: product_uom_unit + uom_po_id: product_uom_unit +- + I create product variant, set price margin and price extra. +- + !record {model: product.product, id: product_product_test1}: + product_tmpl_id: product_template_test1 + standard_price: 10.0 + list_price: 20.0 + variants: 2GB, Wi-Fi , 6in + price_margin: 10.0 + price_extra: 20.0 +- + I check that the sale price of product is equal to (20 + ((20 * 10) / 100)) + 20. +- + !python {model: product.product}: | + product = self.browse(cr, uid, ref("product_product_test1")) + assert product.lst_price == (20 + ((20 * 10) / 100)) + 20, "Sell price is not correspond."