mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[ADD] base_exception_user,sale_exception_user,stock_exception: allow certain users to ignore exceptions, add exceptions on delivery orders
This commit is contained in:
25
stock_exception/wizard/stock_exception_confirm.py
Normal file
25
stock_exception/wizard/stock_exception_confirm.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class StockExceptionConfirm(models.TransientModel):
|
||||
_name = 'stock.exception.confirm'
|
||||
_inherit = ['exception.rule.confirm']
|
||||
|
||||
related_model_id = fields.Many2one('stock.picking', 'Transfer')
|
||||
|
||||
def action_confirm(self):
|
||||
self.ensure_one()
|
||||
if self.ignore:
|
||||
self.related_model_id.ignore_exception = True
|
||||
res = super().action_confirm()
|
||||
if self.ignore:
|
||||
return self.related_model_id.button_validate()
|
||||
else:
|
||||
return res
|
||||
|
||||
def _action_ignore(self):
|
||||
self.related_model_id.ignore_exception = True
|
||||
super()._action_ignore()
|
||||
return self.related_model_id.button_validate()
|
||||
Reference in New Issue
Block a user