Skip to content

Commit ab04037

Browse files
[MIG] delivery_multi_destination: Migration to 16.0
1 parent b2dcabb commit ab04037

File tree

8 files changed

+57
-49
lines changed

8 files changed

+57
-49
lines changed

delivery_multi_destination/README.rst

+13-10
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
Multiple destinations for the same delivery method
33
==================================================
44

5-
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
67
!! This file is generated by oca-gen-addon-readme !!
78
!! changes will be overwritten. !!
89
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:2bae037f6463833430c93739fa098bd379b7e9307ae8b3a4f8b8e02aeb33e2e4
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
912
1013
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1114
:target: https://odoo-community.org/page/development-status
@@ -14,16 +17,16 @@ Multiple destinations for the same delivery method
1417
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1518
:alt: License: AGPL-3
1619
.. |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
20+
:target: https://github.com/OCA/delivery-carrier/tree/16.0/delivery_multi_destination
1821
:alt: OCA/delivery-carrier
1922
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20-
:target: https://translation.odoo-community.org/projects/delivery-carrier-15-0/delivery-carrier-15-0-delivery_multi_destination
23+
:target: https://translation.odoo-community.org/projects/delivery-carrier-16-0/delivery-carrier-16-0-delivery_multi_destination
2124
:alt: Translate me on Weblate
22-
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/99/15.0
24-
:alt: Try me on Runbot
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/delivery-carrier&target_branch=16.0
27+
:alt: Try me on Runboat
2528

26-
|badge1| |badge2| |badge3| |badge4| |badge5|
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
2730

2831
This module allows to set different price rules depending on the destination.
2932

@@ -66,8 +69,8 @@ Bug Tracker
6669

6770
Bugs are tracked on `GitHub Issues <https://github.com/OCA/delivery-carrier/issues>`_.
6871
In case of trouble, please check there if your issue has already been reported.
69-
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**>`_.
72+
If you spotted it first, help us to smash it by providing a detailed and welcomed
73+
`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**>`_.
7174

7275
Do not contact contributors directly about support or help with technical issues.
7376

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

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.
111+
This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/16.0/delivery_multi_destination>`_ project on GitHub.
109112

110113
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.2",
8+
"version": "16.0.1.0.2",
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

+26-24
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
33
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6-
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
6+
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
77
<title>Multiple destinations for the same delivery method</title>
88
<style type="text/css">
99

1010
/*
1111
:Author: David Goodger (goodger@python.org)
12-
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
12+
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
1313
:Copyright: This stylesheet has been placed in the public domain.
1414
1515
Default cascading style sheet for the HTML output of Docutils.
1616
17-
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
17+
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1818
customize this style sheet.
1919
*/
2020

