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

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