[FIX] resource: prevent error when deleting resource.calendar records

Attendance entries should be cascade-deleted along with the parent
record.

Closes #10310
Closes #13044
This commit is contained in:
David Beal 2016-08-05 15:09:51 +02:00 committed by Olivier Dony
parent 85b34f4be3
commit e773c1dce8
No known key found for this signature in database
GPG Key ID: CD556E25E8A6D0D4
1 changed files with 1 additions and 1 deletions

View File

@ -645,7 +645,7 @@ class resource_calendar_attendance(osv.osv):
'date_from' : fields.date('Starting Date'),
'hour_from' : fields.float('Work from', required=True, help="Start and End time of working.", select=True),
'hour_to' : fields.float("Work to", required=True),
'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True),
'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True, ondelete='cascade'),
}
_order = 'dayofweek, hour_from'