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.

25 lines
772 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2019 Coop IT Easy SCRLfs
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from openerp import api, fields, models, _
  5. class Subscribe(models.TransientModel):
  6. _inherit = 'beesdoo.shift.subscribe'
  7. def _get_info_session_followed(self):
  8. """
  9. Check if the user has checked the info_session_confirmed in the
  10. form to become new cooperator.
  11. """
  12. followed = super(Subscribe, self)._get_info_session_followed()
  13. if not followed:
  14. return (self.env['res.partner']
  15. .browse(self._context.get('active_id'))
  16. .info_session_confirmed)
  17. return followed
  18. info_session = fields.Boolean(default=_get_info_session_followed)