diff --git a/mrp_packaging/__openerp__.py b/mrp_packaging/__openerp__.py index 25f09ac2..5fe78580 100644 --- a/mrp_packaging/__openerp__.py +++ b/mrp_packaging/__openerp__.py @@ -4,7 +4,7 @@ { "name": "Manufacturing order from packaging summary", - "version": "8.0.1.0.0", + "version": "8.0.2.0.0", "category": "Manufacturing", "license": "AGPL-3", "author": "OdooMRP team, " diff --git a/mrp_packaging/models/mrp_production.py b/mrp_packaging/models/mrp_production.py index b1187dfd..51629eb9 100644 --- a/mrp_packaging/models/mrp_production.py +++ b/mrp_packaging/models/mrp_production.py @@ -25,7 +25,7 @@ class MrpProduction(models.Model): string='Qty left for packaging', compute='_left_product_qty', digits=dp.get_precision('Product Unit of Measure'), help='This amount is indicative, it is calculated with packaging' - ' orders that are not in canceled state.') + ' orders that are not in canceled state.', store=True) @api.multi @api.depends('move_created_ids2') @@ -38,7 +38,13 @@ def _final_product_qty(self): record.final_product_qty = sum(moves.mapped('product_uom_qty')) @api.multi - @api.depends('final_product_qty', 'expected_production') + @api.depends('move_created_ids2', 'move_created_ids2.state', + 'move_created_ids2.product_id', + 'move_created_ids2.product_uom_qty', + 'expected_production', 'expected_production.state', + 'expected_production.move_lines2', + 'expected_production.move_lines', + 'expected_production.product_lines') def _left_product_qty(self): for record in self: moves = record.mapped('move_created_ids2').filtered( @@ -73,7 +79,7 @@ def get_dump_packages(self): ('product_id', '=', self.product_id.id)]) exist_prod = [x.product.id for x in self.pack] for line in lines: - if line not in exist_prod: + if line.product_id.id not in exist_prod: packs = filter( lambda x: x not in exist_prod, line.bom_id.product_tmpl_id.product_variant_ids.ids)