From 0d8ee78fa57d7087af30ec3b40577552ba901aec Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Fri, 24 Jul 2020 08:21:37 +0000 Subject: [PATCH] [IMP] purchase_stock: Remove test_fifo_returns dependency to AccountTestCommon l10n runbot builds are all failing when running at least one test depending of AccountTestCommon because it: - doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the default company's currency, the exchange rates... - doesn't setup a testing user then all tests are done using the superuser. - doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts have bad types, etc... - is run sometimes at-install. --task: 2301180 --- addons/purchase_stock/tests/test_fifo_returns.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/addons/purchase_stock/tests/test_fifo_returns.py b/addons/purchase_stock/tests/test_fifo_returns.py index 0e6a0d0b932..b53fcf76165 100644 --- a/addons/purchase_stock/tests/test_fifo_returns.py +++ b/addons/purchase_stock/tests/test_fifo_returns.py @@ -2,13 +2,12 @@ import time -from .common import PurchaseTestCommon from odoo.tests import tagged, Form -from odoo.addons.account.tests.common import AccountTestCommon +from odoo.addons.stock_account.tests.test_anglo_saxon_valuation_reconciliation_common import ValuationReconciliationTestCommon @tagged('-at_install', 'post_install') -class TestFifoReturns(PurchaseTestCommon, AccountTestCommon): +class TestFifoReturns(ValuationReconciliationTestCommon): def test_fifo_returns(self): """Test to create product and purchase order to test the FIFO returns of the product""" @@ -21,16 +20,12 @@ class TestFifoReturns(PurchaseTestCommon, AccountTestCommon): 'default_code': 'FIFORET', 'name': 'FIFO Ice Cream', 'type': 'product', - 'categ_id': self.env.ref('product.product_category_1').id, + 'categ_id': self.stock_account_product_categ.id, 'standard_price': 0.0, 'uom_id': self.env.ref('uom.product_uom_kgm').id, 'uom_po_id': self.env.ref('uom.product_uom_kgm').id, 'description': 'FIFO Ice Cream', }) - product_fiforet_icecream.categ_id.property_cost_method = 'fifo' - product_fiforet_icecream.categ_id.property_valuation = 'real_time' - product_fiforet_icecream.categ_id.property_stock_account_input_categ_id = self.o_expense - product_fiforet_icecream.categ_id.property_stock_account_output_categ_id = self.o_income # I create a draft Purchase Order for first in move for 10 kg at 50 euro purchase_order_1 = self.env['purchase.order'].create({