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.

26 lines
880 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 SubscriptionRequest(models.Model):
  5. _inherit = 'subscription.request'
  6. info_session_confirmed = fields.Boolean(
  7. string="Confirmed Info Session",
  8. default=False,
  9. )
  10. def get_partner_vals(self):
  11. partner_vals = super(SubscriptionRequest, self).get_partner_vals()
  12. partner_vals['info_session_confirmed'] = self.info_session_confirmed
  13. return partner_vals
  14. def get_required_field(self):
  15. required_fields = super(SubscriptionRequest, self).get_required_field()
  16. company = self.env['res.company']._company_default_get()
  17. if company.info_session_confirmation_required:
  18. required_fields.append('info_session_confirmed')
  19. return required_fields