From 685d690dda7b4ce8f1be3dd3d7ab9865e6c99793 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Mon, 27 Feb 2023 16:08:38 +0100 Subject: [PATCH] [IMP] rma_account: add index in account.move.line to field 'rma_line_id' --- rma_account/models/account_move.py | 1 + rma_account/wizards/rma_refund.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rma_account/models/account_move.py b/rma_account/models/account_move.py index d509aad1..81864c6e 100644 --- a/rma_account/models/account_move.py +++ b/rma_account/models/account_move.py @@ -235,6 +235,7 @@ class AccountMoveLine(models.Model): comodel_name="rma.order.line", string="RMA line", ondelete="set null", + index=True, help="This will contain the rma line that originated this line", ) diff --git a/rma_account/wizards/rma_refund.xml b/rma_account/wizards/rma_refund.xml index da9cc4d2..60b6da75 100644 --- a/rma_account/wizards/rma_refund.xml +++ b/rma_account/wizards/rma_refund.xml @@ -59,13 +59,13 @@ name="%(action_rma_refund)d" string="Create Refund" class="oe_highlight" - attrs="{'invisible':['|', '|', ('qty_to_refund', '=', 0), ('state', '!=', 'approved'), ('refund_policy', '=', 'no')]}" + attrs="{'invisible':['|', '|', '|', ('qty_to_refund', '=', 0), ('qty_to_refund', '<', 0), ('state', '!=', 'approved'), ('refund_policy', '=', 'no')]}" type="action" />