From 3db1e8a9b7dc34190b07c181abd519500ccad4f5 Mon Sep 17 00:00:00 2001 From: Tran Thanh Phuc Date: Sun, 7 Feb 2021 21:02:19 +0700 Subject: [PATCH] [MIG] delivery_carrier_pricelist: Migration to 14.0 --- delivery_carrier_pricelist/README.rst | 93 ++++ delivery_carrier_pricelist/__manifest__.py | 4 +- .../models/delivery_carrier.py | 6 +- .../readme/CONTRIBUTORS.rst | 1 + delivery_carrier_pricelist/readme/CREDITS.rst | 3 + .../security/ir.model.access.csv | 2 + .../static/description/index.html | 439 ++++++++++++++++++ 7 files changed, 544 insertions(+), 4 deletions(-) create mode 100644 delivery_carrier_pricelist/README.rst create mode 100644 delivery_carrier_pricelist/readme/CREDITS.rst create mode 100644 delivery_carrier_pricelist/security/ir.model.access.csv create mode 100644 delivery_carrier_pricelist/static/description/index.html diff --git a/delivery_carrier_pricelist/README.rst b/delivery_carrier_pricelist/README.rst new file mode 100644 index 0000000000..12a7e4d0cb --- /dev/null +++ b/delivery_carrier_pricelist/README.rst @@ -0,0 +1,93 @@ +========================= +Shipping Method Pricelist +========================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/14.0/delivery_carrier_pricelist + :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_carrier_pricelist + :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 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Compute shipping methods fees based on Product Pricelists. + +It allows to have different pricing per customer, prices depending on dates, ... +The pricelist based cost is computed from the shipping method's product and the +sales order's pricelist. + +It supports the following use cases: + +* When no "external" provider (e.g. DHL, UPS, ...) is used, a new provider + "Based on Product Pricelist" is available. +* When an external provider is used, a new option in the "Invoice Policy" + selection, named "Pricelist Cost", overrides the provider's cost by the + pricelist based cost. + +**Table of contents** + +.. contents:: + :local: + +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 +~~~~~~~ + +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* Guewen Baconnier +* Phuc Tran Thanh + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Camptocamp + +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_carrier_pricelist/__manifest__.py b/delivery_carrier_pricelist/__manifest__.py index 12f9e8d0e4..3551f8575a 100644 --- a/delivery_carrier_pricelist/__manifest__.py +++ b/delivery_carrier_pricelist/__manifest__.py @@ -3,12 +3,12 @@ { "name": "Shipping Method Pricelist", "summary": "Compute method method fees based on the product's pricelist.", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "category": "Delivery", "website": "https://github.com/OCA/delivery-carrier", "author": "Camptocamp, Odoo Community Association (OCA)", "installable": True, "license": "AGPL-3", "depends": ["delivery"], - "data": [], + "data": ["security/ir.model.access.csv"], } diff --git a/delivery_carrier_pricelist/models/delivery_carrier.py b/delivery_carrier_pricelist/models/delivery_carrier.py index 8ed258d8a0..43d849f66e 100644 --- a/delivery_carrier_pricelist/models/delivery_carrier.py +++ b/delivery_carrier_pricelist/models/delivery_carrier.py @@ -17,10 +17,12 @@ class DeliveryCarrier(models.Model): _inherit = "delivery.carrier" delivery_type = fields.Selection( - selection_add=[("pricelist", "Based on Product Pricelist")] + selection_add=[("pricelist", "Based on Product Pricelist")], + ondelete={"pricelist": "set default"}, ) invoice_policy = fields.Selection( selection_add=[("pricelist", "Pricelist Cost")], + ondelete={"pricelist": "set default"}, help="Estimated Cost: the customer will be invoiced the estimated" " cost of the shipping.\n" "Real Cost: the customer will be invoiced the real cost of the" @@ -135,7 +137,7 @@ def _add_pricelist_domain( field.set("attrs", str(attrs)) modifiers = {} transfer_node_to_modifiers( - field, modifiers, self.env.context, in_tree_view=True + field, modifiers, self.env.context, current_node_path=["tree"] ) transfer_modifiers_to_node(modifiers, field) diff --git a/delivery_carrier_pricelist/readme/CONTRIBUTORS.rst b/delivery_carrier_pricelist/readme/CONTRIBUTORS.rst index 48286263cd..4937013f08 100644 --- a/delivery_carrier_pricelist/readme/CONTRIBUTORS.rst +++ b/delivery_carrier_pricelist/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Guewen Baconnier +* Phuc Tran Thanh diff --git a/delivery_carrier_pricelist/readme/CREDITS.rst b/delivery_carrier_pricelist/readme/CREDITS.rst new file mode 100644 index 0000000000..f5cc070c78 --- /dev/null +++ b/delivery_carrier_pricelist/readme/CREDITS.rst @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +* Camptocamp diff --git a/delivery_carrier_pricelist/security/ir.model.access.csv b/delivery_carrier_pricelist/security/ir.model.access.csv new file mode 100644 index 0000000000..03b377f596 --- /dev/null +++ b/delivery_carrier_pricelist/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_choose_delivery_carrier,choose.delivery.carrier.user,model_choose_delivery_carrier,stock.group_stock_user,1,1,1,1 diff --git a/delivery_carrier_pricelist/static/description/index.html b/delivery_carrier_pricelist/static/description/index.html new file mode 100644 index 0000000000..713671e349 --- /dev/null +++ b/delivery_carrier_pricelist/static/description/index.html @@ -0,0 +1,439 @@ + + + + + + +Shipping Method Pricelist + + + +
+

Shipping Method Pricelist

+ + +

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

+

Compute shipping methods fees based on Product Pricelists.

+

It allows to have different pricing per customer, prices depending on dates, … +The pricelist based cost is computed from the shipping method’s product and the +sales order’s pricelist.

+

It supports the following use cases:

+
    +
  • When no “external” provider (e.g. DHL, UPS, …) is used, a new provider +“Based on Product Pricelist” is available.
  • +
  • When an external provider is used, a new option in the “Invoice Policy” +selection, named “Pricelist Cost”, overrides the provider’s cost by the +pricelist based cost.
  • +
+

Table of contents

+ +
+

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

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+
    +
  • Camptocamp
  • +
+
+
+

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.

+
+
+
+ +