Skip to content

Commit

Permalink
[14.0][ADD] purchase_request_cancel_confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
kittiu committed Jul 8, 2021
1 parent a493989 commit f12b37c
Show file tree
Hide file tree
Showing 12 changed files with 535 additions and 0 deletions.
4 changes: 4 additions & 0 deletions purchase_request_cancel_confirm/__init__.py
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions purchase_request_cancel_confirm/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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": "Purchase 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/purchase-workflow",
"depends": ["base_cancel_confirm", "purchase_request"],
"auto_install": False,
"installable": True,
"maintainers": ["kittiu"],
}
4 changes: 4 additions & 0 deletions purchase_request_cancel_confirm/model/__init__.py
Original file line number Diff line number Diff line change
@@ -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 purchase_request
19 changes: 19 additions & 0 deletions purchase_request_cancel_confirm/model/purchase_request.py
Original file line number Diff line number Diff line change
@@ -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 PurchaseRequest(models.Model):
_name = "purchase.request"
_inherit = ["purchase.request", "base.cancel.confirm"]

_has_cancel_reason = "optional" # ["no", "optional", "required"]

def button_rejected(self):
if not self.filtered("cancel_confirm"):
return self.open_cancel_confirm_wizard()
return super().button_rejected()

def button_draft(self):
self.clear_cancel_confirm_data()
return super().button_draft()
1 change: 1 addition & 0 deletions purchase_request_cancel_confirm/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Kitti U. <[email protected]>
1 change: 1 addition & 0 deletions purchase_request_cancel_confirm/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When user click to cancel purchase request, a confirmation wizard will be show, with reason as optional.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f12b37c

Please sign in to comment.