mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] project_exception: check for 'project_id' in vals
H11045
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||||
|
|
||||||
from odoo import api, models, fields
|
from odoo import api, models, fields, _
|
||||||
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
class ExceptionRule(models.Model):
|
class ExceptionRule(models.Model):
|
||||||
@@ -41,11 +42,13 @@ class Task(models.Model):
|
|||||||
return 'task_ids'
|
return 'task_ids'
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if not vals.get('ignore_exception'):
|
if not vals.get('ignore_exception') and 'stage_id' in vals and 'project_id' not in vals:
|
||||||
for task in self:
|
for task in self:
|
||||||
if task.detect_exceptions():
|
if task.detect_exceptions():
|
||||||
return self._popup_exceptions()
|
raise UserError(_('Exceptions were detected.'))
|
||||||
return super().write(vals)
|
res = super().write(vals)
|
||||||
|
self.detect_exceptions()
|
||||||
|
return res
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _get_popup_action(self):
|
def _get_popup_action(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user