-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9611c92
commit 51e38e1
Showing
18 changed files
with
184 additions
and
40 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
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
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
41 changes: 41 additions & 0 deletions
41
joint_buying_base/tests/test_joint_buying_transport_request.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,41 @@ | ||
# Copyright (C) 2021 - Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from datetime import datetime | ||
|
||
from odoo.tests import tagged | ||
|
||
from .test_abstract import TestAbstract | ||
|
||
|
||
@tagged("post_install", "-at_install") | ||
class TestJointBuyingTransportRequest(TestAbstract): | ||
def setUp(self): | ||
super().setUp() | ||
self.TransportRequest = self.env["joint.buying.transport.request"] | ||
|
||
def test_create_transport_request_manual(self): | ||
request = self.TransportRequest.create( | ||
{ | ||
"manual_origin_partner_id": self.company_CDA.joint_buying_partner_id.id, | ||
"manual_destination_partner_id": self.company_CHE.joint_buying_partner_id.id, | ||
"manual_description": "manual_description", | ||
"manual_start_date": datetime.today(), | ||
"manual_amount_untaxed": 999, | ||
"manual_total_weight": 111, | ||
} | ||
) | ||
|
||
# Check can change values | ||
self.assertTrue(request.can_change_date) | ||
self.assertTrue(request.can_change_extra_data) | ||
self.assertTrue(request.can_change_partners) | ||
|
||
# Check computation | ||
request.manual_description = "bob" | ||
self.assertEqual(request.description, "<p>bob</p>") | ||
request.manual_amount_untaxed = 888 | ||
self.assertEqual(request.amount_untaxed, 888) | ||
request.manual_total_weight = 222 | ||
self.assertEqual(request.total_weight, 222) |
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
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
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
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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2023 - Today: GRAP (http://www.grap.coop) | ||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
--> | ||
<odoo> | ||
|
||
<record id="request_lse_cda_week_0" model="joint.buying.transport.request"> | ||
<field name="manual_origin_partner_id" model="res.partner" eval="obj().env.ref('joint_buying_base.company_LSE').joint_buying_partner_id.id"/> | ||
<field name="manual_destination_partner_id" model="res.partner" eval="obj().env.ref('joint_buying_base.company_CDA').joint_buying_partner_id.id"/> | ||
<field name="manual_start_date" eval="(DateTime.today() + timedelta(days=-15)).strftime('%Y-%m-%d 07:00')"/> | ||
<field name="sale_order_id" ref="sale_order_1" /> | ||
</record> | ||
|
||
</odoo> |
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
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
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