diff --git a/rma_filter_lot/__manifest__.py b/rma_filter_lot/__manifest__.py
index c12e81fa..6911eda1 100644
--- a/rma_filter_lot/__manifest__.py
+++ b/rma_filter_lot/__manifest__.py
@@ -1,9 +1,9 @@
-# Copyright 2021 ForgeFlow S.L.
+# Copyright 2021-24 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
{
"name": "RMA Filter Lot",
- "version": "15.0.1.0.0",
+ "version": "17.0.1.0.0",
"license": "LGPL-3",
"category": "RMA",
"summary": "Filter RMA lots",
diff --git a/rma_filter_lot/models/rma_order_line.py b/rma_filter_lot/models/rma_order_line.py
index d3283271..b5a42ab0 100644
--- a/rma_filter_lot/models/rma_order_line.py
+++ b/rma_filter_lot/models/rma_order_line.py
@@ -1,4 +1,4 @@
-# Copyright 2021 ForgeFlow S.L.
+# Copyright 2021-24 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import api, fields, models
@@ -8,27 +8,22 @@ from odoo.tools import float_compare
class RmaOrderLine(models.Model):
_inherit = "rma.order.line"
- lot_id = fields.Many2one(
- domain="[('id', 'in', valid_lot_ids)]",
- )
valid_lot_ids = fields.One2many(
- comodel_name="stock.production.lot",
+ comodel_name="stock.lot",
compute="_compute_domain_lot_ids",
)
@api.depends("product_id")
def _compute_domain_lot_ids(self):
for rec in self:
- lots = rec.env["stock.production.lot"].search(
- [("product_id", "=", rec.product_id.id)]
- )
+ lots = rec.env["stock.lot"].search([("product_id", "=", rec.product_id.id)])
if (
lots
and rec.type == "customer"
and rec.product_id
and rec.product_id.tracking != "none"
):
- valid_ids = self.env["stock.production.lot"]
+ valid_ids = self.env["stock.lot"]
for quant in rec.product_id.stock_quant_ids:
if (
float_compare(quant.available_quantity, 0.0, precision_digits=2)
diff --git a/rma_filter_lot/views/rma_order_view.xml b/rma_filter_lot/views/rma_order_view.xml
index cef3c835..15e85bde 100644
--- a/rma_filter_lot/views/rma_order_view.xml
+++ b/rma_filter_lot/views/rma_order_view.xml
@@ -8,6 +8,11 @@
+
+ [('product_id', '=', product_id),('id','in',valid_lot_ids)]
+