Skip to content

Commit

Permalink
[MIG] delivery_carrier_pricelist: Migration to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
phuctranfxvn committed Feb 7, 2021
1 parent 7628e06 commit 3db1e8a
Show file tree
Hide file tree
Showing 7 changed files with 544 additions and 4 deletions.
93 changes: 93 additions & 0 deletions delivery_carrier_pricelist/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/delivery-carrier/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 <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20delivery_carrier_pricelist%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Camptocamp

Contributors
~~~~~~~~~~~~

* Guewen Baconnier <[email protected]>
* Phuc Tran Thanh <[email protected]>

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 <https://github.com/OCA/delivery-carrier/tree/14.0/delivery_carrier_pricelist>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions delivery_carrier_pricelist/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
}
6 changes: 4 additions & 2 deletions delivery_carrier_pricelist/models/delivery_carrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions delivery_carrier_pricelist/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Guewen Baconnier <[email protected]>
* Phuc Tran Thanh <[email protected]>
3 changes: 3 additions & 0 deletions delivery_carrier_pricelist/readme/CREDITS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The development of this module has been financially supported by:

* Camptocamp
2 changes: 2 additions & 0 deletions delivery_carrier_pricelist/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 3db1e8a

Please sign in to comment.