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

How to make a button visible in odoo

By
Michael Marroquin
on 11/8/16, 10:59 AM 110 views

Create a new status in quotation, but when I change the quotation in my new status, the confirm sales button disappears.

Add these lines to my view by inheriting from sale.order

<xpath expr="//button[@name='action_confirm']" position="attributes"> <attribute name="visible"> [('state', '=', 'pending')]</attribute> </xpath>

But it does not work.

1
Ameera PP
On 11/8/16, 10:34 PM

Hi Michael,

please check this eg:

if button is defined like this:

<button name="action_confirm" states="draft" string="Confirm Sale" type="object" context="{'show_sale': True}"/>

Replace it like:

<xpath expr="//button[@name='action_confirm']" position="replace">

    <button name="action_confirm" states="draft,pending" string="Confirm Sale" type="object" context="{'show_sale': True}"/>

</xpath>

0

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 11/9/16, 1:58 AM

 When states property is added to a button, you cannot use invisible or attrs to control the visibility, because it simply doesn't work, instead try to add convenient property i.e either stick to states or go with attrs, but not both to a button. 

So if want to change the states, then  try this below one

<xpath expr="//button[@name='action_confirm']" position="attributes"> 
<attribute name="states">pending</attribute>
</xpath>

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

1 follower(s)

Stats

Asked: 11/8/16, 10:59 AM
Seen: 110 times
Last updated: 11/9/16, 1:58 AM