project task issue fix and changes
This commit is contained in:
parent
6a32ac3f37
commit
74526cc1a2
|
|
@ -7,7 +7,6 @@ class AccountAnalyticLine(models.Model):
|
|||
|
||||
@api.constrains('unit_amount')
|
||||
def _check_unit_amount(self):
|
||||
print("🔥 TIMESHEET VALIDATION TRIGGERED")
|
||||
for rec in self:
|
||||
if rec.unit_amount < 0:
|
||||
raise ValidationError("Hours cannot be negative")
|
||||
|
|
@ -120,7 +120,6 @@ class projectTask(models.Model):
|
|||
|
||||
@api.constrains('date_deadline')
|
||||
def _check_date_deadline(self):
|
||||
print("🔥🔥 DEADLINE CONSTRAINT WORKING 🔥🔥")
|
||||
now = fields.Datetime.now()
|
||||
for rec in self:
|
||||
if rec.date_deadline and rec.date_deadline < now:
|
||||
|
|
@ -956,7 +955,7 @@ class projectTask(models.Model):
|
|||
'use_date_range': False,
|
||||
'prefix': f"{project.sequence_name}/TASK-",
|
||||
})
|
||||
project.task_sequence_id = task_sequence
|
||||
project.sudo().task_sequence_id = task_sequence
|
||||
|
||||
# Assign sequence numbers to tasks
|
||||
for task in tasks:
|
||||
|
|
|
|||
Loading…
Reference in New Issue