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.

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