Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
17674 Zobrazení

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
Zrušit
Nejlepší odpověď

You just replace that page with following :


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

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
dub 23
4525
2
srp 19
4482
2
bře 24
22171
0
dub 24
30
1
bře 15
5257