From bc14d3e65958ba93874a3ff8e3bf024203b5e657 Mon Sep 17 00:00:00 2001 From: "Darshan Kalola (OpenERP)" Date: Mon, 28 Oct 2013 11:00:25 +0530 Subject: [PATCH] [ADD]test case for computation of price margin. bzr revid: dka@tinyerp.com-20131028053025-4h9ftnaqtmbzp2yl --- addons/product/__openerp__.py | 1 + addons/product/test/compute_price_margin.yml | 25 ++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 addons/product/test/compute_price_margin.yml 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."