Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
17669 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

You just replace that page with following :


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

Awatar
Odrzuć
Najlepsza odpowiedź

You can hide this page using following code


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

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

</xpath>


Awatar
Odrzuć
Najlepsza odpowiedź

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>

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
kwi 23
4521
2
sie 19
4480
2
mar 24
22168
0
kwi 24
30
1
mar 15
5256