@@ -366,8 +366,10 @@ <h1 class="title">Multiple destinations for the same delivery method</h1>
366366
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370+
!! source digest: sha256:2bae037f6463833430c93739fa098bd379b7e9307ae8b3a4f8b8e02aeb33e2e4
369371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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>
372+
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" 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 image-reference" href="https://translation.odoo-community.org/projects/delivery-carrier-16-0/delivery-carrier-16-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 image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/delivery-carrier&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
371373
<p>This module allows to set different price rules depending on the destination.</p>
372374
<p>This module restores the concept of delivery grid, reusing the same model for
373375
nesting several “children” delivery methods, one per possible destination.
@@ -376,20 +378,20 @@ <h1 class="title">Multiple destinations for the same delivery method</h1>
376378
<p><strong>Table of contents</strong></p>
377379
<div class="contents local topic" id="contents">
378380
<ul class="simple">
379-
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
380-
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
381-
<li><a class="reference internal" href="#known-issues-roadmap" id="id3">Known issues / Roadmap</a></li>
382-
<li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li>
383-
<li><a class="reference internal" href="#credits" id="id5">Credits</a><ul>
384-
<li><a class="reference internal" href="#authors" id="id6">Authors</a></li>
385-
<li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li>
386-
<li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li>
381+
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
382+
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
383+
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-3">Known issues / Roadmap</a></li>
384+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
385+
<li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
386+
<li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
387+
<li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
388+
<li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li>
387389
</ul>
388390
</li>
389391
</ul>
390392
</div>
391393
<div class="section" id="configuration">
392-
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
394+
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
393395
<p>To configure delivery methods with multiple destinations:</p>
394396
<ol class="arabic simple">
395397
<li>Go to Inventory &gt; Configuration &gt; Delivery &gt; Shipping Methods</li>
@@ -401,37 +403,37 @@ <h1><a class="toc-backref" href="#id1">Configuration</a></h1>
401403
</ol>
402404
</div>
403405
<div class="section" id="usage">
404-
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
406+
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
405407
<ol class="arabic simple">
406408
<li>When using the delivery method in a Sales order, delivery address will be
407409
used for computing the delivery price according introduced destinations.</li>
408410
</ol>
409411
</div>
410412
<div class="section" id="known-issues-roadmap">
411-
<h1><a class="toc-backref" href="#id3">Known issues / Roadmap</a></h1>
413+
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
412414
<ul class="simple">
413415
<li>Delivery prices for e-commerce (<cite>website_sale_delivery</cite> module) might need
414416
an extra module for handling everything properly.</li>
415417
</ul>
416418
</div>
417419
<div class="section" id="bug-tracker">
418-
<h1><a class="toc-backref" href="#id4">Bug Tracker</a></h1>
420+
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
419421
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/delivery-carrier/issues">GitHub Issues</a>.
420422
In case of trouble, please check there if your issue has already been reported.
421-
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>
423+
If you spotted it first, help us to smash it by providing a detailed and welcomed
424+
<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>
423425
<p>Do not contact contributors directly about support or help with technical issues.</p>
424426
</div>
425427
<div class="section" id="credits">
426-
<h1><a class="toc-backref" href="#id5">Credits</a></h1>
428+
<h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
427429
<div class="section" id="authors">
428-
<h2><a class="toc-backref" href="#id6">Authors</a></h2>
430+
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
429431
<ul class="simple">
430432
<li>Tecnativa</li>
431433
</ul>
432434
</div>
433435
<div class="section" id="contributors">
434-
<h2><a class="toc-backref" href="#id7">Contributors</a></h2>
436+
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
435437
<ul class="simple">
436438
<li><cite>Tecnativa &lt;https://www.tecnativa.com&gt;__</cite>:<ul>
437439
<li>Pedro M. Baeza</li>
@@ -446,13 +448,13 @@ <h2><a class="toc-backref" href="#id7">Contributors</a></h2>
446448
</ul>
447449
</div>
448450
<div class="section" id="maintainers">
449-
<h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
451+
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
450452
<p>This module is maintained by the OCA.</p>
451453
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
452454
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
453455
mission is to support the collaborative development of Odoo features and
454456
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>
457+
<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>
456458
<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>
457459
</div>
458460
</div>

delivery_multi_destination/tests/test_delivery_multi_destination.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ 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({"name": "22222"})
53+
zip_prefix_child2 = cls.env["delivery.zip.prefix"].create({"name": "33333"})
5254
cls.carrier_multi = cls._create_carrier(
5355
cls,
5456
(
5557
{
5658
"name": "Test child 1",
5759
"product_id": cls.product_child_1,
58-
"zip_from": 20000,
59-
"zip_to": 29999,
60+
"zip_prefix_ids": zip_prefix_child1,
6061
"fixed_price": 50,
6162
},
6263
{
6364
"name": "Test child 2",
6465
"product_id": cls.product_child_2,
65-
"zip_from": 30000,
66-
"zip_to": 39999,
66+
"zip_prefix_ids": zip_prefix_child2,
6767
"fixed_price": 150,
6868
},
6969
),
@@ -84,17 +84,16 @@ def _create_carrier(self, childs):
8484
carrier_form = Form(self.env["delivery.carrier"])
8585
carrier_form.name = "Test carrier multi"
8686
carrier_form.product_id = self.product
87-
carrier_form.destination_type = "multi"
8887
carrier_form.delivery_type = "fixed"
8988
carrier_form.fixed_price = 100
89+
carrier_form.destination_type = "multi"
9090
for child_item in childs:
9191
with carrier_form.child_ids.new() as child_form:
9292
child_form.name = child_item["name"]
9393
child_form.product_id = child_item["product_id"]
9494
child_form.country_ids.add(self.country_2)
9595
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"]
96+
child_form.zip_prefix_ids.add(child_item["zip_prefix_ids"])
9897
child_form.delivery_type = "fixed"
9998
child_form.fixed_price = child_item["fixed_price"]
10099
return carrier_form.save()
@@ -163,7 +162,7 @@ def test_picking_validation(self):
163162
self.sale_order.action_confirm()
164163
picking = self.sale_order.picking_ids
165164
self.assertEqual(picking.carrier_id, self.carrier_multi)
166-
picking.move_lines.quantity_done = 1
165+
picking.move_ids.quantity_done = 1
167166
picking._action_done()
168167
self.assertAlmostEqual(picking.carrier_price, 50)
169168

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>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../delivery_multi_destination
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

0 commit comments

Comments
 (0)