Merge PR #1437 into 16.0

Signed-off-by sebalix
This commit is contained in:
OCA-git-bot
2025-01-06 06:51:31 +00:00
4 changed files with 7 additions and 6 deletions

View File

@@ -111,7 +111,7 @@ class MrpProduction(models.Model):
and m.state not in ("done", "cancel")
)
if finish_moves and not finish_moves.quantity_done:
lot_model = self.env["stock.production.lot"]
lot_model = self.env["stock.lot"]
lot = lot_model.search(
[
("product_id", "=", order.product_id.id),
@@ -128,7 +128,7 @@ class MrpProduction(models.Model):
)
)
if not lot:
lot = self.env["stock.production.lot"].create(
lot = self.env["stock.lot"].create(
{
"product_id": order.product_id.id,
"company_id": order.company_id.id,

View File

@@ -1 +1,2 @@
from . import test_mrp_bom
from . import test_mrp_production

View File

@@ -81,7 +81,7 @@ class Common(common.TransactionCase):
"company_id": line.company_id.id,
"name": lot_name,
}
lot = cls.env["stock.production.lot"].create(vals)
lot = cls.env["stock.lot"].create(vals)
cls._update_qty_in_location(
location,
line.product_id,

View File

@@ -34,7 +34,7 @@ class TestMrpProduction(Common):
def _set_qty_done(self, order):
for line in order.move_raw_ids.move_line_ids:
line.qty_done = line.product_uom_qty
line.qty_done = line.reserved_uom_qty
order.qty_producing = order.product_qty
def test_order_propagated_lot_producing(self):
@@ -64,7 +64,7 @@ class TestMrpProduction(Common):
self.assertEqual(self.order.propagated_lot_producing, self.LOT_NAME)
# Create a lot with the same number for the finished product
# without any stock/quants (so not used at all) before validating the MO
existing_lot = self.env["stock.production.lot"].create(
existing_lot = self.env["stock.lot"].create(
{
"product_id": self.order.product_id.id,
"company_id": self.order.company_id.id,
@@ -82,7 +82,7 @@ class TestMrpProduction(Common):
# Create a lot with the same number for the finished product
# with some stock/quants (so it is considered as used) before
# validating the MO
existing_lot = self.env["stock.production.lot"].create(
existing_lot = self.env["stock.lot"].create(
{
"product_id": self.order.product_id.id,
"company_id": self.order.company_id.id,