From 3c6e5f1d4bf3d28594dc10e63aca3415795e9943 Mon Sep 17 00:00:00 2001 From: Roberto Lizana Date: Tue, 30 Jun 2020 19:52:47 +0200 Subject: [PATCH 01/23] [ADD] delivery_price_method --- delivery_price_method/__init__.py | 3 + delivery_price_method/__manifest__.py | 19 +++++ delivery_price_method/models/__init__.py | 3 + .../models/delivery_carrier.py | 32 ++++++++ delivery_price_method/readme/CONTRIBUTORS.rst | 2 + delivery_price_method/readme/DESCRIPTION.rst | 4 + delivery_price_method/readme/USAGE.rst | 3 + delivery_price_method/tests/__init__.py | 3 + .../tests/test_delivery_price_method.py | 80 +++++++++++++++++++ .../views/delivery_carrier_views.xml | 28 +++++++ 10 files changed, 177 insertions(+) create mode 100644 delivery_price_method/__init__.py create mode 100644 delivery_price_method/__manifest__.py create mode 100644 delivery_price_method/models/__init__.py create mode 100644 delivery_price_method/models/delivery_carrier.py create mode 100644 delivery_price_method/readme/CONTRIBUTORS.rst create mode 100644 delivery_price_method/readme/DESCRIPTION.rst create mode 100644 delivery_price_method/readme/USAGE.rst create mode 100644 delivery_price_method/tests/__init__.py create mode 100644 delivery_price_method/tests/test_delivery_price_method.py create mode 100644 delivery_price_method/views/delivery_carrier_views.xml diff --git a/delivery_price_method/__init__.py b/delivery_price_method/__init__.py new file mode 100644 index 0000000000..7772e8bfd7 --- /dev/null +++ b/delivery_price_method/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2020 Trey, Kilobytes de Soluciones +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from . import models diff --git a/delivery_price_method/__manifest__.py b/delivery_price_method/__manifest__.py new file mode 100644 index 0000000000..0f895bb866 --- /dev/null +++ b/delivery_price_method/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2020 Trey, Kilobytes de Soluciones +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + 'name': 'Delivery Price Method', + 'summary': 'Provides fields to be able to contemplate the tracking states' + 'and also adds a global fields', + 'author': 'Trey (www.trey.es), ' + 'Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/delivery-carrier', + 'license': 'AGPL-3', + 'category': 'Delivery', + 'version': '12.0.1.0.0', + 'depends': [ + 'delivery', + ], + 'data': [ + 'views/delivery_carrier_views.xml', + ], +} diff --git a/delivery_price_method/models/__init__.py b/delivery_price_method/models/__init__.py new file mode 100644 index 0000000000..c81a98c8ef --- /dev/null +++ b/delivery_price_method/models/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2020 Trey, Kilobytes de Soluciones +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from . import delivery_carrier diff --git a/delivery_price_method/models/delivery_carrier.py b/delivery_price_method/models/delivery_carrier.py new file mode 100644 index 0000000000..b38ce18b9d --- /dev/null +++ b/delivery_price_method/models/delivery_carrier.py @@ -0,0 +1,32 @@ +# Copyright 2020 Trey, Kilobytes de Soluciones +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class DeliveryCarrier(models.Model): + _inherit = 'delivery.carrier' + + # You must add next method to your carrier model if want use this price + # method + # + # def [CARRIER]_rate_shipment(self, order): + # return self.price_method_rate_shipment(order) + + price_method = fields.Selection( + selection=[ + ('fixed', 'Fixed price'), + ('base_on_rule', 'Based on Rules'), + ], + string='Price method', + default='fixed', + ) + + def price_method_rate_shipment(self, order): + return getattr(self, '%s_rate_shipment' % self.price_method)(order) + + def send_shipping(self, pickings): + res = super().send_shipping(pickings) + rates = getattr(self, '%s_send_shipping' % self.price_method)(pickings) + for index, rate in enumerate(rates): + res[index]['exact_price'] = rate['exact_price'] + return res diff --git a/delivery_price_method/readme/CONTRIBUTORS.rst b/delivery_price_method/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..f6abf4e4d4 --- /dev/null +++ b/delivery_price_method/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* `Trey `_: + * Roberto Lizana diff --git a/delivery_price_method/readme/DESCRIPTION.rst b/delivery_price_method/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..046b7a842d --- /dev/null +++ b/delivery_price_method/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +Tis module adds additional functions that will be necessary for the operator +developments. + +It provides a system to rate the shipping price based on a fixed price or based on rules. diff --git a/delivery_price_method/readme/USAGE.rst b/delivery_price_method/readme/USAGE.rst new file mode 100644 index 0000000000..74db2543c8 --- /dev/null +++ b/delivery_price_method/readme/USAGE.rst @@ -0,0 +1,3 @@ +Only available in carriers that have been developed using this module, please consult yours carriers addons. + +The carrier form will have a new field * Price method * to use fixed or rule based method. diff --git a/delivery_price_method/tests/__init__.py b/delivery_price_method/tests/__init__.py new file mode 100644 index 0000000000..031e3d503c --- /dev/null +++ b/delivery_price_method/tests/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2020 Trey, Kilobytes de Soluciones +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from . import test_delivery_price_method diff --git a/delivery_price_method/tests/test_delivery_price_method.py b/delivery_price_method/tests/test_delivery_price_method.py new file mode 100644 index 0000000000..e6d54e84dc --- /dev/null +++ b/delivery_price_method/tests/test_delivery_price_method.py @@ -0,0 +1,80 @@ +# Copyright 2020 Trey, Kilobytes de Soluciones +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo.tests.common import TransactionCase + + +class TestDeliveryPriceMethod(TransactionCase): + + def setUp(self): + super().setUp() + product_shipping_cost = self.env['product.product'].create({ + 'type': 'service', + 'name': 'Shipping costs', + 'standard_price': 10, + 'list_price': 100, + }) + self.carrier = self.env['delivery.carrier'].create({ + 'name': 'Test carrier', + 'delivery_type': 'fixed', + 'product_id': product_shipping_cost.id, + 'fixed_price': 99.99, + }) + + def test_delivery_price_fixed(self): + product = self.env.ref('product.product_delivery_01') + partner = self.env.ref('base.res_partner_12') + sale = self.env['sale.order'].create({ + 'partner_id': partner.id, + 'carrier_id': self.carrier.id, + 'order_line': [(0, 0, { + 'product_id': product.id, + 'product_uom_qty': 1})] + }) + sale.get_delivery_price() + self.assertEquals(sale.delivery_price, 99.99) + sale.set_delivery_line() + self.assertEquals(len(sale.order_line), 2) + sale.action_confirm() + picking = sale.picking_ids[0] + self.assertEquals(len(picking.move_lines), 1) + self.assertEquals(picking.carrier_id, self.carrier) + picking.action_confirm() + picking.action_assign() + self.assertFalse(picking.carrier_price) + picking.send_to_shipper() + self.assertEquals(picking.carrier_price, 99.99) + + def test_delivery_price_method(self): + product = self.env.ref('product.product_delivery_01') + partner = self.env.ref('base.res_partner_12') + sale = self.env['sale.order'].create({ + 'partner_id': partner.id, + 'carrier_id': self.carrier.id, + 'order_line': [(0, 0, { + 'product_id': product.id, + 'product_uom_qty': 1})] + }) + self.carrier.write({ + 'price_method': 'fixed', + 'fixed_price': 99.99, + }) + sale.get_delivery_price() + self.assertEquals(sale.delivery_price, 99.99) + self.carrier.write({ + 'price_method': 'fixed', + 'fixed_price': 5, + }) + sale.get_delivery_price() + self.assertEquals(sale.delivery_price, 5) + self.carrier.write({ + 'delivery_type': 'base_on_rule', + 'price_method': 'base_on_rule', + 'fixed_price': 99.99, + 'price_rule_ids': [(0, 0, { + 'variable': 'quantity', + 'operator': '==', + 'max_value': 1, + 'list_base_price': 11.11})] + }) + sale.get_delivery_price() + self.assertEquals(sale.delivery_price, 11.11) diff --git a/delivery_price_method/views/delivery_carrier_views.xml b/delivery_price_method/views/delivery_carrier_views.xml new file mode 100644 index 0000000000..5cb99f6b3c --- /dev/null +++ b/delivery_price_method/views/delivery_carrier_views.xml @@ -0,0 +1,28 @@ + + + + + delivery.carrier + + + + + + + + + + + + + + + + + + + + From ea79fe1325cbc9390f0e21d1ed157a9a4d5279dd Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 16 Jul 2020 19:15:09 +0200 Subject: [PATCH 02/23] [IMP] delivery_price_method: Make it independent + more compatible - Add default price_method called "Carrier obtained price", for being more explicit and avoid user confusions. - Shipment rate: Make it compatible with upstream code tricking the delivery_type field. - Shipping sending: Call upstream carrier sending routine + call standard one, and merge results (excluding the tracking_number). - Tests: * Make them more resilient (fixing the pricelist). * Use SavepointCase for executing setup only once. * Fine tune some code - Improve README [UPD] Update delivery_price_method.pot --- delivery_price_method/README.rst | 92 ++++ delivery_price_method/__manifest__.py | 1 + .../i18n/delivery_price_method.pot | 45 ++ .../models/delivery_carrier.py | 33 +- delivery_price_method/readme/CONTRIBUTORS.rst | 7 +- delivery_price_method/readme/DESCRIPTION.rst | 7 +- delivery_price_method/readme/USAGE.rst | 8 +- .../static/description/index.html | 440 ++++++++++++++++++ .../tests/test_delivery_price_method.py | 47 +- .../views/delivery_carrier_views.xml | 2 +- 10 files changed, 639 insertions(+), 43 deletions(-) create mode 100644 delivery_price_method/README.rst create mode 100644 delivery_price_method/i18n/delivery_price_method.pot create mode 100644 delivery_price_method/static/description/index.html diff --git a/delivery_price_method/README.rst b/delivery_price_method/README.rst new file mode 100644 index 0000000000..2377a3792b --- /dev/null +++ b/delivery_price_method/README.rst @@ -0,0 +1,92 @@ +===================== +Delivery Price Method +===================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github + :target: https://github.com/OCA/delivery-carrier/tree/12.0/delivery_price_method + :alt: OCA/delivery-carrier +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/delivery-carrier-12-0/delivery-carrier-12-0-delivery_price_method + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/99/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to force a local price rate computation for any delivery +method, including those that have been created to query a webservice for +fetching the rate. + +It uses the existing fixed price or price based on rules computations. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +#. Go to *Sales > Configuration > Sales Orders > Delivery Methods*. +#. Open or create a new one. +#. On the "Price Method" field, select "Fixed Price" or "Based on Rules". +#. You will see standard fields for selecting the price as if the delivery + method isn't an integration carrier. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Trey (www.trey.es) + +Contributors +~~~~~~~~~~~~ + +* `Trey `_: + + * Roberto Lizana + +* `Tecnativa `_: + + * Pedro M. Baeza + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/delivery-carrier `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/delivery_price_method/__manifest__.py b/delivery_price_method/__manifest__.py index 0f895bb866..ac1838f408 100644 --- a/delivery_price_method/__manifest__.py +++ b/delivery_price_method/__manifest__.py @@ -1,4 +1,5 @@ # Copyright 2020 Trey, Kilobytes de Soluciones +# Copyright 2020 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { 'name': 'Delivery Price Method', diff --git a/delivery_price_method/i18n/delivery_price_method.pot b/delivery_price_method/i18n/delivery_price_method.pot new file mode 100644 index 0000000000..52471a92ea --- /dev/null +++ b/delivery_price_method/i18n/delivery_price_method.pot @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_price_method +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: delivery_price_method +#: selection:delivery.carrier,price_method:0 +msgid "Based on Rules" +msgstr "" + +#. module: delivery_price_method +#: selection:delivery.carrier,price_method:0 +msgid "Carrier obtained price" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model,name:delivery_price_method.model_delivery_carrier +msgid "Delivery Methods" +msgstr "" + +#. module: delivery_price_method +#: selection:delivery.carrier,price_method:0 +msgid "Fixed price" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__price_method +msgid "Price method" +msgstr "" + +#. module: delivery_price_method +#: model_terms:ir.ui.view,arch_db:delivery_price_method.view_delivery_carrier_form +msgid "Pricing" +msgstr "" + diff --git a/delivery_price_method/models/delivery_carrier.py b/delivery_price_method/models/delivery_carrier.py index b38ce18b9d..fd056c1749 100644 --- a/delivery_price_method/models/delivery_carrier.py +++ b/delivery_price_method/models/delivery_carrier.py @@ -1,4 +1,5 @@ # Copyright 2020 Trey, Kilobytes de Soluciones +# Copyright 2020 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import fields, models @@ -6,27 +7,35 @@ class DeliveryCarrier(models.Model): _inherit = 'delivery.carrier' - # You must add next method to your carrier model if want use this price - # method - # - # def [CARRIER]_rate_shipment(self, order): - # return self.price_method_rate_shipment(order) - price_method = fields.Selection( selection=[ + ('carrier', 'Carrier obtained price'), ('fixed', 'Fixed price'), ('base_on_rule', 'Based on Rules'), ], string='Price method', - default='fixed', + default='carrier', ) - def price_method_rate_shipment(self, order): - return getattr(self, '%s_rate_shipment' % self.price_method)(order) + def rate_shipment(self, order): + """Trick the method for using all the upstream code for the + price computation in case of using fixed or base_on_rule. + """ + previous_method = False + if self.price_method in ("fixed", "base_on_rule"): + previous_method = self.delivery_type + self.delivery_type = self.price_method + res = super().rate_shipment(order) + if previous_method: + self.delivery_type = previous_method + return res def send_shipping(self, pickings): res = super().send_shipping(pickings) - rates = getattr(self, '%s_send_shipping' % self.price_method)(pickings) - for index, rate in enumerate(rates): - res[index]['exact_price'] = rate['exact_price'] + if self.price_method in ("fixed", "base_on_rule"): + rates = getattr( + self, '%s_send_shipping' % self.price_method)(pickings) + for index, rate in enumerate(rates): + del rate["tracking_number"] # remove offending key + res[index].update(rate) return res diff --git a/delivery_price_method/readme/CONTRIBUTORS.rst b/delivery_price_method/readme/CONTRIBUTORS.rst index f6abf4e4d4..efaba917fb 100644 --- a/delivery_price_method/readme/CONTRIBUTORS.rst +++ b/delivery_price_method/readme/CONTRIBUTORS.rst @@ -1,2 +1,7 @@ * `Trey `_: - * Roberto Lizana + + * Roberto Lizana + +* `Tecnativa `_: + + * Pedro M. Baeza diff --git a/delivery_price_method/readme/DESCRIPTION.rst b/delivery_price_method/readme/DESCRIPTION.rst index 046b7a842d..f861433084 100644 --- a/delivery_price_method/readme/DESCRIPTION.rst +++ b/delivery_price_method/readme/DESCRIPTION.rst @@ -1,4 +1,5 @@ -Tis module adds additional functions that will be necessary for the operator -developments. +This module allows to force a local price rate computation for any delivery +method, including those that have been created to query a webservice for +fetching the rate. -It provides a system to rate the shipping price based on a fixed price or based on rules. +It uses the existing fixed price or price based on rules computations. diff --git a/delivery_price_method/readme/USAGE.rst b/delivery_price_method/readme/USAGE.rst index 74db2543c8..ce3592c365 100644 --- a/delivery_price_method/readme/USAGE.rst +++ b/delivery_price_method/readme/USAGE.rst @@ -1,3 +1,5 @@ -Only available in carriers that have been developed using this module, please consult yours carriers addons. - -The carrier form will have a new field * Price method * to use fixed or rule based method. +#. Go to *Sales > Configuration > Sales Orders > Delivery Methods*. +#. Open or create a new one. +#. On the "Price Method" field, select "Fixed Price" or "Based on Rules". +#. You will see standard fields for selecting the price as if the delivery + method isn't an integration carrier. diff --git a/delivery_price_method/static/description/index.html b/delivery_price_method/static/description/index.html new file mode 100644 index 0000000000..7bb20f6071 --- /dev/null +++ b/delivery_price_method/static/description/index.html @@ -0,0 +1,440 @@ + + + + + + +Delivery Price Method + + + +
+

