Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
6363 Weergaven

I have created a button named 'Confirm' in customer invoice. When i click 'Confirm' button 'state1' will be 'confirmed'. I want to hide Validate button when 'state1'='draft' and show the Validate button when 'state1'='confirmed'. I tried below code but it is not working. Can anyone help me?

<!-- inherit account invoice form -->
        <record id="invoice_form_inheritai" model="ir.ui.view">
            <field name="name">account.invoice.form.inheritai</field>
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_form"/>
            <field name="arch" type="xml">
                <button name="invoice_print" position="after">
                    <field name="state1" invisible="1"/>
                    <button name="invoice_check" string="Confirm" type="object"  attrs="{'invisible': [('state1','not in', ['draft'])]}" class="oe_highlight" groups="base.group_user"/>
                </button>
                <button name="invoice_open" position="replace">
                    <button name="invoice_open" state="draft" string="Validate" attrs="{'invisible': [('state1','!=', ['confirmed'])]}" groups="base.group_user"/>
                </button>
            </field>
        </record>
Avatar
Annuleer
Beste antwoord

Use this --> attrs="{'invisible': [('state1','!=', 'confirmed')]}"

Avatar
Annuleer
Auteur

Thanks...i solved it by changing the account invoice workflow

Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 15
5030
3
feb. 18
9115
1
mrt. 15
5264
4
mrt. 15
6983
1
mrt. 15
4403