From b691c55e119063bbfa80ab76ef40f7167247f6c3 Mon Sep 17 00:00:00 2001 From: Bert Van Groenendael Date: Wed, 20 Nov 2024 09:41:46 +0100 Subject: [PATCH] [18.0][MIG] sale_commercial_partner: Migration to 18.0 --- sale_commercial_partner/README.rst | 4 +++ .../readme/CONTRIBUTORS.md | 2 ++ .../static/description/index.html | 4 +++ sale_commercial_partner/tests/__init__.py | 1 + .../tests/test_sale_commercial_partner.py | 34 +++++++++++++++++++ 5 files changed, 45 insertions(+) create mode 100644 sale_commercial_partner/tests/__init__.py create mode 100644 sale_commercial_partner/tests/test_sale_commercial_partner.py diff --git a/sale_commercial_partner/README.rst b/sale_commercial_partner/README.rst index 74ae53f8f1e5..5647e0a56890 100644 --- a/sale_commercial_partner/README.rst +++ b/sale_commercial_partner/README.rst @@ -78,6 +78,10 @@ Contributors - Antoni Marroig +- `Dynapps `__: + + - Bert Van Groenendael + Maintainers ----------- diff --git a/sale_commercial_partner/readme/CONTRIBUTORS.md b/sale_commercial_partner/readme/CONTRIBUTORS.md index ebe8c668e133..530376c517c9 100644 --- a/sale_commercial_partner/readme/CONTRIBUTORS.md +++ b/sale_commercial_partner/readme/CONTRIBUTORS.md @@ -4,3 +4,5 @@ - Tharathip Chaweewongphan \<\> - [APSL](https://apsl.tech): - Antoni Marroig \<\> +- [Dynapps](https://www.dynapps.eu): + - Bert Van Groenendael \<\> diff --git a/sale_commercial_partner/static/description/index.html b/sale_commercial_partner/static/description/index.html index 98e6f734f8c1..c8c3d66515ba 100644 --- a/sale_commercial_partner/static/description/index.html +++ b/sale_commercial_partner/static/description/index.html @@ -424,6 +424,10 @@

Contributors

  • Antoni Marroig <amarroig@apsl.net>
  • +
  • Dynapps: +
  • diff --git a/sale_commercial_partner/tests/__init__.py b/sale_commercial_partner/tests/__init__.py new file mode 100644 index 000000000000..0a0ac0509008 --- /dev/null +++ b/sale_commercial_partner/tests/__init__.py @@ -0,0 +1 @@ +from . import test_sale_commercial_partner diff --git a/sale_commercial_partner/tests/test_sale_commercial_partner.py b/sale_commercial_partner/tests/test_sale_commercial_partner.py new file mode 100644 index 000000000000..41cad7e81b3f --- /dev/null +++ b/sale_commercial_partner/tests/test_sale_commercial_partner.py @@ -0,0 +1,34 @@ +# Copyright (C) 2018 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests import Form, common + + +class TestSaleCommercialPartner(common.TransactionCase): + def setUp(self): + super().setUp() + self.commercial_partner = self.env["res.partner"].create( + { + "name": "Commercial Partner", + } + ) + + self.partner = self.env["res.partner"].create( + { + "name": "Partner", + "commercial_partner_id": self.commercial_partner.id, + } + ) + + def default_commercial_partner_on_sale_order_01(self): + """ + Test defaulting commercial partner on sale order + :return: + """ + + with Form(self.env["sale.order"]) as order_form: + order_form.partner_id = self.partner + order_01 = order_form.save() + + self.assertEqual(order_01.partner_id, self.partner) + self.assertEqual(order_01.commercial_partner_id, self.commercial_partner)