From fd9e02dddd588b0533bcc57ae30d10fa5aa14ebb Mon Sep 17 00:00:00 2001 From: "Cuong, Nguyen Minh Tran Manh" Date: Tue, 26 Mar 2024 21:03:18 +0700 Subject: [PATCH] [MIG] purchase_sale_inter_company: Migration to 17.0 --- purchase_sale_inter_company/__manifest__.py | 2 +- .../tests/test_inter_company_purchase_sale.py | 8 +-- .../views/res_config_view.xml | 54 ++++++++++--------- 3 files changed, 34 insertions(+), 30 deletions(-) diff --git a/purchase_sale_inter_company/__manifest__.py b/purchase_sale_inter_company/__manifest__.py index 47e9106da3c..7748a37db3a 100644 --- a/purchase_sale_inter_company/__manifest__.py +++ b/purchase_sale_inter_company/__manifest__.py @@ -6,7 +6,7 @@ { "name": "Inter Company Module for Purchase to Sale Order", "summary": "Intercompany PO/SO rules", - "version": "16.0.1.1.1", + "version": "17.0.1.0.0", "category": "Purchase Management", "website": "https://github.com/OCA/multi-company", "author": "Odoo SA, Akretion, Tecnativa, Odoo Community Association (OCA)", diff --git a/purchase_sale_inter_company/tests/test_inter_company_purchase_sale.py b/purchase_sale_inter_company/tests/test_inter_company_purchase_sale.py index 9b0d4cd8a88..3195f711447 100644 --- a/purchase_sale_inter_company/tests/test_inter_company_purchase_sale.py +++ b/purchase_sale_inter_company/tests/test_inter_company_purchase_sale.py @@ -75,9 +75,9 @@ def setUpClass(cls): # Create purchase order cls.purchase_company_a = cls._create_purchase_order(cls.partner_company_b) - # Configure pricelist to USD + # Configure pricelist to EUR cls.env["product.pricelist"].sudo().search([]).write( - {"currency_id": cls.env.ref("base.USD").id} + {"currency_id": cls.env.ref("base.EUR").id} ) def _approve_po(self): @@ -128,7 +128,7 @@ def test_raise_product_access(self): self._approve_po() def test_raise_currency(self): - currency = self.env.ref("base.EUR") + currency = self.env.ref("base.USD") self.purchase_company_a.currency_id = currency with self.assertRaises(UserError): self._approve_po() @@ -162,6 +162,7 @@ def test_cancel_confirmed_po_so(self): self.purchase_company_a.with_user(self.user_company_a).button_cancel() def test_so_change_price(self): + self.company_b.sale_auto_validation = False sale = self._approve_po() sale.order_line.price_unit = 10 sale.action_confirm() @@ -182,6 +183,7 @@ def test_update_open_sale_order(self): When the purchase user request extra product, the sale order gets synched if it's open. """ + self.company_b.sale_auto_validation = False purchase = self.purchase_company_a sale = self._approve_po() sale.action_confirm() diff --git a/purchase_sale_inter_company/views/res_config_view.xml b/purchase_sale_inter_company/views/res_config_view.xml index b77c0c3b750..2a42c9c5c39 100644 --- a/purchase_sale_inter_company/views/res_config_view.xml +++ b/purchase_sale_inter_company/views/res_config_view.xml @@ -7,32 +7,34 @@ ref="account_invoice_inter_company.res_config_settings_view_form" /> - -
Purchase/Sale
-
- -
-
-