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
734 B

  1. # coding: utf-8
  2. # Copyright (C) 2018 - Today: GRAP (http://www.grap.coop)
  3. # @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. from openerp import api, models
  6. class ResPartner(models.Model):
  7. _inherit = 'res.partner'
  8. @api.model
  9. def create_from_ui(self, partner):
  10. if 'property_product_pricelist' in partner:
  11. pricelist_id_str = partner.get('property_product_pricelist')
  12. if pricelist_id_str:
  13. partner['property_product_pricelist'] = int(pricelist_id_str)
  14. else:
  15. partner['property_product_pricelist'] = False
  16. return super(ResPartner, self).create_from_ui(partner)