Skip to content

Commit 8f48b8a

Browse files
committed
[MIG] delivery_multi_destination: Migration to 16.0
1 parent 606a670 commit 8f48b8a

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

delivery_multi_destination/README.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ Multiple destinations for the same delivery method
1414
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1515
:alt: License: AGPL-3
1616
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github
17-
:target: https://github.com/OCA/delivery-carrier/tree/15.0/delivery_multi_destination
17+
:target: https://github.com/OCA/delivery-carrier/tree/16.0/delivery_multi_destination
1818
:alt: OCA/delivery-carrier
1919
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
2020
:target: https://translation.odoo-community.org/projects/delivery-carrier-15-0/delivery-carrier-15-0-delivery_multi_destination
2121
:alt: Translate me on Weblate
2222
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/99/15.0
23+
:target: https://runbot.odoo-community.org/runbot/99/16.0
2424
:alt: Try me on Runbot
2525

26-
|badge1| |badge2| |badge3| |badge4| |badge5|
26+
|badge1| |badge2| |badge3| |badge4| |badge5|
2727

2828
This module allows to set different price rules depending on the destination.
2929

@@ -67,7 +67,7 @@ Bug Tracker
6767
Bugs are tracked on `GitHub Issues <https://github.com/OCA/delivery-carrier/issues>`_.
6868
In case of trouble, please check there if your issue has already been reported.
6969
If you spotted it first, help us smashing it by providing a detailed and welcomed
70-
`feedback <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20delivery_multi_destination%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
70+
`feedback <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20delivery_multi_destination%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
7171

7272
Do not contact contributors directly about support or help with technical issues.
7373

@@ -105,6 +105,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
105105
mission is to support the collaborative development of Odoo features and
106106
promote its widespread use.
107107

108-
This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/15.0/delivery_multi_destination>`_ project on GitHub.
108+
This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/16.0/delivery_multi_destination>`_ project on GitHub.
109109

110110
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

