From 74a862db72c51a53c6a3b1d7a91e57309ac18cc1 Mon Sep 17 00:00:00 2001 From: Virginia Bonservizi Date: Thu, 10 Aug 2023 11:35:22 -0300 Subject: [PATCH] [FIX] stock_request_purchase: test fixs --- stock_request_purchase/README.rst | 2 +- .../tests/test_stock_request_purchase.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stock_request_purchase/README.rst b/stock_request_purchase/README.rst index ba174bb0..5696b0ee 100644 --- a/stock_request_purchase/README.rst +++ b/stock_request_purchase/README.rst @@ -23,7 +23,7 @@ Stock Request Purchase :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/stock-logistics-request&target_branch=16.0 :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module allows for users to be able to display purchase orders that have been created as a consequence of Stock Requests. diff --git a/stock_request_purchase/tests/test_stock_request_purchase.py b/stock_request_purchase/tests/test_stock_request_purchase.py index 5b2b01a4..e46acb5d 100644 --- a/stock_request_purchase/tests/test_stock_request_purchase.py +++ b/stock_request_purchase/tests/test_stock_request_purchase.py @@ -78,7 +78,7 @@ def _create_product(self, default_code, name, company_id): "company_id": company_id, "type": "product", "route_ids": [(6, 0, self.route_buy.ids)], - "seller_ids": [(0, 0, {"name": self.supplier.id, "delay": 5})], + "seller_ids": [(0, 0, {"partner_id": self.supplier.id, "delay": 5})], } ) @@ -117,7 +117,7 @@ def test_create_request_01(self): self.assertEqual(order.state, "open") self.assertEqual(order.stock_request_ids.state, "open") - order.refresh() + order.invalidate_recordset() self.assertEqual(len(order.sudo().purchase_ids), 1) self.assertEqual(len(order.picking_ids), 0) self.assertEqual(len(order.move_ids), 0) @@ -176,8 +176,8 @@ def test_create_request_02(self): sum(stock_request_2.sudo().purchase_line_ids.mapped("product_qty")), 10 ) - stock_request_1.refresh() - stock_request_2.refresh() + stock_request_1.invalidate_recordset() + stock_request_2.invalidate_recordset() self.assertEqual(len(stock_request_1.sudo().purchase_ids), 1) self.assertEqual(len(stock_request_2.sudo().purchase_ids), 1)