[FIX] sale: hide cancel button on locked orders

You have to unlock the order before cancelling it.
Introduced by 17bece3e79

Fixes #153987

closes odoo/odoo#154259

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2024-02-15 19:47:05 +00:00
parent 3e4b005f30
commit 787bebf302
+1 -1
View File
@@ -271,7 +271,7 @@
<button name="action_unlock" type="object" string="Unlock"
invisible="not locked" groups="sales_team.group_sale_manager"/>
<button name="action_preview_sale_order" string="Preview" type="object" class="btn-secondary"/>
<button name="action_cancel" type="object" string="Cancel" invisible="state not in ['draft', 'sent', 'sale'] or not id" data-hotkey="x"/>
<button name="action_cancel" type="object" string="Cancel" invisible="state not in ['draft', 'sent', 'sale'] or not id or locked" data-hotkey="x"/>
<button name="action_draft" invisible="state != 'cancel'" type="object" string="Set to Quotation" data-hotkey="w"/>
<t groups="sale.group_auto_done_setting">
<button name="action_lock" type="object" string="Lock"