Skip to content

Commit

Permalink
[IMP] use Datetime.to_datetime instead of deprecated Datetime.from_st…
Browse files Browse the repository at this point in the history
…ring
  • Loading branch information
mathben committed Jan 23, 2020
1 parent 7265453 commit ec98574
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions project_agile_analytic/models/analytic_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ class ProjectAnalyticLine(models.Model):
@api.multi
def _compute_duration(self):
for record in self:
s = fields.Datetime.from_string(record.start_date)
s = fields.Datetime.to_datetime(record.start_date)
e = (
record.end_date
and fields.Datetime.from_string(record.end_date)
and fields.Datetime.to_datetime(record.end_date)
or datetime.now()
)

Expand Down
4 changes: 2 additions & 2 deletions project_agile_scrum/models/project_agile_scrum_sprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def _compute_length_week(self):
def _compute_length_days(self):
for rec in self:
if rec.start_date and rec.end_date:
end_date = fields.Date.from_string(rec.end_date)
start_date = fields.Date.from_string(rec.start_date)
end_date = fields.Date.to_date(rec.end_date)
start_date = fields.Date.to_date(rec.start_date)
rec.sprint_length_days = (end_date - start_date).days
else:
rec.sprint_length_days = 0
Expand Down

0 comments on commit ec98574

Please sign in to comment.