Odoo Help

0

How to make a button visible in odoo

By
Michael Marroquin
on 11/8/16, 10:59 AM 516 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.

3
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
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>

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

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