From dd363f03dacf1fd98205d137cc105efb3beac520 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 22 Dec 2016 17:28:18 +0100 Subject: [PATCH] [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 --- addons/project_issue/models/project_issue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project_issue/models/project_issue.py b/addons/project_issue/models/project_issue.py index ce310dedb9a..2b61094cd30 100644 --- a/addons/project_issue/models/project_issue.py +++ b/addons/project_issue/models/project_issue.py @@ -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: