From 13063dd1773b728262f7fecaef90149a079ae4b8 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 15 Dec 2016 15:36:02 +0100 Subject: [PATCH] [IMP] purchase: some l10n taxes could break test For example l10n_ch has default included purchase tax on products. This would impact the valuation of the product and fail the tests. This commit removes these taxes in the purchase test (they are tested elsewhere anyway) and also use python to change the company currency (since the current way didn't seem to work). opw-691996 --- addons/purchase/test/average_price.yml | 1 + addons/purchase/test/fifo_price.yml | 8 +++++--- addons/purchase/test/fifo_returns.yml | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/purchase/test/average_price.yml b/addons/purchase/test/average_price.yml index 32e2cb9760b..b26bfa3814f 100644 --- a/addons/purchase/test/average_price.yml +++ b/addons/purchase/test/average_price.yml @@ -12,6 +12,7 @@ cost_method: average property_stock_account_input: o_expense property_stock_account_output: o_income + supplier_taxes_id: [] description: Average Ice Cream can be mass-produced and thus is widely available in developed parts of the world. Ice cream can be purchased in large cartons (vats and squrounds) from supermarkets and grocery stores, in smaller quantities from ice cream shops, convenience stores, and milk bars, and in individual servings from small carts or vans at public events. - I create a draft Purchase Order for first incoming shipment for 10 pieces at 60€ diff --git a/addons/purchase/test/fifo_price.yml b/addons/purchase/test/fifo_price.yml index a435ac65ab0..fd15b39a879 100644 --- a/addons/purchase/test/fifo_price.yml +++ b/addons/purchase/test/fifo_price.yml @@ -1,8 +1,9 @@ - Set the company currency as EURO for the sake of repeatibility - - !record {model: res.company, id: base.main_company}: - currency_id: base.EUR + !python {model: res.company}: | + company = self.browse(cr, uid, ref('base.main_company')) + company.currency_id = company.env['res.currency'].browse(ref('base.EUR')) - Set a product as using fifo price - @@ -19,13 +20,13 @@ valuation: real_time property_stock_account_input: o_expense property_stock_account_output: o_income + supplier_taxes_id: [] description: FIFO Ice Cream can be mass-produced and thus is widely available in developed parts of the world. Ice cream can be purchased in large cartons (vats and squrounds) from supermarkets and grocery stores, in smaller quantities from ice cream shops, convenience stores, and milk bars, and in individual servings from small carts or vans at public events. - I create a draft Purchase Order for first in move for 10 kg at 50 euro - !record {model: purchase.order, id: purchase_order_fifo1}: partner_id: base.res_partner_3 - currency_id: base.EUR order_line: - product_id: product_fifo_icecream product_qty: 10.0 @@ -268,6 +269,7 @@ valuation: real_time property_stock_account_input: o_expense property_stock_account_output: o_income + supplier_taxes_id: [] description: - Create outpicking. We create delivery order of 100 kg. diff --git a/addons/purchase/test/fifo_returns.yml b/addons/purchase/test/fifo_returns.yml index e5fa0ce9de2..33bbf1afa4b 100644 --- a/addons/purchase/test/fifo_returns.yml +++ b/addons/purchase/test/fifo_returns.yml @@ -13,6 +13,7 @@ valuation: real_time property_stock_account_input: o_expense property_stock_account_output: o_income + supplier_taxes_id: [] description: FIFO Ice Cream can be mass-produced and thus is widely available in developed parts of the world. Ice cream can be purchased in large cartons (vats and squrounds) from supermarkets and grocery stores, in smaller quantities from ice cream shops, convenience stores, and milk bars, and in individual servings from small carts or vans at public events. - I create a draft Purchase Order for first in move for 10 kg at 50 euro