diff --git a/sale_order_auto_carrier/README.rst b/sale_order_auto_carrier/README.rst new file mode 100644 index 00000000..86a69bf0 --- /dev/null +++ b/sale_order_auto_carrier/README.rst @@ -0,0 +1,64 @@ +========================= +Partner Automatic Carrier +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:e6277d1efbd13b1fc76e2f38456be6d7616c807b91f162e748cb20ed5657d80d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-coopiteasy%2Faddons-lightgray.png?logo=github + :target: https://github.com/coopiteasy/addons/tree/16.0/sale_order_auto_carrier + :alt: coopiteasy/addons + +|badge1| |badge2| |badge3| + +This modules computes delivery cost on sale order confirmation. Unlike sale_order_carrier_auto_assign, it is not only based on the carrier defined on the partner. Instead it runs the automated carrier assignment defined in website_sale_delivery. This allows to add carrier based on carrier's configuration. In case several delivery methods fit the sale order, the first one in sequence order is used. + +This module is useful to add delivery costs on sale order that are automatically created by contracts. In order for this to work with contract-generated sale orders, contract should be configured as "Sale Autoconfirm". + +**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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Coop IT Easy SC + +Contributors +~~~~~~~~~~~~ + +* `Coop IT Easy SC `_: + + * Victor Champonnois + +Maintainers +~~~~~~~~~~~ + +This module is part of the `coopiteasy/addons `_ project on GitHub. + +You are welcome to contribute. diff --git a/sale_order_auto_carrier/__init__.py b/sale_order_auto_carrier/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/sale_order_auto_carrier/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_order_auto_carrier/__manifest__.py b/sale_order_auto_carrier/__manifest__.py new file mode 100644 index 00000000..9105de5b --- /dev/null +++ b/sale_order_auto_carrier/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2021 Coop IT Easy SC +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Partner Automatic Carrier", + "summary": "Compute automatically the carrier associated with a partner's adress", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "Coop IT Easy SC", + "website": "https://github.com/coopiteasy/addons", + "depends": [ + "website_sale_delivery", + ], + "demo": [], +} diff --git a/sale_order_auto_carrier/models/__init__.py b/sale_order_auto_carrier/models/__init__.py new file mode 100644 index 00000000..6aacb753 --- /dev/null +++ b/sale_order_auto_carrier/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order diff --git a/sale_order_auto_carrier/models/sale_order.py b/sale_order_auto_carrier/models/sale_order.py new file mode 100644 index 00000000..25065cc8 --- /dev/null +++ b/sale_order_auto_carrier/models/sale_order.py @@ -0,0 +1,12 @@ +# Copyright 2021 Coop IT Easy SC +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class SalePartner(models.Model): + _inherit = "sale.order" + + def action_confirm(self): + self._check_carrier_quotation() + return super().action_confirm() diff --git a/sale_order_auto_carrier/readme/CONTRIBUTORS.rst b/sale_order_auto_carrier/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..146abeb9 --- /dev/null +++ b/sale_order_auto_carrier/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Coop IT Easy SC `_: + + * Victor Champonnois diff --git a/sale_order_auto_carrier/readme/DESCRIPTION.rst b/sale_order_auto_carrier/readme/DESCRIPTION.rst new file mode 100644 index 00000000..f3ced7d0 --- /dev/null +++ b/sale_order_auto_carrier/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This modules computes delivery cost on sale order confirmation. Unlike sale_order_carrier_auto_assign, it is not only based on the carrier defined on the partner. Instead it runs the automated carrier assignment defined in website_sale_delivery. This allows to add carrier based on carrier's configuration. In case several delivery methods fit the sale order, the first one in sequence order is used. + +This module is useful to add delivery costs on sale order that are automatically created by contracts. In order for this to work with contract-generated sale orders, contract should be configured as "Sale Autoconfirm". diff --git a/sale_order_auto_carrier/static/description/index.html b/sale_order_auto_carrier/static/description/index.html new file mode 100644 index 00000000..69c2cb6a --- /dev/null +++ b/sale_order_auto_carrier/static/description/index.html @@ -0,0 +1,419 @@ + + + + + +Partner Automatic Carrier + + + +
+

Partner Automatic Carrier

+ + +

Beta License: AGPL-3 coopiteasy/addons

+

This modules computes delivery cost on sale order confirmation. Unlike sale_order_carrier_auto_assign, it is not only based on the carrier defined on the partner. Instead it runs the automated carrier assignment defined in website_sale_delivery. This allows to add carrier based on carrier’s configuration. In case several delivery methods fit the sale order, the first one in sequence order is used.

+

This module is useful to add delivery costs on sale order that are automatically created by contracts. In order for this to work with contract-generated sale orders, contract should be configured as “Sale Autoconfirm”.

+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Coop IT Easy SC
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the coopiteasy/addons project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/setup/sale_order_auto_carrier/odoo/addons/sale_order_auto_carrier b/setup/sale_order_auto_carrier/odoo/addons/sale_order_auto_carrier new file mode 120000 index 00000000..1f4c9256 --- /dev/null +++ b/setup/sale_order_auto_carrier/odoo/addons/sale_order_auto_carrier @@ -0,0 +1 @@ +../../../../sale_order_auto_carrier \ No newline at end of file diff --git a/setup/sale_order_auto_carrier/setup.py b/setup/sale_order_auto_carrier/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/sale_order_auto_carrier/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)