diff --git a/mrp_production_request/__openerp__.py b/mrp_production_request/__openerp__.py index 2f3a16f8a..a3906a787 100644 --- a/mrp_production_request/__openerp__.py +++ b/mrp_production_request/__openerp__.py @@ -14,7 +14,7 @@ "license": "AGPL-3", "application": False, "installable": True, - "depends": ["mrp", "stock_available_unreserved"], + "depends": ["mrp", "stock_available_unreserved", "mrp_hook"], "data": [ "security/mrp_production_request_security.xml", "security/ir.model.access.csv", diff --git a/mrp_production_request/wizards/mrp_production_request_create_mo.py b/mrp_production_request/wizards/mrp_production_request_create_mo.py index ef9529227..78864d08a 100644 --- a/mrp_production_request/wizards/mrp_production_request_create_mo.py +++ b/mrp_production_request/wizards/mrp_production_request_create_mo.py @@ -27,14 +27,13 @@ class MrpProductionRequestCreateMo(models.TransientModel): (workcenter_lines) needed for manufacturing the given a BoM. :return: product_lines, workcenter_lines """ - bom_obj = self.env['mrp.bom'] uom_obj = self.env['product.uom'] bom_point = self.bom_id factor = uom_obj._compute_qty( self.mrp_production_request_id.product_uom.id, self.pending_qty, bom_point.product_uom.id) - return bom_obj._bom_explode( - bom_point, self.mrp_production_request_id.product_id, + return bom_point._bom_explode( + self.mrp_production_request_id.product_id, factor / bom_point.product_qty, routing_id=self.mrp_production_request_id.routing_id.id)