delivery_multi_destination/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
{
77
"name": "Multiple destinations for the same delivery method",
8-
"version": "15.0.1.0.0",
8+
"version": "16.0.1.0.0",
99
"category": "Delivery",
1010
"website": "https://github.com/OCA/delivery-carrier",
1111
"author": "Tecnativa, Odoo Community Association (OCA)",

delivery_multi_destination/i18n/delivery_multi_destination.pot

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
msgid ""
66
msgstr ""
7-
"Project-Id-Version: Odoo Server 15.0\n"
7+
"Project-Id-Version: Odoo Server 16.0\n"
88
"Report-Msgid-Bugs-To: \n"
99
"Last-Translator: \n"
1010
"Language-Team: \n"

delivery_multi_destination/static/description/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ <h1 class="title">Multiple destinations for the same delivery method</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
370-
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/delivery-carrier/tree/15.0/delivery_multi_destination"><img alt="OCA/delivery-carrier" src="https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/delivery-carrier-15-0/delivery-carrier-15-0-delivery_multi_destination"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/99/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
370+
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/delivery-carrier/tree/16.0/delivery_multi_destination"><img alt="OCA/delivery-carrier" src="https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/delivery-carrier-15-0/delivery-carrier-15-0-delivery_multi_destination"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/99/16.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
371371
<p>This module allows to set different price rules depending on the destination.</p>
372372
<p>This module restores the concept of delivery grid, reusing the same model for
373373
nesting several “children” delivery methods, one per possible destination.
@@ -419,7 +419,7 @@ <h1><a class="toc-backref" href="#id4">Bug Tracker</a></h1>
419419
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/delivery-carrier/issues">GitHub Issues</a>.
420420
In case of trouble, please check there if your issue has already been reported.
421421
If you spotted it first, help us smashing it by providing a detailed and welcomed
422-
<a class="reference external" href="https://github.com/OCA/delivery-carrier/issues/new?body=module:%20delivery_multi_destination%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
422+
<a class="reference external" href="https://github.com/OCA/delivery-carrier/issues/new?body=module:%20delivery_multi_destination%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
423423
<p>Do not contact contributors directly about support or help with technical issues.</p>
424424
</div>
425425
<div class="section" id="credits">
@@ -452,7 +452,7 @@ <h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
452452
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
453453
mission is to support the collaborative development of Odoo features and
454454
promote its widespread use.</p>
455-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/delivery-carrier/tree/15.0/delivery_multi_destination">OCA/delivery-carrier</a> project on GitHub.</p>
455+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/delivery-carrier/tree/16.0/delivery_multi_destination">OCA/delivery-carrier</a> project on GitHub.</p>
456456
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
457457
</div>
458458
</div>

delivery_multi_destination/tests/test_delivery_multi_destination.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,25 @@ def setUpClass(cls):
4949
cls.product_child_2 = cls.env["product.product"].create(
5050
{"name": "Test child 2", "detailed_type": "service"}
5151
)
52+
zip_prefix_child1 = cls.env["delivery.zip.prefix"].create(
53+
{"name": "22222"}
54+
)
55+
zip_prefix_child2 = cls.env["delivery.zip.prefix"].create(
56+
{"name": "33333"}
57+
)
5258
cls.carrier_multi = cls._create_carrier(
5359
cls,
5460
(
5561
{
5662
"name": "Test child 1",
5763
"product_id": cls.product_child_1,
58-
"zip_from": 20000,
59-
"zip_to": 29999,
64+
"zip_prefix_ids": zip_prefix_child1,
6065
"fixed_price": 50,
6166
},
6267
{
6368
"name": "Test child 2",
6469
"product_id": cls.product_child_2,
65-
"zip_from": 30000,
66-
"zip_to": 39999,
70+
"zip_prefix_ids": zip_prefix_child2,
6771
"fixed_price": 150,
6872
},
6973
),
@@ -84,17 +88,16 @@ def _create_carrier(self, childs):
8488
carrier_form = Form(self.env["delivery.carrier"])
8589
carrier_form.name = "Test carrier multi"
8690
carrier_form.product_id = self.product
87-
carrier_form.destination_type = "multi"
8891
carrier_form.delivery_type = "fixed"
8992
carrier_form.fixed_price = 100
93+
carrier_form.destination_type = "multi"
9094
for child_item in childs:
9195
with carrier_form.child_ids.new() as child_form:
9296
child_form.name = child_item["name"]
9397
child_form.product_id = child_item["product_id"]
9498
child_form.country_ids.add(self.country_2)
9599
child_form.state_ids.add(self.state)
96-
child_form.zip_from = child_item["zip_from"]
97-
child_form.zip_to = child_item["zip_to"]
100+
child_form.zip_prefix_ids.add(child_item["zip_prefix_ids"])
98101
child_form.delivery_type = "fixed"
99102
child_form.fixed_price = child_item["fixed_price"]
100103
return carrier_form.save()
@@ -163,6 +166,6 @@ def test_picking_validation(self):
163166
self.sale_order.action_confirm()
164167
picking = self.sale_order.picking_ids
165168
self.assertEqual(picking.carrier_id, self.carrier_multi)
166-
picking.move_lines.quantity_done = 1
169+
picking.move_ids.quantity_done = 1
167170
picking._action_done()
168171
self.assertAlmostEqual(picking.carrier_price, 50)

delivery_multi_destination/views/delivery_carrier_view.xml

+2-5
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,8 @@
8181
invisible="not context.get('show_children_fields', False)"
8282
/>
8383
<field
84-
name="zip_from"
85-
invisible="not context.get('show_children_fields', False)"
86-
/>
87-
<field
88-
name="zip_to"
84+
name="zip_prefix_ids"
85+
widget="many2many_tags"
8986
invisible="not context.get('show_children_fields', False)"
9087
/>
9188
</field>

0 commit comments

Comments
 (0)