| 1 | from odoo import api, models |
| 2 | |
| 3 | |
| 4 | class ResourceCalendarAttendance(models.Model): |
| 5 | _name = 'resource.calendar.attendance' |
| 6 | _inherit = ['resource.calendar.attendance', 'pos.load.mixin'] |
| 7 | |
| 8 | @api.model |
| 9 | def _load_pos_data_domain(self, data, config): |
| 10 | attendance_ids = [] |
| 11 | for preset in data['pos.preset']: |
| 12 | attendance_ids += preset['attendance_ids'] |
| 13 | return [('id', 'in', attendance_ids)] |
| 14 | |
| 15 | @api.model |
| 16 | def _load_pos_data_fields(self, config): |
| 17 | return ['id', 'hour_from', 'hour_to', 'dayofweek', 'day_period'] |