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
757 B

4 years ago
4 years ago
  1. # Copyright 2019 Coop IT Easy SCRLfs
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import 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 (
  14. self.env["res.partner"]
  15. .browse(self._context.get("active_id"))
  16. .info_session_confirmed
  17. )
  18. return followed
  19. info_session = fields.Boolean(default=_get_info_session_followed)