[IMP] sale: hide cancel button if record not saved

Purpose of this task is to clean up the orders interface with keeping
just the needed action buttons.

So in this commit we hide cancel button if the order is not saved yet.
it will also hide the cancel button for the rental order.

closes odoo/odoo#47579

Taskid: 2080191
Closes: #47579
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Nisha patel
2020-03-13 12:29:44 +00:00
committed by Barad Mahendra
parent d678d516ef
commit ca666a7778
+1 -1
View File
@@ -277,7 +277,7 @@
attrs="{'invisible': [('state', 'not in', ['draft'])]}"/>
<button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice" groups="sale.group_proforma_sales" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('invoice_count','&gt;=',1)]}" context="{'proforma': True}"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="sent,sale"/>
<button name="action_cancel" states="draft,sent,sale" type="object" string="Cancel"/>
<button name="action_cancel" type="object" string="Cancel" attrs="{'invisible': ['|', ('state', 'not in', ['draft', 'sent','sale']), ('id', '=', False)]}"/>
<button name="action_draft" states="cancel" type="object" string="Set to Quotation"/>
<field name="state" widget="statusbar" statusbar_visible="draft,sent,sale"/>
</header>