Andrywin Maquinto
Instead of add the key, value
in the field try to add with the method.
customer_type = fields.Selection(selection="_get_customer_type", string="Customer Type")
def _get_customer_type(self):
if self: # your codnition to check
return [('cash_customer', 'Cash Customer'), ('credit_customer', 'Credit Customer'),
('cash_customer_vendor', 'Cash Customer and Vendor'),
('credit_customer_vendor', 'Credit Customer and Vendor')]
else:
return [('cash_customer', 'Cash Customer'), ('credit_customer', 'Credit Customer')]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…