From a63d883553f1c3d51ed5f564f5101067f0a1cb5a Mon Sep 17 00:00:00 2001 From: Pierrick Brun Date: Thu, 8 Jul 2021 16:58:53 +0200 Subject: [PATCH] [ADD] sale_automatic_workflow_delivery_state module --- .../README.rst | 69 +++ .../__init__.py | 1 + .../__manifest__.py | 14 + .../models/sale_order.py | 14 + .../pyproject.toml | 3 + .../readme/DESCRIPTION.rst | 2 + .../readme/ROADMAP.rst | 1 + .../static/description/index.html | 413 ++++++++++++++++++ 8 files changed, 517 insertions(+) create mode 100644 sale_automatic_workflow_delivery_state/README.rst create mode 100644 sale_automatic_workflow_delivery_state/__init__.py create mode 100644 sale_automatic_workflow_delivery_state/__manifest__.py create mode 100644 sale_automatic_workflow_delivery_state/models/sale_order.py create mode 100644 sale_automatic_workflow_delivery_state/pyproject.toml create mode 100644 sale_automatic_workflow_delivery_state/readme/DESCRIPTION.rst create mode 100644 sale_automatic_workflow_delivery_state/readme/ROADMAP.rst create mode 100644 sale_automatic_workflow_delivery_state/static/description/index.html diff --git a/sale_automatic_workflow_delivery_state/README.rst b/sale_automatic_workflow_delivery_state/README.rst new file mode 100644 index 000000000000..ab6445a77819 --- /dev/null +++ b/sale_automatic_workflow_delivery_state/README.rst @@ -0,0 +1,69 @@ +====================================== +Sale Automatic Workflow Delivery State +====================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fsale--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/sale-workflow/tree/14.0/sale_automatic_workflow_delivery_state + :alt: OCA/sale-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_automatic_workflow_delivery_state + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/167/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module make `sale_automatic_workflow`'s `all_qty_delivered` field be computed using +`delivery_state` field to avoid computing the same data twice. + +**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 +~~~~~~~ + +* Akretion + +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/sale-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_automatic_workflow_delivery_state/__init__.py b/sale_automatic_workflow_delivery_state/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/sale_automatic_workflow_delivery_state/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_automatic_workflow_delivery_state/__manifest__.py b/sale_automatic_workflow_delivery_state/__manifest__.py new file mode 100644 index 000000000000..5a7a819ffeaf --- /dev/null +++ b/sale_automatic_workflow_delivery_state/__manifest__.py @@ -0,0 +1,14 @@ +{ + "name": "Sale Automatic Workflow Delivery State", + "summary": "Glue module for sale_automatic_workflow and sale_delivery_state", + "version": "17.0.1.0.0", + "category": "Sales Management", + "website": "https://github.com/OCA/sale-workflow", + "author": "Akretion, Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": [ + "sale_automatic_workflow", + "sale_delivery_state", + ], + "auto_install": True, +} diff --git a/sale_automatic_workflow_delivery_state/models/sale_order.py b/sale_automatic_workflow_delivery_state/models/sale_order.py new file mode 100644 index 000000000000..5c10abe37d02 --- /dev/null +++ b/sale_automatic_workflow_delivery_state/models/sale_order.py @@ -0,0 +1,14 @@ +# Copyright 2021 Akretion (https://www.akretion.com). +# @author Pierrick Brun +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + @api.depends("delivery_state") + def _compute_all_qty_delivered(self): + for order in self: + order.all_qty_delivered = order.delivery_state == "done" diff --git a/sale_automatic_workflow_delivery_state/pyproject.toml b/sale_automatic_workflow_delivery_state/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/sale_automatic_workflow_delivery_state/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/sale_automatic_workflow_delivery_state/readme/DESCRIPTION.rst b/sale_automatic_workflow_delivery_state/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..b02d9ecacdea --- /dev/null +++ b/sale_automatic_workflow_delivery_state/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module make `sale_automatic_workflow`'s `all_qty_delivered` field be computed using +`delivery_state` field to avoid computing the same data twice. diff --git a/sale_automatic_workflow_delivery_state/readme/ROADMAP.rst b/sale_automatic_workflow_delivery_state/readme/ROADMAP.rst new file mode 100644 index 000000000000..99798b3d7d43 --- /dev/null +++ b/sale_automatic_workflow_delivery_state/readme/ROADMAP.rst @@ -0,0 +1 @@ +Remove it in v15 (and integrate it's change in sale_automatic_workflow) diff --git a/sale_automatic_workflow_delivery_state/static/description/index.html b/sale_automatic_workflow_delivery_state/static/description/index.html new file mode 100644 index 000000000000..7ca704d9c72d --- /dev/null +++ b/sale_automatic_workflow_delivery_state/static/description/index.html @@ -0,0 +1,413 @@ + + + + + + +Sale Automatic Workflow Delivery State + + + +
+

Sale Automatic Workflow Delivery State

+ + +

Beta License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runbot

+

This module make sale_automatic_workflow’s all_qty_delivered field be computed using +delivery_state field to avoid computing the same data twice.

+

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

+
    +
  • Akretion
  • +
+
+
+

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/sale-workflow project on GitHub.

+

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

+
+
+
+ +