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.

20 lines
632 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2018 Tecnativa - Jairo Llopis
  3. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
  4. from odoo import api, models
  5. class ResPartner(models.Model):
  6. _inherit = "res.partner"
  7. @api.model
  8. def create_from_ui(self, partner):
  9. try:
  10. # If there's an incoming pricelist, it must be an int
  11. partner["property_product_pricelist"] = \
  12. int(partner["property_product_pricelist"])
  13. except KeyError:
  14. # There's no incoming pricelist, no problem
  15. pass
  16. return super(ResPartner, self).create_from_ui(partner)