Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odgovori
17701 Prikazi

Hi,

I want to make the page 'Invoice lines' invisible when state is different than draft. I tried this :

<page string="Invoice Lines" position="attributes">                       

    <attribute name='invisible'>[('state','!=','draft')]</attribute>                    

</page>

but it didn't work , can anyone help me please

Avatar
Opusti
Best Answer

You just replace that page with following :


<page string="Invoice Lines" attrs ="{'invisible':[('state','!=', 'draft')]}">

Avatar
Opusti
Best Answer

You can hide this page using following code


<xpath expr="//page[@string='Invoice Lines']" position="attributes">                   

     <attribute name="attrs">{'invisible': [('state','!=','draft')]}</attribute>               

</xpath>


Avatar
Opusti
Best Answer

try with domain filter,

<field name="domain">[('state', '!=', 'draft')]</field>

<field name="arch" type="xml">

    <xpath expr="//page[@string='Invoice Lines']" position="replace">

        <!-- nothing here-->

    </xpath>


    <!-- OR -->

    <xpath expr="//page[@string='Invoice Lines']" position="attributes">

        <attribute name="invisible">True</attribute>

    </xpath>

</field>

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
3
apr. 23
4544
2
avg. 19
4508
2
mar. 24
22192
0
apr. 24
30
1
mar. 15
5262