mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[ADD] timesheet_exception: timesheet created should not exceed 8 in spent hours
H11047
This commit is contained in:
26
timesheet_exception/wizard/timesheet_exception_confirm.py
Normal file
26
timesheet_exception/wizard/timesheet_exception_confirm.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class TimesheetExceptionConfirm(models.TransientModel):
|
||||
_name = 'timesheet.exception.confirm'
|
||||
_inherit = ['exception.rule.confirm']
|
||||
_description = 'Timesheet Exception Confirm Wizard'
|
||||
|
||||
related_model_id = fields.Many2one('account.analytic.line', 'AnalyticLine')
|
||||
|
||||
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 True
|
||||
else:
|
||||
return res
|
||||
|
||||
def _action_ignore(self):
|
||||
self.related_model_id.ignore_exception = True
|
||||
super()._action_ignore()
|
||||
return True
|
||||
Reference in New Issue
Block a user