diff --git a/sale_commercial_partner/README.rst b/sale_commercial_partner/README.rst index 74ae53f8f1e..5647e0a5689 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 ebe8c668e13..530376c517c 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 98e6f734f8c..c8c3d66515b 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 00000000000..0a0ac050900 --- /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 00000000000..41cad7e81b3 --- /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)