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.

24 lines
745 B

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