From dc23365048469b91fb5d20f64df14451e6170c32 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 20 Nov 2018 15:31:28 +0000 Subject: [PATCH] [FIX] calendar: detaching event makes recurring attributes irrelevant Have a recurring meeting, repeated until some date Edit one of the instances and detach it (click on "update only this instance") Edit the detached event and change some value Save Before this commit, a JS error was thrown saying that the field final_date was invalid This was because the required attribute on this field was set to True, but the python put the value of the final_date to False After this commit, there is no error as we set this value to false, since the field doesn't make sense for a non-recurring event anyway OPW 1892426 closes odoo/odoo#28850 --- addons/calendar/models/calendar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index 53eb5e867ea..0108a3ddd5d 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -1371,7 +1371,8 @@ class Meeting(models.Model): rrule_type=False, rrule='', recurrency=False, - final_date=datetime.strptime(data.get('start'), DEFAULT_SERVER_DATETIME_FORMAT if data['allday'] else DEFAULT_SERVER_DATETIME_FORMAT) + timedelta(hours=values.get('duration', False) or data.get('duration')) + final_date=False, + end_type=False ) # do not copy the id