[FIX] webiste_event_track: fix track creation
As date is not required, trying to make a new date from it crashes. Let us set value to False to ensure always having a value (new ORM computed yay) and avoir crash (woop woop). Spotted in task ID 2075183 (sms on speakers). PR #37185
This commit is contained in:
@@ -111,8 +111,11 @@ class Track(models.Model):
|
||||
@api.depends('date', 'duration')
|
||||
def _compute_end_date(self):
|
||||
for track in self:
|
||||
delta = timedelta(minutes=60 * track.duration)
|
||||
track.date_end = track.date + delta
|
||||
if track.date:
|
||||
delta = timedelta(minutes=60 * track.duration)
|
||||
track.date_end = track.date + delta
|
||||
else:
|
||||
track.date_end = False
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
|
||||
Reference in New Issue
Block a user