[FIX] project_issue: new issue if create_date in view

The depends for an issue inactivity_days expects a set create_date but
this may not be the case (when creating the record for example with the
field create_date in the form view).

opw-702532
This commit is contained in:
Nicolas Lempereur
2016-12-23 10:58:42 +01:00
parent 3d777ad262
commit dd363f03da
+1 -1
View File
@@ -102,7 +102,7 @@ class ProjectIssue(models.Model):
def _compute_inactivity_days(self):
current_datetime = fields.Datetime.from_string(fields.Datetime.now())
for issue in self:
dt_create_date = fields.Datetime.from_string(issue.create_date)
dt_create_date = fields.Datetime.from_string(issue.create_date) or current_datetime
issue.days_since_creation = (current_datetime - dt_create_date).days
if issue.date_action_last: