[IMP] project: Do not set date_assign in default get

Currently when calling default_get (example: Create a new task), if a user is set on the new task, the assign date is automatically set at now()

It seems wrong for 2 reasons:
- It's alreay done either in write or create
- If the user creates a new task, but removes himself from the `Assigned to` field, the assignation date is still set, which is wrong.
This commit is contained in:
Yannick Tivisse
2017-08-07 11:25:01 +02:00
parent 0493edcb87
commit 9a63d01aaf
-8
View File
@@ -320,14 +320,6 @@ class Task(models.Model):
_mail_post_access = 'read'
_order = "priority desc, sequence, date_start, name, id"
@api.model
def default_get(self, field_list):
""" Set 'date_assign' if user_id is set. """
result = super(Task, self).default_get(field_list)
if 'user_id' in result:
result['date_assign'] = fields.Datetime.now()
return result
def _get_default_partner(self):
if 'default_project_id' in self.env.context:
default_project_id = self.env['project.project'].browse(self.env.context['default_project_id'])