From a85790be5c9f30e556c7401802100db1401cfc5e Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Tue, 6 Jun 2017 18:18:57 +0200 Subject: [PATCH] [FIX] stock_landed_cost: disable test with an invalid CoA For now, these tests do not work with another CoA than the generic one. Depending on your testing infrastructure, they may or may not pass. We skip then invalid CoA's and plan to make them work in master. --- .../tests/test_stock_landed_costs_purchase.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/stock_landed_costs/tests/test_stock_landed_costs_purchase.py b/addons/stock_landed_costs/tests/test_stock_landed_costs_purchase.py index f06065512d5..6a54492b320 100644 --- a/addons/stock_landed_costs/tests/test_stock_landed_costs_purchase.py +++ b/addons/stock_landed_costs/tests/test_stock_landed_costs_purchase.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. - +import unittest from odoo.addons.stock_landed_costs.tests.common import TestStockLandedCostsCommon class TestLandedCosts(TestStockLandedCostsCommon): @@ -45,6 +45,10 @@ class TestLandedCosts(TestStockLandedCostsCommon): 'location_dest_id': self.customer_location_id}) def test_00_landed_costs_on_incoming_shipment(self): + chart_of_accounts = self.env.user.company_id.chart_template_id + generic_coa = self.env.ref('l10n_generic_coa.configurable_chart_template') + if chart_of_accounts != generic_coa: + raise unittest.SkipTest('Skip this test as it works only with %s (%s loaded)' % (generic_coa.name, chart_of_accounts.name)) """ Test landed cost on incoming shipment """ # # (A) Purchase product @@ -94,6 +98,11 @@ class TestLandedCosts(TestStockLandedCostsCommon): self.assertEqual(account_entry['debit'], 430.0, 'Wrong Account Entry') def test_01_negative_landed_costs_on_incoming_shipment(self): + chart_of_accounts = self.env.user.company_id.chart_template_id + generic_coa = self.env.ref('l10n_generic_coa.configurable_chart_template') + if chart_of_accounts != generic_coa: + raise unittest.SkipTest('Skip this test as it works only with %s (%s loaded)' % (generic_coa.name, chart_of_accounts.name)) + """ Test negative landed cost on incoming shipment """ # # (A) Purchase Product