Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Customer Invoice validate button

By
Sajad KK
on 2/6/14, 4:30 AM 1,823 views

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>
0
Ayyappan
On 2/6/14, 7:24 AM

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

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

Sajad KK
on 2/6/14, 10:30 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 2/6/14, 4:30 AM
Seen: 1823 times
Last updated: 3/16/15, 8:10 AM