From 83670d36f3cf3de3f3b95f4343319fa9b5a93a1e Mon Sep 17 00:00:00 2001 From: tslai Date: Thu, 17 Sep 2020 17:01:19 +0800 Subject: [PATCH] [IMP] Simplify logic --- mrp_subcontracting/models/stock_picking.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mrp_subcontracting/models/stock_picking.py b/mrp_subcontracting/models/stock_picking.py index 95d6f7a8e..d3189b169 100644 --- a/mrp_subcontracting/models/stock_picking.py +++ b/mrp_subcontracting/models/stock_picking.py @@ -72,10 +72,9 @@ class StockPicking(models.Model): }) else: for move_line in move.move_line_ids: - active_id = production and production.id or False produce = self.env['mrp.product.produce'].with_context( default_production_id=production.id, - active_id=active_id).create({ + active_id=production.id).create({ 'production_id': production.id, 'product_id': production.product_id.id, 'product_qty': move_line.qty_done,