How to conditionally hide rows in One2Many field tree in a form view?

Viewed 31

I have a form view, which contains a tab in notebook page. The models are customized.

This is the example code.

<page string="Pack">
     <field name="packing_quantity">
         <tree create="false" editable="bottom">
             <field name="ps" invisible="1"/>
             <field name="product"/>
             <field name="pack"/>
             <field name="pack_qty"/>
         </tree>
     </field>
 </page>

The One2Many field packing_quantity is displayed as a tree within the form view. However, I need to filter/hide some records conditionally. The condition is to display only the ones that have pack_qty > 0.

I tried putting domain in the packing_quantity field and the tree. It does not work.

Field Domain not working

I searched for this particular issue all over, but only found the solution using action window's domain, which in this case I cannot use since it is in a form view.

0 Answers
Related