Skip to Content
Menú
This question has been flagged
3 Respostes
17693 Vistes

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
Descartar
Best Answer

You just replace that page with following :


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

Avatar
Descartar
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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
3
d’abr. 23
4533
2
d’ag. 19
4496
2
de març 24
22187
0
d’abr. 24
30
1
de març 15
5260