This question has been flagged
3 Replies
5880 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.

Avatar
Discard
Best Answer

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>

Avatar
Discard
Best Answer

 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>
Avatar
Discard