You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
691 B

  1. # -*- coding: utf-8 -*-
  2. from openerp import models, fields, api, _
  3. class Subscribe(models.TransientModel):
  4. _name = 'beesdoo.shift.holiday'
  5. _inherit = 'beesdoo.shift.action_mixin'
  6. holiday_start_day = fields.Date(string="Start date for the holiday", default=fields.Date.today)
  7. holiday_end_day = fields.Date(string="End date for the holiday (included)")
  8. @api.multi
  9. def holidays(self):
  10. self = self._check() #maybe a different group
  11. status_id = self.env['cooperative.status'].search([('cooperator_id', '=', self.cooperator_id.id)])
  12. status_id.sudo().write({'holiday_start_time': self.holiday_start_day, 'holiday_end_time': self.holiday_end_day})