From 54805e137d4b6a5ef9e621e2b3aca45f270c0041 Mon Sep 17 00:00:00 2001 From: Michael Tietz Date: Mon, 22 May 2023 06:56:45 +0200 Subject: [PATCH] [FIX] rma_sale_mrp: _check_rma_invoice_lines_qty checks now only lines with phantom_bom_product set~ --- rma_sale_mrp/models/account_move.py | 4 +++- rma_sale_mrp/readme/CONTRIBUTORS.rst | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rma_sale_mrp/models/account_move.py b/rma_sale_mrp/models/account_move.py index 843e1c23..bffd6754 100644 --- a/rma_sale_mrp/models/account_move.py +++ b/rma_sale_mrp/models/account_move.py @@ -1,4 +1,5 @@ # Copyright 2021 Tecnativa - David Vidal +# Copyright 2024 Michael Tietz (MT Software) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import models from odoo.tools import float_compare @@ -16,7 +17,8 @@ class AccountMove(models.Model): if lines: return lines.sudo().filtered( lambda r: ( - r.rma_id.phantom_bom_product + not r.rma_id.phantom_bom_product + or r.rma_id.phantom_bom_product and float_compare(r.quantity, r.rma_id.kit_qty, precision) < 0 ) ) diff --git a/rma_sale_mrp/readme/CONTRIBUTORS.rst b/rma_sale_mrp/readme/CONTRIBUTORS.rst index e5276b37..aa9cd144 100644 --- a/rma_sale_mrp/readme/CONTRIBUTORS.rst +++ b/rma_sale_mrp/readme/CONTRIBUTORS.rst @@ -1,3 +1,4 @@ * `Tecnativa `__: * David Vidal +* Michael Tietz (MT Software)