diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-02-04 13:27:22 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-02-04 13:27:22 +0100 |
| commit | 4400cce8201579fc9769b5e2d33829b43bce82d9 (patch) | |
| tree | c507c7dca21bfb0c3bdca8ba57e63a6ab16f230c /addons/resource/models | |
| parent | ceb05489303dee728c3960a87bf23795efc374c4 (diff) | |
| parent | 4524ad06a8af82ab337fc5aa1d5aa8d8d3024923 (diff) | |
[MERGE] forward port branch saas-12.1 up to 4524ad06a8a
Diffstat (limited to 'addons/resource/models')
| -rw-r--r-- | addons/resource/models/resource.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/resource/models/resource.py b/addons/resource/models/resource.py index 55493728f13..6972025ae41 100644 --- a/addons/resource/models/resource.py +++ b/addons/resource/models/resource.py @@ -196,7 +196,8 @@ class ResourceCalendar(models.Model): hour_count = 0.0 for attendance in attendances: hour_count += attendance.hour_to - attendance.hour_from - self.hours_per_day = float_round(hour_count / float(len(set(attendances.mapped('dayofweek')))), precision_digits=2) + if attendances: + self.hours_per_day = float_round(hour_count / float(len(set(attendances.mapped('dayofweek')))), precision_digits=2) # -------------------------------------------------- # Computation API |
