【发布时间】:2021-01-07 17:56:56
【问题描述】:
我在 xml 文件中有一个 customer_type 选择字段,但我需要根据条件隐藏 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'
【问题讨论】: