mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
@@ -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,
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
from . import test_mrp_bom
|
||||
from . import test_mrp_production
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user