我在xml文件中有一个customer_类型选择字段,但我需要根据条件隐藏4个选择中的2个
到目前为止,这是我用python编写的代码
res_partner.py
customer_type = fields.Selection([
('cash_customer','Cash Customer'),
('credit_customer','Credit Customer'),
('cash_customer_vendor','Cash Customer and Vendor'),
('credit_customer_vendor','Credit Customer and Vendor')],
string="Customer Type" )
res_partner.xml
<field name="customer_type"
attrs="{'required':
[('customer_tick', '=', True)],
'invisible': [('customer_tick', '!=', True)]}"/>
我的情况是
vendor_state = 'vendor'
安德里温·马昆托
不要在字段中添加
key, value
,而是尝试使用该方法添加相关问题 更多 >
编程相关推荐