[FIX] calendar: edition of events duration

In event not during all day, it looks like
`start_date` could be defined, but `stop_date` not.

Despite the fact this is not such a normal state, this should
not prevent the save of the event with the
`_check_closing_date` constraint, checking that the ending
date is after the starting date
(in the case of an event not during the whole day,
this is ensured with the `start_datetime` and the
`stop_datetime`

opw-676245
This commit is contained in:
Denis Ledoux
2016-05-10 14:44:02 +02:00
parent 28a9336ac8
commit 77cb5f0ee0
+2 -2
View File
@@ -961,9 +961,9 @@ class calendar_event(osv.Model):
def _check_closing_date(self, cr, uid, ids, context=None):
for event in self.browse(cr, uid, ids, context=context):
if event.start_datetime and event.stop_datetime < event.start_datetime:
if event.start_datetime and event.stop_datetime and event.stop_datetime < event.start_datetime:
return False
if event.start_date and event.stop_date < event.start_date:
if event.start_date and event.stop_date and event.stop_date < event.start_date:
return False
return True