Files
rma/rma_sale_mrp/models/account_move.py
david 1dfb270222 [MIG] rma_sale_mrp: Migration to 13.0
[UPD] Update rma_sale_mrp.pot

[UPD] README.rst
2022-05-17 13:17:59 +02:00

24 lines
798 B
Python

# Copyright 2021 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
from odoo.tools import float_compare
class AccountMove(models.Model):
_inherit = "account.move"
def _check_rma_invoice_lines_qty(self):
"""For those with differences, check if the kit quantity is the same"""
precision = self.env["decimal.precision"].precision_get(
"Product Unit of Measure"
)
lines = super()._check_rma_invoice_lines_qty()
if lines:
return lines.sudo().filtered(
lambda r: (
r.rma_id.phantom_bom_product
and float_compare(r.quantity, r.rma_id.kit_qty, precision) < 0
)
)
return lines