Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3708 Vizualizări

I would like to create a conditional field in the Inventory app where if certain documents aren't present the validate button would be invisible until those documents are uploaded. 

So far, the code we've written only executes the delivery order section. I would like to find out how to write a conditional statement that would be specific to the relevant operation type.


Here's  a look at the code written:

<data>
<xpath expr="//button[@name='do_new_transfer'][1]" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('x_GRN', '=',False), '|',('x_supporting_waybill', '=',False), '|',('x_supplier_invoice', '=',False), '|',('x_LPO', '=',False), '|',('picking_type_code','!=','incoming'), '|',('state', 'not in', ('assigned', 'partially_available'))]}</attribute>
<attribute name="attrs">{'invisible': ['|', ('x_ATS', '=',False), '|',('picking_type_code','!=','internal'), '|',('state', 'not in', ('assigned', 'partially_available'))]}</attribute>
<attribute name="attrs">{'invisible': ['|', ('x_delivery_note', '=',False), '|',('picking_type_code','!=','outgoing'), '|',('state', 'not in', ('assigned', 'partially_available'))]}</attribute>
</xpath>
</data>


is this correct what do I need to do to fix it




Imagine profil
Abandonează
Cel mai bun răspuns

<field name="field name" attrs="{'invisible': [(field name ', '=', False)]}"/>

You can try this just replace field name with your field and change the condition based on your requirements . this will work.

Thanks.

Imagine profil
Abandonează