From 18ba58194a0ae91bb8c49c6744a780aa163005e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alix?= Date: Fri, 20 Sep 2024 15:04:24 +0200 Subject: [PATCH] fixup! account_invoice_section_sale_order: Custom section name --- .../models/account_move.py | 2 - .../models/res_config_settings.py | 1 - .../tests/test_invoice_group_by_sale_order.py | 11 +++-- .../views/res_config_settings.xml | 48 ++++++++----------- 4 files changed, 27 insertions(+), 35 deletions(-) diff --git a/account_invoice_section_sale_order/models/account_move.py b/account_invoice_section_sale_order/models/account_move.py index 80b54fc77c2d..1c2c54ad7128 100644 --- a/account_invoice_section_sale_order/models/account_move.py +++ b/account_invoice_section_sale_order/models/account_move.py @@ -5,7 +5,6 @@ class AccountMove(models.Model): - _inherit = "account.move" def _get_ordered_invoice_lines(self): @@ -16,7 +15,6 @@ def _get_ordered_invoice_lines(self): class AccountMoveLine(models.Model): - _inherit = "account.move.line" def _get_section_group(self): diff --git a/account_invoice_section_sale_order/models/res_config_settings.py b/account_invoice_section_sale_order/models/res_config_settings.py index 7b9c20adc722..6753fbf48a4a 100644 --- a/account_invoice_section_sale_order/models/res_config_settings.py +++ b/account_invoice_section_sale_order/models/res_config_settings.py @@ -4,7 +4,6 @@ class ResConfigSettings(models.TransientModel): - _inherit = "res.config.settings" invoice_section_name_scheme = fields.Char( diff --git a/account_invoice_section_sale_order/tests/test_invoice_group_by_sale_order.py b/account_invoice_section_sale_order/tests/test_invoice_group_by_sale_order.py index 15482e4d782b..872d5a22337f 100644 --- a/account_invoice_section_sale_order/tests/test_invoice_group_by_sale_order.py +++ b/account_invoice_section_sale_order/tests/test_invoice_group_by_sale_order.py @@ -20,11 +20,16 @@ def setUpClass(cls): cls.product_2 = cls.env.ref("product.product_product_2") cls.product_1.invoice_policy = "order" cls.product_2.invoice_policy = "order" + eur = cls.env.ref("base.EUR") + cls.pricelist = cls.env["product.pricelist"].create( + {"name": "Europe pricelist", "currency_id": eur.id} + ) cls.order1_p1 = cls.env["sale.order"].create( { "partner_id": cls.partner_1.id, "partner_shipping_id": cls.partner_1.id, "partner_invoice_id": cls.partner_1.id, + "pricelist_id": cls.pricelist.id, "client_order_ref": "ref123", "order_line": [ ( @@ -58,6 +63,7 @@ def setUpClass(cls): "partner_id": cls.partner_1.id, "partner_shipping_id": cls.partner_1.id, "partner_invoice_id": cls.partner_1.id, + "pricelist_id": cls.pricelist.id, "order_line": [ ( 0, @@ -127,12 +133,7 @@ def test_create_invoice(self): def test_create_invoice_with_currency(self): """Check invoice is generated with a correct total amount""" - eur = self.env.ref("base.EUR") - pricelist = self.env["product.pricelist"].create( - {"name": "Europe pricelist", "currency_id": eur.id} - ) orders = self.order1_p1 | self.order2_p1 - orders.write({"pricelist_id": pricelist.id}) invoices = orders._create_invoices() self.assertEqual(invoices.amount_total, 80) diff --git a/account_invoice_section_sale_order/views/res_config_settings.xml b/account_invoice_section_sale_order/views/res_config_settings.xml index 8c8220e05369..9d8f731cb26b 100644 --- a/account_invoice_section_sale_order/views/res_config_settings.xml +++ b/account_invoice_section_sale_order/views/res_config_settings.xml @@ -5,36 +5,30 @@ res.config.settings - -
+ + -
-
- Section names -
- Customize section names when invoicing from sale orders -
-
-
-
-
+
+
-
+
+
+