Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
20
account_move_cancel_confirm/model/account_payment.py
Normal file
20
account_move_cancel_confirm/model/account_payment.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright 2021 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 AccountPayment(models.Model):
|
||||
_name = "account.payment"
|
||||
_inherit = ["account.payment", "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()
|
||||
Reference in New Issue
Block a user