Files
stock-logistics-warehouse/stock_picking_cancel_confirm/models/stock_picking.py
2021-06-16 01:10:24 +07:00

16 lines
512 B
Python

# 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 StockPicking(models.Model):
_name = "stock.picking"
_inherit = ["stock.picking", "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()