diff --git a/stock_package_autoload/models/stock_move.py b/stock_package_autoload/models/stock_move.py index e2a3f2efa949..56c38db57572 100644 --- a/stock_package_autoload/models/stock_move.py +++ b/stock_package_autoload/models/stock_move.py @@ -63,6 +63,7 @@ def _onchange_load_products_from_package_id(self): "package_id": self.load_products_from_package_id.id, "location_id": self.location_id.id, "location_dest_id": self.location_dest_id.id, + "company_id": self.company_id.id, } data_list = [] for quant in product_quants: diff --git a/stock_package_autoload/tests/test_stock_package_autoload.py b/stock_package_autoload/tests/test_stock_package_autoload.py index 6ab1310a587b..c866417c0aa5 100644 --- a/stock_package_autoload/tests/test_stock_package_autoload.py +++ b/stock_package_autoload/tests/test_stock_package_autoload.py @@ -1,7 +1,8 @@ -from odoo.tests.common import SavepointCase +from odoo.tests.common import TransactionCase, tagged -class TestStockPackageAutoload(SavepointCase): +@tagged("post_install", "-at_install") +class TestStockPackageAutoload(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() @@ -9,7 +10,7 @@ def setUpClass(cls): cls.StockMove = cls.env["stock.move"] cls.StockMoveLine = cls.env["stock.move.line"] cls.StockPicking = cls.env["stock.picking"] - cls.StockProductionLot = cls.env["stock.production.lot"] + cls.StockProductionLot = cls.env["stock.lot"] cls.StockQuantPackage = cls.env["stock.quant.package"] cls.company = cls.env.company @@ -70,10 +71,11 @@ def test_autoload_package(self): 0, { "product_id": self.product.id, - "product_uom_qty": 3, + "reserved_uom_qty": 3, "product_uom_id": self.uom_unit.id, "location_id": self.location.id, "location_dest_id": self.location_dest.id, + "company_id": self.env.company.id, }, ) ],