diff --git a/setup/stock_request_cancel_confirm/odoo/addons/stock_request_cancel_confirm b/setup/stock_request_cancel_confirm/odoo/addons/stock_request_cancel_confirm new file mode 120000 index 000000000..3ed2bc61d --- /dev/null +++ b/setup/stock_request_cancel_confirm/odoo/addons/stock_request_cancel_confirm @@ -0,0 +1 @@ +../../../../stock_request_cancel_confirm \ No newline at end of file diff --git a/setup/stock_request_cancel_confirm/setup.py b/setup/stock_request_cancel_confirm/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/stock_request_cancel_confirm/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_request_cancel_confirm/__init__.py b/stock_request_cancel_confirm/__init__.py new file mode 100644 index 000000000..02c244eef --- /dev/null +++ b/stock_request_cancel_confirm/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import model diff --git a/stock_request_cancel_confirm/__manifest__.py b/stock_request_cancel_confirm/__manifest__.py new file mode 100644 index 000000000..061919017 --- /dev/null +++ b/stock_request_cancel_confirm/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Stock Request Cancel Confirm", + "version": "14.0.1.0.0", + "author": "Ecosoft,Odoo Community Association (OCA)", + "category": "Usability", + "license": "AGPL-3", + "website": "https://github.com/OCA/stock-logistics-warehouse", + "depends": ["base_cancel_confirm", "stock_request"], + "auto_install": False, + "installable": True, + "maintainers": ["kittiu"], +} diff --git a/stock_request_cancel_confirm/model/__init__.py b/stock_request_cancel_confirm/model/__init__.py new file mode 100644 index 000000000..db4eeacea --- /dev/null +++ b/stock_request_cancel_confirm/model/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import stock_request +from . import stock_request_order diff --git a/stock_request_cancel_confirm/model/stock_request.py b/stock_request_cancel_confirm/model/stock_request.py new file mode 100644 index 000000000..e95e117c7 --- /dev/null +++ b/stock_request_cancel_confirm/model/stock_request.py @@ -0,0 +1,19 @@ +# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import models + + +class StockRequest(models.Model): + _name = "stock.request" + _inherit = ["stock.request", "base.cancel.confirm"] + + _has_cancel_reason = "optional" # ["no", "optional", "required"] + + def action_cancel(self): + if not self.filtered("cancel_confirm"): + return self.open_cancel_confirm_wizard() + return super().action_cancel() + + def action_draft(self): + self.clear_cancel_confirm_data() + return super().action_draft() diff --git a/stock_request_cancel_confirm/model/stock_request_order.py b/stock_request_cancel_confirm/model/stock_request_order.py new file mode 100644 index 000000000..489ddb579 --- /dev/null +++ b/stock_request_cancel_confirm/model/stock_request_order.py @@ -0,0 +1,19 @@ +# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import models + + +class StockRequestOrder(models.Model): + _name = "stock.request.order" + _inherit = ["stock.request.order", "base.cancel.confirm"] + + _has_cancel_reason = "optional" # ["no", "optional", "required"] + + def action_cancel(self): + if not self.filtered("cancel_confirm"): + return self.open_cancel_confirm_wizard() + return super().action_cancel() + + def action_draft(self): + self.clear_cancel_confirm_data() + return super().action_draft() diff --git a/stock_request_cancel_confirm/readme/CONTRIBUTORS.rst b/stock_request_cancel_confirm/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..6ce956d96 --- /dev/null +++ b/stock_request_cancel_confirm/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Kitti U. diff --git a/stock_request_cancel_confirm/readme/DESCRIPTION.rst b/stock_request_cancel_confirm/readme/DESCRIPTION.rst new file mode 100644 index 000000000..7ffe981b9 --- /dev/null +++ b/stock_request_cancel_confirm/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +When user click to cancel stock request or stock request order, a confirmation wizard will be show, with reason as optional. diff --git a/stock_request_cancel_confirm/static/description/icon.png b/stock_request_cancel_confirm/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/stock_request_cancel_confirm/static/description/icon.png differ diff --git a/stock_request_cancel_confirm/static/description/index.html b/stock_request_cancel_confirm/static/description/index.html new file mode 100644 index 000000000..b8d2ded74 --- /dev/null +++ b/stock_request_cancel_confirm/static/description/index.html @@ -0,0 +1,435 @@ + + + + + + +Sale Cancel Reason + + + +
+

Sale Cancel Reason

+ + +

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

+

When a sale order is canceled, a reason must be given, +it is chosen from a configured list.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  • Click at “Cancel Order” button from a sales order which state equal +to Draft, Quotation or Sales Order
  • +
  • A wizard will show a list of cancel reasons
  • +
  • Choose a reason and confirm cancellation, the reason will be stamped in the sales order
  • +
+
+
+

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

+ +
+
+

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.

+
+
+
+ +