Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3 Respostas
17798 Visualizações

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
Cancelar
Melhor resposta

You just replace that page with following :


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

Avatar
Cancelar
Melhor resposta

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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
3
abr. 23
4591
2
ago. 19
4561
2
mar. 24
22259
0
abr. 24
30
1
mar. 15
5290