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.

19 lines
566 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)
  11. @api.model
  12. def get_names_order(self):
  13. """Allow POS frontend to retrieve 'partner_names_order'"""
  14. return self._get_names_order()