2

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.

holydragon
  • 6,158
  • 6
  • 39
  • 62
  • 1
    I haven't tried it in newer versions, but in older versions there was no problem putting a domain on the field definition to filter out entries. Can you share your not working code (field with domain)? – CZoellner Dec 08 '21 at 08:48
  • @CZoellner I edited the question to add the image of my attempt. – holydragon Dec 08 '21 at 08:58
  • Hm okay, probably Odoo really changed something. Sorry but i have no time to evaluate that :-( – CZoellner Dec 08 '21 at 09:47

0 Answers0