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.

14 lines
413 B

  1. # Copyright 2019 Roberto Fichera
  2. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  3. from odoo import api, models
  4. class ResPartner(models.Model):
  5. _inherit = 'res.partner'
  6. @api.model
  7. def create_from_ui(self, partner):
  8. if 'is_company' in partner:
  9. partner['is_company'] = partner['is_company'] == 'true'
  10. return super(ResPartner, self).create_from_ui(partner)