[FIX] project: task date_deadline not copied

Steps to reproduce:
- create a project and a task inside
- set date_deadline on the task
- copy the project
=> the copied task has date_deadline = False

Source:
- date_deadline copy property wasn't changed to True when the field
was merged with planned_date_end in 17.0

Fix:
- copy was removed as its default value is True

closes odoo/odoo#152006

X-original-commit: https://github.com/odoo/odoo/commit/56073896a69d9f68ce7e7938d9dec7ef094e19b3
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
Abderraouf Ghrissi (abgh)
2024-02-01 07:06:50 +00:00
parent cb0efa815d
commit 537a96d1aa
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ class Task(models.Model):
date_end = fields.Datetime(string='Ending Date', index=True, copy=False)
date_assign = fields.Datetime(string='Assigning Date', copy=False, readonly=True,
help="Date on which this task was last assigned (or unassigned). Based on this, you can get statistics on the time it usually takes to assign tasks.")
date_deadline = fields.Datetime(string='Deadline', index=True, copy=False, tracking=True)
date_deadline = fields.Datetime(string='Deadline', index=True, tracking=True)
date_last_stage_update = fields.Datetime(string='Last Stage Update',
index=True,
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from odoo.fields import Command
from odoo.fields import Command, Datetime
from odoo.exceptions import ValidationError
from odoo.tests import tagged
@@ -126,6 +126,7 @@ class TestTaskDependencies(TestProjectCommon):
def test_duplicate_project_with_task_dependencies(self):
self.project_pigs.allow_task_dependencies = True
self.task_1.depend_on_ids = self.task_2
self.task_1.date_deadline = Datetime.now()
pigs_copy = self.project_pigs.copy()
task1_copy = pigs_copy.task_ids.filtered(lambda t: t.name == 'Pigs UserTask')
@@ -136,6 +137,7 @@ class TestTaskDependencies(TestProjectCommon):
self.assertEqual(task1_copy.depend_on_ids.ids, [task2_copy.id],
"Copy should only create a relation between both copy if they are both part of the project")
self.assertEqual(task1_copy.date_deadline, self.task_1.date_deadline, "date_deadline should be copied")
task1_copy.depend_on_ids = self.task_1