我无法过滤有关one2Many_list代码的信息:
<field name="supplies" widget="one2many_list">
<tree>
<field name="product_id" string="Product"/>
<field name="supplies_category" string="Category"/>
</tree>
型号:
class printer_service_supplies(models.Model):
_name = 'printer.service.supplies'
product_id = fields.Many2one('product.template')
supplies_category = fields.Many2one('printer.service.supplies.category')
我已经尝试了,
<field name="supplies" widget="one2many_list" context="'supplies_category': 'Ink' }">
或
<field name="supplies" widget="one2many_list" context="{'supplies_category': 1 }">
和
<field name="supplies" widget="one2many_list" domain="
[('supplies_category','=','Ink')]">
或
<field name="supplies" widget="one2many_list" domain="
[('supplies_category','=',1)]">