From 7c8a2ab859ee107a2ce6cf98cd4f5e1fe9e1c940 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 8 Nov 2019 16:03:57 +0100 Subject: [PATCH] [FIX] pos_stock_picking_invoice_link: ensure test correctness When the currency of test environment is different from the one of de demo data, the test will fail. We must ensure that we create a pricelist with the current company defaults. --- .../tests/test_point_of_sale_stock_invoice_link.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pos_stock_picking_invoice_link/tests/test_point_of_sale_stock_invoice_link.py b/pos_stock_picking_invoice_link/tests/test_point_of_sale_stock_invoice_link.py index 0c42ac41..0d6e3499 100644 --- a/pos_stock_picking_invoice_link/tests/test_point_of_sale_stock_invoice_link.py +++ b/pos_stock_picking_invoice_link/tests/test_point_of_sale_stock_invoice_link.py @@ -22,8 +22,20 @@ class TestPointOfSaleStockPickingInvoiceLink(common.HttpCase): 'standard_price': 1.0, 'type': 'product', }) + self.pricelist = self.env['product.pricelist'].create({ + 'name': 'Test pricelist', + 'item_ids': [(0, 0, { + 'applied_on': '3_global', + 'compute_price': 'formula', + 'base': 'list_price', + })] + }) self.PosOrder = self.env['pos.order'] self.pos_config = self.env.ref('point_of_sale.pos_config_main') + self.pos_config.write({ + 'available_pricelist_ids': [(6, 0, self.pricelist.ids)], + 'pricelist_id': self.pricelist.id, + }) def test_stock_picking_invoice_link(self): """The picking is created and the lines are related to their moves"""