-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[18.0][MIG] sale_commercial_partner: Migration to 18.0
- Loading branch information
1 parent
98f9a2b
commit b691c55
Showing
5 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,10 @@ Contributors | |
|
||
- Antoni Marroig <[email protected]> | ||
|
||
- `Dynapps <https://www.dynapps.eu>`__: | ||
|
||
- Bert Van Groenendael <[email protected]> | ||
|
||
Maintainers | ||
----------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ | |
- Tharathip Chaweewongphan \<<[email protected]>\> | ||
- [APSL](https://apsl.tech): | ||
- Antoni Marroig \<<[email protected]>\> | ||
- [Dynapps](https://www.dynapps.eu): | ||
- Bert Van Groenendael \<<[email protected]>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_sale_commercial_partner |
34 changes: 34 additions & 0 deletions
34
sale_commercial_partner/tests/test_sale_commercial_partner.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |