0
我在odoo10中有一个选择字段和另一个many2one字段。我希望当我从选择类型字段中只选择“服务”,然后在窗体视图中显示另一个many2one字段。在这里我附上我的python和xml代码。仅当特定字段被选中时字段的可见性
Python代码: -
service_types = fields.Selection([('product', ('Product')),('service', ('Service'))], string='Services', required=True),
name_rental = fields.Many2one('rental.pet', string="Rental Management")
XML代码: -
<field name="service_types"/>
<field name="name_rental" attrs="{'invisible': [('service_types', '!=', 'service')]}"/>
看起来像应该对我有用。你看到什么问题? – alexbclay
是的,它的工作,但你能告诉我,如何选择'服务'选项时如何显示完整的表单(rental.pet)在向导中。 –