Delivery Price Method

+ + +

Beta License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

+

This module allows to force a local price rate computation for any delivery +method, including those that have been created to query a webservice for +fetching the rate.

+

It uses the existing fixed price or price based on rules computations.

+

Table of contents

+ +
+

Usage

+
    +
  1. Go to Sales > Configuration > Sales Orders > Delivery Methods.
  2. +
  3. Open or create a new one.
  4. +
  5. On the “Price Method” field, select “Fixed Price” or “Based on Rules”.
  6. +
  7. You will see standard fields for selecting the price as if the delivery +method isn’t an integration carrier.
  8. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Trey (www.trey.es)
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/delivery-carrier project on GitHub.

+

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

+
+
+
+ + diff --git a/delivery_price_method/tests/test_delivery_price_method.py b/delivery_price_method/tests/test_delivery_price_method.py index e6d54e84dc..16cbaa19fb 100644 --- a/delivery_price_method/tests/test_delivery_price_method.py +++ b/delivery_price_method/tests/test_delivery_price_method.py @@ -1,12 +1,14 @@ # Copyright 2020 Trey, Kilobytes de Soluciones +# Copyright 2020 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo.tests.common import TransactionCase +from odoo.tests.common import SavepointCase -class TestDeliveryPriceMethod(TransactionCase): - - def setUp(self): - super().setUp() +class TestDeliveryPriceMethod(SavepointCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + self = cls product_shipping_cost = self.env['product.product'].create({ 'type': 'service', 'name': 'Shipping costs', @@ -19,17 +21,26 @@ def setUp(self): 'product_id': product_shipping_cost.id, 'fixed_price': 99.99, }) - - def test_delivery_price_fixed(self): - product = self.env.ref('product.product_delivery_01') - partner = self.env.ref('base.res_partner_12') - sale = self.env['sale.order'].create({ - 'partner_id': partner.id, + self.pricelist = self.env["product.pricelist"].create({ + "name": "Test pricelist", + "item_ids": [(0, 0, { + "applied_on": "3_global", + "base": "list_price", + })], + }) + self.product = self.env.ref('product.product_delivery_01') + self.partner = self.env.ref('base.res_partner_12') + self.sale = self.env['sale.order'].create({ + 'partner_id': self.partner.id, + 'pricelist_id': self.pricelist.id, 'carrier_id': self.carrier.id, 'order_line': [(0, 0, { - 'product_id': product.id, + 'product_id': self.product.id, 'product_uom_qty': 1})] }) + + def test_delivery_price_fixed(self): + sale = self.sale sale.get_delivery_price() self.assertEquals(sale.delivery_price, 99.99) sale.set_delivery_line() @@ -45,19 +56,11 @@ def test_delivery_price_fixed(self): self.assertEquals(picking.carrier_price, 99.99) def test_delivery_price_method(self): - product = self.env.ref('product.product_delivery_01') - partner = self.env.ref('base.res_partner_12') - sale = self.env['sale.order'].create({ - 'partner_id': partner.id, - 'carrier_id': self.carrier.id, - 'order_line': [(0, 0, { - 'product_id': product.id, - 'product_uom_qty': 1})] - }) self.carrier.write({ 'price_method': 'fixed', 'fixed_price': 99.99, }) + sale = self.sale sale.get_delivery_price() self.assertEquals(sale.delivery_price, 99.99) self.carrier.write({ @@ -67,9 +70,7 @@ def test_delivery_price_method(self): sale.get_delivery_price() self.assertEquals(sale.delivery_price, 5) self.carrier.write({ - 'delivery_type': 'base_on_rule', 'price_method': 'base_on_rule', - 'fixed_price': 99.99, 'price_rule_ids': [(0, 0, { 'variable': 'quantity', 'operator': '==', diff --git a/delivery_price_method/views/delivery_carrier_views.xml b/delivery_price_method/views/delivery_carrier_views.xml index 5cb99f6b3c..d0d968ae76 100644 --- a/delivery_price_method/views/delivery_carrier_views.xml +++ b/delivery_price_method/views/delivery_carrier_views.xml @@ -9,7 +9,7 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - + From 8a2dfcf4795d5abf4d4fdb4f01c9d9c3978ebb98 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 17 Jul 2020 08:45:04 +0000 Subject: [PATCH 03/23] [ADD] icon.png --- .../static/description/icon.png | Bin 0 -> 9455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 delivery_price_method/static/description/icon.png diff --git a/delivery_price_method/static/description/icon.png b/delivery_price_method/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB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$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 From b81d33c74bc076ce6b56b9abfafd354034612d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=A7al=20Isern?= Date: Sat, 19 Sep 2020 22:17:16 +0200 Subject: [PATCH 04/23] [IMP] delivery_price_method: black, isort, prettier --- delivery_price_method/__manifest__.py | 25 ++--- .../models/delivery_carrier.py | 15 ++- .../tests/test_delivery_price_method.py | 98 ++++++++++--------- .../views/delivery_carrier_views.xml | 23 +++-- 4 files changed, 86 insertions(+), 75 deletions(-) diff --git a/delivery_price_method/__manifest__.py b/delivery_price_method/__manifest__.py index ac1838f408..9c23d01ebe 100644 --- a/delivery_price_method/__manifest__.py +++ b/delivery_price_method/__manifest__.py @@ -2,19 +2,14 @@ # Copyright 2020 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { - 'name': 'Delivery Price Method', - 'summary': 'Provides fields to be able to contemplate the tracking states' - 'and also adds a global fields', - 'author': 'Trey (www.trey.es), ' - 'Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/delivery-carrier', - 'license': 'AGPL-3', - 'category': 'Delivery', - 'version': '12.0.1.0.0', - 'depends': [ - 'delivery', - ], - 'data': [ - 'views/delivery_carrier_views.xml', - ], + "name": "Delivery Price Method", + "summary": "Provides fields to be able to contemplate the tracking states" + "and also adds a global fields", + "author": "Trey (www.trey.es), " "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/delivery-carrier", + "license": "AGPL-3", + "category": "Delivery", + "version": "12.0.1.0.0", + "depends": ["delivery"], + "data": ["views/delivery_carrier_views.xml"], } diff --git a/delivery_price_method/models/delivery_carrier.py b/delivery_price_method/models/delivery_carrier.py index fd056c1749..42968f8201 100644 --- a/delivery_price_method/models/delivery_carrier.py +++ b/delivery_price_method/models/delivery_carrier.py @@ -5,16 +5,16 @@ class DeliveryCarrier(models.Model): - _inherit = 'delivery.carrier' + _inherit = "delivery.carrier" price_method = fields.Selection( selection=[ - ('carrier', 'Carrier obtained price'), - ('fixed', 'Fixed price'), - ('base_on_rule', 'Based on Rules'), + ("carrier", "Carrier obtained price"), + ("fixed", "Fixed price"), + ("base_on_rule", "Based on Rules"), ], - string='Price method', - default='carrier', + string="Price method", + default="carrier", ) def rate_shipment(self, order): @@ -33,8 +33,7 @@ def rate_shipment(self, order): def send_shipping(self, pickings): res = super().send_shipping(pickings) if self.price_method in ("fixed", "base_on_rule"): - rates = getattr( - self, '%s_send_shipping' % self.price_method)(pickings) + rates = getattr(self, "%s_send_shipping" % self.price_method)(pickings) for index, rate in enumerate(rates): del rate["tracking_number"] # remove offending key res[index].update(rate) diff --git a/delivery_price_method/tests/test_delivery_price_method.py b/delivery_price_method/tests/test_delivery_price_method.py index 16cbaa19fb..58b249e89d 100644 --- a/delivery_price_method/tests/test_delivery_price_method.py +++ b/delivery_price_method/tests/test_delivery_price_method.py @@ -9,35 +9,40 @@ class TestDeliveryPriceMethod(SavepointCase): def setUpClass(cls): super().setUpClass() self = cls - product_shipping_cost = self.env['product.product'].create({ - 'type': 'service', - 'name': 'Shipping costs', - 'standard_price': 10, - 'list_price': 100, - }) - self.carrier = self.env['delivery.carrier'].create({ - 'name': 'Test carrier', - 'delivery_type': 'fixed', - 'product_id': product_shipping_cost.id, - 'fixed_price': 99.99, - }) - self.pricelist = self.env["product.pricelist"].create({ - "name": "Test pricelist", - "item_ids": [(0, 0, { - "applied_on": "3_global", - "base": "list_price", - })], - }) - self.product = self.env.ref('product.product_delivery_01') - self.partner = self.env.ref('base.res_partner_12') - self.sale = self.env['sale.order'].create({ - 'partner_id': self.partner.id, - 'pricelist_id': self.pricelist.id, - 'carrier_id': self.carrier.id, - 'order_line': [(0, 0, { - 'product_id': self.product.id, - 'product_uom_qty': 1})] - }) + product_shipping_cost = self.env["product.product"].create( + { + "type": "service", + "name": "Shipping costs", + "standard_price": 10, + "list_price": 100, + } + ) + self.carrier = self.env["delivery.carrier"].create( + { + "name": "Test carrier", + "delivery_type": "fixed", + "product_id": product_shipping_cost.id, + "fixed_price": 99.99, + } + ) + self.pricelist = self.env["product.pricelist"].create( + { + "name": "Test pricelist", + "item_ids": [(0, 0, {"applied_on": "3_global", "base": "list_price"})], + } + ) + self.product = self.env.ref("product.product_delivery_01") + self.partner = self.env.ref("base.res_partner_12") + self.sale = self.env["sale.order"].create( + { + "partner_id": self.partner.id, + "pricelist_id": self.pricelist.id, + "carrier_id": self.carrier.id, + "order_line": [ + (0, 0, {"product_id": self.product.id, "product_uom_qty": 1}) + ], + } + ) def test_delivery_price_fixed(self): sale = self.sale @@ -56,26 +61,29 @@ def test_delivery_price_fixed(self): self.assertEquals(picking.carrier_price, 99.99) def test_delivery_price_method(self): - self.carrier.write({ - 'price_method': 'fixed', - 'fixed_price': 99.99, - }) + self.carrier.write({"price_method": "fixed", "fixed_price": 99.99}) sale = self.sale sale.get_delivery_price() self.assertEquals(sale.delivery_price, 99.99) - self.carrier.write({ - 'price_method': 'fixed', - 'fixed_price': 5, - }) + self.carrier.write({"price_method": "fixed", "fixed_price": 5}) sale.get_delivery_price() self.assertEquals(sale.delivery_price, 5) - self.carrier.write({ - 'price_method': 'base_on_rule', - 'price_rule_ids': [(0, 0, { - 'variable': 'quantity', - 'operator': '==', - 'max_value': 1, - 'list_base_price': 11.11})] - }) + self.carrier.write( + { + "price_method": "base_on_rule", + "price_rule_ids": [ + ( + 0, + 0, + { + "variable": "quantity", + "operator": "==", + "max_value": 1, + "list_base_price": 11.11, + }, + ) + ], + } + ) sale.get_delivery_price() self.assertEquals(sale.delivery_price, 11.11) diff --git a/delivery_price_method/views/delivery_carrier_views.xml b/delivery_price_method/views/delivery_carrier_views.xml index d0d968ae76..b61169024f 100644 --- a/delivery_price_method/views/delivery_carrier_views.xml +++ b/delivery_price_method/views/delivery_carrier_views.xml @@ -1,4 +1,4 @@ - + -

Beta License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

This module allows to force a local price rate computation for any delivery method, including those that have been created to query a webservice for fetching the rate.

@@ -400,7 +400,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -422,6 +422,10 @@

Contributors

  • Pedro M. Baeza
  • +
  • QubiQ 2010:
      +
    • Marçal Isern
    • +
    +
  • @@ -431,7 +435,7 @@

    Maintainers

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    -

    This module is part of the OCA/delivery-carrier project on GitHub.

    +

    This module is part of the OCA/delivery-carrier project on GitHub.

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

    diff --git a/delivery_price_method/tests/test_delivery_price_method.py b/delivery_price_method/tests/test_delivery_price_method.py index 58b249e89d..e1e1486f97 100644 --- a/delivery_price_method/tests/test_delivery_price_method.py +++ b/delivery_price_method/tests/test_delivery_price_method.py @@ -1,7 +1,9 @@ # Copyright 2020 Trey, Kilobytes de Soluciones # Copyright 2020 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo.tests import Form from odoo.tests.common import SavepointCase +from odoo.tools import float_compare class TestDeliveryPriceMethod(SavepointCase): @@ -44,12 +46,23 @@ def setUpClass(cls): } ) + def _add_delivery(self): + sale = self.sale + delivery_wizard = Form( + self.env["choose.delivery.carrier"].with_context( + {"default_order_id": sale.id, "default_carrier_id": self.carrier} + ) + ) + choose_delivery_carrier = delivery_wizard.save() + choose_delivery_carrier.button_confirm() + def test_delivery_price_fixed(self): sale = self.sale - sale.get_delivery_price() - self.assertEquals(sale.delivery_price, 99.99) - sale.set_delivery_line() - self.assertEquals(len(sale.order_line), 2) + self._add_delivery() + delivery_lines = sale.order_line.filtered(lambda r: r.is_delivery) + delivery_price = sum(delivery_lines.mapped("price_unit")) + self.assertEqual(float_compare(delivery_price, 99.99, precision_digits=2), 0) + self.assertEquals(len(delivery_lines), 1) sale.action_confirm() picking = sale.picking_ids[0] self.assertEquals(len(picking.move_lines), 1) @@ -63,11 +76,16 @@ def test_delivery_price_fixed(self): def test_delivery_price_method(self): self.carrier.write({"price_method": "fixed", "fixed_price": 99.99}) sale = self.sale - sale.get_delivery_price() - self.assertEquals(sale.delivery_price, 99.99) + self._add_delivery() + delivery_lines = sale.order_line.filtered(lambda r: r.is_delivery) + delivery_price = sum(delivery_lines.mapped("price_unit")) + self.assertEqual(float_compare(delivery_price, 99.99, precision_digits=2), 0) + self.assertEquals(len(delivery_lines), 1) self.carrier.write({"price_method": "fixed", "fixed_price": 5}) - sale.get_delivery_price() - self.assertEquals(sale.delivery_price, 5) + self._add_delivery() + delivery_lines = sale.order_line.filtered(lambda r: r.is_delivery) + delivery_price = sum(delivery_lines.mapped("price_unit")) + self.assertEquals(delivery_price, 5) self.carrier.write( { "price_method": "base_on_rule", @@ -85,5 +103,7 @@ def test_delivery_price_method(self): ], } ) - sale.get_delivery_price() - self.assertEquals(sale.delivery_price, 11.11) + self._add_delivery() + delivery_lines = sale.order_line.filtered(lambda r: r.is_delivery) + delivery_price = sum(delivery_lines.mapped("price_unit")) + self.assertEquals(delivery_price, 11.11) From 28c484b7260ab38201aed07471324f55b84e8ab3 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 6 Sep 2021 10:16:04 +0200 Subject: [PATCH 06/23] [FIX] delivery_price_method: method permissions If a user don't have the necessary permissions for writing in the `delivery.carrier` model (like a low range salesman) he won't be able to choose a carrier wich uses the rate shipment override. TT31627 delivery_price_method 13.0.1.0.1 --- delivery_price_method/__manifest__.py | 2 +- delivery_price_method/models/delivery_carrier.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/delivery_price_method/__manifest__.py b/delivery_price_method/__manifest__.py index 2474defb20..9173bcd290 100644 --- a/delivery_price_method/__manifest__.py +++ b/delivery_price_method/__manifest__.py @@ -9,7 +9,7 @@ "website": "https://github.com/OCA/delivery-carrier", "license": "AGPL-3", "category": "Delivery", - "version": "13.0.1.0.0", + "version": "13.0.1.0.1", "depends": ["delivery"], "data": ["views/delivery_carrier_views.xml"], } diff --git a/delivery_price_method/models/delivery_carrier.py b/delivery_price_method/models/delivery_carrier.py index 42968f8201..01ab32333c 100644 --- a/delivery_price_method/models/delivery_carrier.py +++ b/delivery_price_method/models/delivery_carrier.py @@ -24,10 +24,10 @@ def rate_shipment(self, order): previous_method = False if self.price_method in ("fixed", "base_on_rule"): previous_method = self.delivery_type - self.delivery_type = self.price_method + self.sudo().delivery_type = self.price_method res = super().rate_shipment(order) if previous_method: - self.delivery_type = previous_method + self.sudo().delivery_type = previous_method return res def send_shipping(self, pickings): From 8b1b606ae06dec1c35521a3432f7fbc85cd3c420 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 21 Apr 2022 19:45:44 +0200 Subject: [PATCH 07/23] [IMP] delivery_*: Promote modules to Stable [UPD] README.rst delivery_price_method 13.0.1.0.2 --- delivery_price_method/README.rst | 4 ++-- delivery_price_method/__manifest__.py | 3 ++- delivery_price_method/static/description/index.html | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/delivery_price_method/README.rst b/delivery_price_method/README.rst index 45c23863b9..d81d7e3212 100644 --- a/delivery_price_method/README.rst +++ b/delivery_price_method/README.rst @@ -7,9 +7,9 @@ Delivery Price Method !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status - :alt: Beta + :alt: Production/Stable .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 diff --git a/delivery_price_method/__manifest__.py b/delivery_price_method/__manifest__.py index 9173bcd290..4caad98325 100644 --- a/delivery_price_method/__manifest__.py +++ b/delivery_price_method/__manifest__.py @@ -8,8 +8,9 @@ "author": "Trey (www.trey.es), " "Odoo Community Association (OCA)", "website": "https://github.com/OCA/delivery-carrier", "license": "AGPL-3", + "development_status": "Production/Stable", "category": "Delivery", - "version": "13.0.1.0.1", + "version": "13.0.1.0.2", "depends": ["delivery"], "data": ["views/delivery_carrier_views.xml"], } diff --git a/delivery_price_method/static/description/index.html b/delivery_price_method/static/description/index.html index 38b6db5b58..8be838de46 100644 --- a/delivery_price_method/static/description/index.html +++ b/delivery_price_method/static/description/index.html @@ -367,7 +367,7 @@

    Delivery Price Method

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Beta License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

    +

    Production/Stable License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

    This module allows to force a local price rate computation for any delivery method, including those that have been created to query a webservice for fetching the rate.

    From ecb41aa1b176f5e104f7a62a8a35a81ffe16e4e4 Mon Sep 17 00:00:00 2001 From: "Leonardo J. Caballero G" Date: Tue, 24 May 2022 05:12:13 +0000 Subject: [PATCH 08/23] Added translation using Weblate (Spanish) --- delivery_price_method/i18n/es.po | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 delivery_price_method/i18n/es.po diff --git a/delivery_price_method/i18n/es.po b/delivery_price_method/i18n/es.po new file mode 100644 index 0000000000..223200c075 --- /dev/null +++ b/delivery_price_method/i18n/es.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_price_method +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: delivery_price_method +#: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__base_on_rule +msgid "Based on Rules" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__carrier +msgid "Carrier obtained price" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__fixed +msgid "Fixed price" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__price_method +msgid "Price method" +msgstr "" + +#. module: delivery_price_method +#: model_terms:ir.ui.view,arch_db:delivery_price_method.view_delivery_carrier_form +msgid "Pricing" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model,name:delivery_price_method.model_delivery_carrier +msgid "Shipping Methods" +msgstr "" From a09536b16170e7f4827c0234f620ef02ba00fc4e Mon Sep 17 00:00:00 2001 From: "Leonardo J. Caballero G" Date: Tue, 24 May 2022 05:12:16 +0000 Subject: [PATCH 09/23] Added translation using Weblate (Spanish (Chile)) --- delivery_price_method/i18n/es_CL.po | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 delivery_price_method/i18n/es_CL.po diff --git a/delivery_price_method/i18n/es_CL.po b/delivery_price_method/i18n/es_CL.po new file mode 100644 index 0000000000..3764a795d4 --- /dev/null +++ b/delivery_price_method/i18n/es_CL.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_price_method +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es_CL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: delivery_price_method +#: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__base_on_rule +msgid "Based on Rules" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__carrier +msgid "Carrier obtained price" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__fixed +msgid "Fixed price" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__price_method +msgid "Price method" +msgstr "" + +#. module: delivery_price_method +#: model_terms:ir.ui.view,arch_db:delivery_price_method.view_delivery_carrier_form +msgid "Pricing" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model,name:delivery_price_method.model_delivery_carrier +msgid "Shipping Methods" +msgstr "" From 37cf25880a1166810f9b0aa5d8682fb0849f0117 Mon Sep 17 00:00:00 2001 From: "Leonardo J. Caballero G" Date: Tue, 24 May 2022 05:12:18 +0000 Subject: [PATCH 10/23] Added translation using Weblate (Spanish (es_VE)) --- delivery_price_method/i18n/es_VE.po | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 delivery_price_method/i18n/es_VE.po diff --git a/delivery_price_method/i18n/es_VE.po b/delivery_price_method/i18n/es_VE.po new file mode 100644 index 0000000000..a588e1935b --- /dev/null +++ b/delivery_price_method/i18n/es_VE.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * delivery_price_method +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es_VE\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: delivery_price_method +#: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__base_on_rule +msgid "Based on Rules" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__carrier +msgid "Carrier obtained price" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__fixed +msgid "Fixed price" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__price_method +msgid "Price method" +msgstr "" + +#. module: delivery_price_method +#: model_terms:ir.ui.view,arch_db:delivery_price_method.view_delivery_carrier_form +msgid "Pricing" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model,name:delivery_price_method.model_delivery_carrier +msgid "Shipping Methods" +msgstr "" From bd214bf0bafedb7c80632e0db46add3a4b19b73b Mon Sep 17 00:00:00 2001 From: "Leonardo J. Caballero G" Date: Tue, 24 May 2022 05:18:02 +0000 Subject: [PATCH 11/23] Translated using Weblate (Spanish) Currently translated at 100.0% (6 of 6 strings) Translation: delivery-carrier-13.0/delivery-carrier-13.0-delivery_price_method Translate-URL: https://translation.odoo-community.org/projects/delivery-carrier-13-0/delivery-carrier-13-0-delivery_price_method/es/ --- delivery_price_method/i18n/es.po | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/delivery_price_method/i18n/es.po b/delivery_price_method/i18n/es.po index 223200c075..9bf80d1cbb 100644 --- a/delivery_price_method/i18n/es.po +++ b/delivery_price_method/i18n/es.po @@ -6,40 +6,42 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2022-05-24 05:34+0000\n" +"Last-Translator: Leonardo J. Caballero G. \n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" #. module: delivery_price_method #: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__base_on_rule msgid "Based on Rules" -msgstr "" +msgstr "Basado en reglas" #. module: delivery_price_method #: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__carrier msgid "Carrier obtained price" -msgstr "" +msgstr "Precio obtenido por el transportista" #. module: delivery_price_method #: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__fixed msgid "Fixed price" -msgstr "" +msgstr "Precio fijo" #. module: delivery_price_method #: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__price_method msgid "Price method" -msgstr "" +msgstr "Método de precio" #. module: delivery_price_method #: model_terms:ir.ui.view,arch_db:delivery_price_method.view_delivery_carrier_form msgid "Pricing" -msgstr "" +msgstr "Precios" #. module: delivery_price_method #: model:ir.model,name:delivery_price_method.model_delivery_carrier msgid "Shipping Methods" -msgstr "" +msgstr "Métodos de envío" From 881c4b7258bf71c1f2ee70e9f0bc0738a32ed20f Mon Sep 17 00:00:00 2001 From: "Leonardo J. Caballero G" Date: Tue, 24 May 2022 05:17:47 +0000 Subject: [PATCH 12/23] Translated using Weblate (Spanish (Chile)) Currently translated at 100.0% (6 of 6 strings) Translation: delivery-carrier-13.0/delivery-carrier-13.0-delivery_price_method Translate-URL: https://translation.odoo-community.org/projects/delivery-carrier-13-0/delivery-carrier-13-0-delivery_price_method/es_CL/ --- delivery_price_method/i18n/es_CL.po | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/delivery_price_method/i18n/es_CL.po b/delivery_price_method/i18n/es_CL.po index 3764a795d4..0fec900548 100644 --- a/delivery_price_method/i18n/es_CL.po +++ b/delivery_price_method/i18n/es_CL.po @@ -6,40 +6,42 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2022-05-24 05:34+0000\n" +"Last-Translator: Leonardo J. Caballero G. \n" "Language-Team: none\n" "Language: es_CL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" #. module: delivery_price_method #: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__base_on_rule msgid "Based on Rules" -msgstr "" +msgstr "Basado en reglas" #. module: delivery_price_method #: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__carrier msgid "Carrier obtained price" -msgstr "" +msgstr "Precio obtenido por el transportista" #. module: delivery_price_method #: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__fixed msgid "Fixed price" -msgstr "" +msgstr "Precio fijo" #. module: delivery_price_method #: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__price_method msgid "Price method" -msgstr "" +msgstr "Método de precio" #. module: delivery_price_method #: model_terms:ir.ui.view,arch_db:delivery_price_method.view_delivery_carrier_form msgid "Pricing" -msgstr "" +msgstr "Precios" #. module: delivery_price_method #: model:ir.model,name:delivery_price_method.model_delivery_carrier msgid "Shipping Methods" -msgstr "" +msgstr "Métodos de envío" From 5917838e7b1512eaa115d8000d4063642eb93575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Thu, 11 Aug 2022 18:08:10 +0200 Subject: [PATCH 13/23] [MIG] delivery_price_method: Migration to 14.0 TT36947 [UPD] Update delivery_price_method.pot [UPD] README.rst --- delivery_price_method/README.rst | 10 +++---- delivery_price_method/__manifest__.py | 2 +- .../i18n/delivery_price_method.pot | 17 +++++++++++- .../static/description/index.html | 6 ++--- .../tests/test_delivery_price_method.py | 26 +++++++++++++------ 5 files changed, 43 insertions(+), 18 deletions(-) diff --git a/delivery_price_method/README.rst b/delivery_price_method/README.rst index d81d7e3212..33461a3099 100644 --- a/delivery_price_method/README.rst +++ b/delivery_price_method/README.rst @@ -14,13 +14,13 @@ Delivery Price Method :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github - :target: https://github.com/OCA/delivery-carrier/tree/13.0/delivery_price_method + :target: https://github.com/OCA/delivery-carrier/tree/14.0/delivery_price_method :alt: OCA/delivery-carrier .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/delivery-carrier-13-0/delivery-carrier-13-0-delivery_price_method + :target: https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_price_method :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/99/13.0 + :target: https://runbot.odoo-community.org/runbot/99/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -51,7 +51,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -91,6 +91,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/delivery-carrier `_ project on GitHub. +This module is part of the `OCA/delivery-carrier `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/delivery_price_method/__manifest__.py b/delivery_price_method/__manifest__.py index 4caad98325..969ab0dcc0 100644 --- a/delivery_price_method/__manifest__.py +++ b/delivery_price_method/__manifest__.py @@ -10,7 +10,7 @@ "license": "AGPL-3", "development_status": "Production/Stable", "category": "Delivery", - "version": "13.0.1.0.2", + "version": "14.0.1.0.0", "depends": ["delivery"], "data": ["views/delivery_carrier_views.xml"], } diff --git a/delivery_price_method/i18n/delivery_price_method.pot b/delivery_price_method/i18n/delivery_price_method.pot index 3b7a2357d3..ea984e9fea 100644 --- a/delivery_price_method/i18n/delivery_price_method.pot +++ b/delivery_price_method/i18n/delivery_price_method.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -23,11 +23,26 @@ msgstr "" msgid "Carrier obtained price" msgstr "" +#. module: delivery_price_method +#: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__display_name +msgid "Display Name" +msgstr "" + #. module: delivery_price_method #: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__fixed msgid "Fixed price" msgstr "" +#. module: delivery_price_method +#: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__id +msgid "ID" +msgstr "" + +#. module: delivery_price_method +#: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier____last_update +msgid "Last Modified on" +msgstr "" + #. module: delivery_price_method #: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__price_method msgid "Price method" diff --git a/delivery_price_method/static/description/index.html b/delivery_price_method/static/description/index.html index 8be838de46..cef84bfa98 100644 --- a/delivery_price_method/static/description/index.html +++ b/delivery_price_method/static/description/index.html @@ -367,7 +367,7 @@

    Delivery Price Method

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Production/Stable License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

    +

    Production/Stable License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

    This module allows to force a local price rate computation for any delivery method, including those that have been created to query a webservice for fetching the rate.

    @@ -400,7 +400,7 @@

    Bug Tracker

    Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

    +feedback.

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

    @@ -435,7 +435,7 @@

    Maintainers

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    -

    This module is part of the OCA/delivery-carrier project on GitHub.

    +

    This module is part of the OCA/delivery-carrier project on GitHub.

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

    diff --git a/delivery_price_method/tests/test_delivery_price_method.py b/delivery_price_method/tests/test_delivery_price_method.py index e1e1486f97..8455537dec 100644 --- a/delivery_price_method/tests/test_delivery_price_method.py +++ b/delivery_price_method/tests/test_delivery_price_method.py @@ -30,7 +30,17 @@ def setUpClass(cls): self.pricelist = self.env["product.pricelist"].create( { "name": "Test pricelist", - "item_ids": [(0, 0, {"applied_on": "3_global", "base": "list_price"})], + "item_ids": [ + ( + 0, + 0, + { + "applied_on": "3_global", + "compute_price": "formula", + "base": "list_price", + }, + ) + ], } ) self.product = self.env.ref("product.product_delivery_01") @@ -62,16 +72,16 @@ def test_delivery_price_fixed(self): delivery_lines = sale.order_line.filtered(lambda r: r.is_delivery) delivery_price = sum(delivery_lines.mapped("price_unit")) self.assertEqual(float_compare(delivery_price, 99.99, precision_digits=2), 0) - self.assertEquals(len(delivery_lines), 1) + self.assertEqual(len(delivery_lines), 1) sale.action_confirm() picking = sale.picking_ids[0] - self.assertEquals(len(picking.move_lines), 1) - self.assertEquals(picking.carrier_id, self.carrier) + self.assertEqual(len(picking.move_lines), 1) + self.assertEqual(picking.carrier_id, self.carrier) picking.action_confirm() picking.action_assign() self.assertFalse(picking.carrier_price) picking.send_to_shipper() - self.assertEquals(picking.carrier_price, 99.99) + self.assertEqual(picking.carrier_price, 99.99) def test_delivery_price_method(self): self.carrier.write({"price_method": "fixed", "fixed_price": 99.99}) @@ -80,12 +90,12 @@ def test_delivery_price_method(self): delivery_lines = sale.order_line.filtered(lambda r: r.is_delivery) delivery_price = sum(delivery_lines.mapped("price_unit")) self.assertEqual(float_compare(delivery_price, 99.99, precision_digits=2), 0) - self.assertEquals(len(delivery_lines), 1) + self.assertEqual(len(delivery_lines), 1) self.carrier.write({"price_method": "fixed", "fixed_price": 5}) self._add_delivery() delivery_lines = sale.order_line.filtered(lambda r: r.is_delivery) delivery_price = sum(delivery_lines.mapped("price_unit")) - self.assertEquals(delivery_price, 5) + self.assertEqual(delivery_price, 5) self.carrier.write( { "price_method": "base_on_rule", @@ -106,4 +116,4 @@ def test_delivery_price_method(self): self._add_delivery() delivery_lines = sale.order_line.filtered(lambda r: r.is_delivery) delivery_price = sum(delivery_lines.mapped("price_unit")) - self.assertEquals(delivery_price, 11.11) + self.assertEqual(delivery_price, 11.11) From 8d2067287516c63f5fdb40a3d7bbe75341b9db89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Thu, 6 Oct 2022 09:31:24 +0200 Subject: [PATCH 14/23] [MIG] delivery_price_method: Migration to 15.0 TT36947 Co-authored-by: jaredkipe --- delivery_price_method/README.rst | 10 +++++----- delivery_price_method/__manifest__.py | 2 +- .../i18n/delivery_price_method.pot | 17 +---------------- .../models/delivery_carrier.py | 3 ++- .../static/description/index.html | 6 +++--- .../tests/test_delivery_price_method.py | 6 +++--- 6 files changed, 15 insertions(+), 29 deletions(-) diff --git a/delivery_price_method/README.rst b/delivery_price_method/README.rst index 33461a3099..ddcabb241b 100644 --- a/delivery_price_method/README.rst +++ b/delivery_price_method/README.rst @@ -14,13 +14,13 @@ Delivery Price Method :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github - :target: https://github.com/OCA/delivery-carrier/tree/14.0/delivery_price_method + :target: https://github.com/OCA/delivery-carrier/tree/15.0/delivery_price_method :alt: OCA/delivery-carrier .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_price_method + :target: https://translation.odoo-community.org/projects/delivery-carrier-15-0/delivery-carrier-15-0-delivery_price_method :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/99/14.0 + :target: https://runbot.odoo-community.org/runbot/99/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -51,7 +51,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -91,6 +91,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/delivery-carrier `_ project on GitHub. +This module is part of the `OCA/delivery-carrier `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/delivery_price_method/__manifest__.py b/delivery_price_method/__manifest__.py index 969ab0dcc0..d78b557028 100644 --- a/delivery_price_method/__manifest__.py +++ b/delivery_price_method/__manifest__.py @@ -10,7 +10,7 @@ "license": "AGPL-3", "development_status": "Production/Stable", "category": "Delivery", - "version": "14.0.1.0.0", + "version": "15.0.1.0.0", "depends": ["delivery"], "data": ["views/delivery_carrier_views.xml"], } diff --git a/delivery_price_method/i18n/delivery_price_method.pot b/delivery_price_method/i18n/delivery_price_method.pot index ea984e9fea..886d1c893d 100644 --- a/delivery_price_method/i18n/delivery_price_method.pot +++ b/delivery_price_method/i18n/delivery_price_method.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -23,26 +23,11 @@ msgstr "" msgid "Carrier obtained price" msgstr "" -#. module: delivery_price_method -#: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__display_name -msgid "Display Name" -msgstr "" - #. module: delivery_price_method #: model:ir.model.fields.selection,name:delivery_price_method.selection__delivery_carrier__price_method__fixed msgid "Fixed price" msgstr "" -#. module: delivery_price_method -#: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__id -msgid "ID" -msgstr "" - -#. module: delivery_price_method -#: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier____last_update -msgid "Last Modified on" -msgstr "" - #. module: delivery_price_method #: model:ir.model.fields,field_description:delivery_price_method.field_delivery_carrier__price_method msgid "Price method" diff --git a/delivery_price_method/models/delivery_carrier.py b/delivery_price_method/models/delivery_carrier.py index 01ab32333c..ebd8f993ae 100644 --- a/delivery_price_method/models/delivery_carrier.py +++ b/delivery_price_method/models/delivery_carrier.py @@ -7,14 +7,15 @@ class DeliveryCarrier(models.Model): _inherit = "delivery.carrier" + # pylint: disable=W8113 price_method = fields.Selection( selection=[ ("carrier", "Carrier obtained price"), ("fixed", "Fixed price"), ("base_on_rule", "Based on Rules"), ], - string="Price method", default="carrier", + string="Price method", ) def rate_shipment(self, order): diff --git a/delivery_price_method/static/description/index.html b/delivery_price_method/static/description/index.html index cef84bfa98..5f153db83c 100644 --- a/delivery_price_method/static/description/index.html +++ b/delivery_price_method/static/description/index.html @@ -367,7 +367,7 @@

    Delivery Price Method

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Production/Stable License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

    +

    Production/Stable License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

    This module allows to force a local price rate computation for any delivery method, including those that have been created to query a webservice for fetching the rate.

    @@ -400,7 +400,7 @@

    Bug Tracker

    Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

    +feedback.

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

    @@ -435,7 +435,7 @@

    Maintainers

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    -

    This module is part of the OCA/delivery-carrier project on GitHub.

    +

    This module is part of the OCA/delivery-carrier project on GitHub.

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

    diff --git a/delivery_price_method/tests/test_delivery_price_method.py b/delivery_price_method/tests/test_delivery_price_method.py index 8455537dec..8744633699 100644 --- a/delivery_price_method/tests/test_delivery_price_method.py +++ b/delivery_price_method/tests/test_delivery_price_method.py @@ -2,11 +2,11 @@ # Copyright 2020 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo.tests import Form -from odoo.tests.common import SavepointCase +from odoo.tests.common import TransactionCase from odoo.tools import float_compare -class TestDeliveryPriceMethod(SavepointCase): +class TestDeliveryPriceMethod(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() @@ -60,7 +60,7 @@ def _add_delivery(self): sale = self.sale delivery_wizard = Form( self.env["choose.delivery.carrier"].with_context( - {"default_order_id": sale.id, "default_carrier_id": self.carrier} + default_order_id=sale.id, default_carrier_id=self.carrier ) ) choose_delivery_carrier = delivery_wizard.save() From 118fcd2d56d2d68b0258bc6ee1093bb96200f261 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 9 Nov 2022 17:07:41 +0100 Subject: [PATCH 15/23] [MIG] delivery_price_method: Migration to 16.0 TT40425 --- delivery_price_method/__manifest__.py | 2 +- delivery_price_method/tests/test_delivery_price_method.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/delivery_price_method/__manifest__.py b/delivery_price_method/__manifest__.py index d78b557028..c9f2631b9c 100644 --- a/delivery_price_method/__manifest__.py +++ b/delivery_price_method/__manifest__.py @@ -10,7 +10,7 @@ "license": "AGPL-3", "development_status": "Production/Stable", "category": "Delivery", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "depends": ["delivery"], "data": ["views/delivery_carrier_views.xml"], } diff --git a/delivery_price_method/tests/test_delivery_price_method.py b/delivery_price_method/tests/test_delivery_price_method.py index 8744633699..99612c5113 100644 --- a/delivery_price_method/tests/test_delivery_price_method.py +++ b/delivery_price_method/tests/test_delivery_price_method.py @@ -75,7 +75,8 @@ def test_delivery_price_fixed(self): self.assertEqual(len(delivery_lines), 1) sale.action_confirm() picking = sale.picking_ids[0] - self.assertEqual(len(picking.move_lines), 1) + picking.move_ids.quantity_done = 1 + self.assertEqual(len(picking.move_line_ids), 1) self.assertEqual(picking.carrier_id, self.carrier) picking.action_confirm() picking.action_assign() From dd17e110d29906eed7e9352cb065d79da28e0d0f Mon Sep 17 00:00:00 2001 From: oca-ci Date: Tue, 15 Nov 2022 15:10:54 +0000 Subject: [PATCH 16/23] [UPD] Update delivery_price_method.pot --- delivery_price_method/i18n/delivery_price_method.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delivery_price_method/i18n/delivery_price_method.pot b/delivery_price_method/i18n/delivery_price_method.pot index 886d1c893d..60d21d2abe 100644 --- a/delivery_price_method/i18n/delivery_price_method.pot +++ b/delivery_price_method/i18n/delivery_price_method.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 15.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" From 3a168dc1b50e796454cea85dd017bfed9837ffb5 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 15 Nov 2022 15:14:12 +0000 Subject: [PATCH 17/23] [UPD] README.rst --- delivery_price_method/README.rst | 10 +++++----- delivery_price_method/static/description/index.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/delivery_price_method/README.rst b/delivery_price_method/README.rst index ddcabb241b..87b1c00294 100644 --- a/delivery_price_method/README.rst +++ b/delivery_price_method/README.rst @@ -14,13 +14,13 @@ Delivery Price Method :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github - :target: https://github.com/OCA/delivery-carrier/tree/15.0/delivery_price_method + :target: https://github.com/OCA/delivery-carrier/tree/16.0/delivery_price_method :alt: OCA/delivery-carrier .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/delivery-carrier-15-0/delivery-carrier-15-0-delivery_price_method + :target: https://translation.odoo-community.org/projects/delivery-carrier-16-0/delivery-carrier-16-0-delivery_price_method :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/99/15.0 + :target: https://runbot.odoo-community.org/runbot/99/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -51,7 +51,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -91,6 +91,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/delivery-carrier `_ project on GitHub. +This module is part of the `OCA/delivery-carrier `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/delivery_price_method/static/description/index.html b/delivery_price_method/static/description/index.html index 5f153db83c..6ce07330d0 100644 --- a/delivery_price_method/static/description/index.html +++ b/delivery_price_method/static/description/index.html @@ -367,7 +367,7 @@

    Delivery Price Method

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Production/Stable License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

    +

    Production/Stable License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runbot

    This module allows to force a local price rate computation for any delivery method, including those that have been created to query a webservice for fetching the rate.

    @@ -400,7 +400,7 @@

    Bug Tracker

    Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

    +feedback.

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

    @@ -435,7 +435,7 @@

    Maintainers

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    -

    This module is part of the OCA/delivery-carrier project on GitHub.

    +

    This module is part of the OCA/delivery-carrier project on GitHub.

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

    From fcb531e744fbfc8c33b4f334b555c25a678f4b92 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Sep 2023 12:29:44 +0000 Subject: [PATCH 18/23] [UPD] README.rst --- delivery_price_method/README.rst | 15 +++++--- .../static/description/index.html | 38 ++++++++++--------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/delivery_price_method/README.rst b/delivery_price_method/README.rst index 87b1c00294..4087b1f5d1 100644 --- a/delivery_price_method/README.rst +++ b/delivery_price_method/README.rst @@ -2,10 +2,13 @@ Delivery Price Method ===================== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:9e406eb0c466c558727db259162fdbbd504bd03b03bea0d218c2e8d799b55012 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Delivery Price Method .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/delivery-carrier-16-0/delivery-carrier-16-0-delivery_price_method :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/99/16.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/delivery-carrier&target_branch=16.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module allows to force a local price rate computation for any delivery method, including those that have been created to query a webservice for @@ -50,7 +53,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/delivery_price_method/static/description/index.html b/delivery_price_method/static/description/index.html index 6ce07330d0..be9e8504da 100644 --- a/delivery_price_method/static/description/index.html +++ b/delivery_price_method/static/description/index.html @@ -1,20 +1,20 @@ - + - + Delivery Price Method