From d1daec1861239370061ffa859f1bcfe623a64957 Mon Sep 17 00:00:00 2001 From: Leo Pinedo Date: Wed, 26 Oct 2022 23:33:53 +0000 Subject: [PATCH] [MIG]stock_picklist: to 16 --- stock_picklist/__manifest__.py | 2 +- stock_picklist/report/stock_picklist.py | 6 +++--- stock_picklist/report/stock_picklist.xml | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/stock_picklist/__manifest__.py b/stock_picklist/__manifest__.py index fc75eb57..bfbb30bf 100644 --- a/stock_picklist/__manifest__.py +++ b/stock_picklist/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Stock Picklist', - 'version': '14.0.1.0.0', + 'version': '16.0.1.0.0', 'category': 'Tools', 'depends': [ 'stock_picking_batch', diff --git a/stock_picklist/report/stock_picklist.py b/stock_picklist/report/stock_picklist.py index b2b4defe..c7e1fa80 100644 --- a/stock_picklist/report/stock_picklist.py +++ b/stock_picklist/report/stock_picklist.py @@ -7,14 +7,14 @@ ProductGroup = namedtuple('ProductGroup', ('product_id', 'qty')) class StockPicklist(models.AbstractModel): _name = 'report.stock_picklist.report_picklist' - _template = 'stock_picklist.report_picklist' + # _template = 'stock_picklist.report_picklist' @api.model def _get_report_values(self, docids, data=None): report_name = 'stock_picklist.report_picklist' report = self.env['ir.actions.report']._get_report_from_name(report_name) stock_pickings = self.env['stock.picking'].browse(docids) - stock_pack_operations = stock_pickings.mapped(lambda o: o.move_lines).mapped(lambda l: l.move_line_ids) + stock_pack_operations = stock_pickings.mapped(lambda o: o.move_ids).mapped(lambda l: l.move_line_ids) locations = stock_pack_operations.mapped(lambda o: o.location_id) _l = [] @@ -23,7 +23,7 @@ class StockPicklist(models.AbstractModel): products = operations.mapped(lambda o: o.product_id) _p = [] for product in products: - qty = sum(operations.filtered(lambda o: o.product_id.id == product.id).mapped(lambda o: o.product_qty)) + qty = sum(operations.filtered(lambda o: o.product_id.id == product.id).mapped(lambda o: o.reserved_qty)) _p.append(ProductGroup(product_id=product, qty=int(qty))) _p = sorted(_p, key=lambda p: -p.qty) _l.append(LocationGroup(location_id=location, lines=_p)) diff --git a/stock_picklist/report/stock_picklist.xml b/stock_picklist/report/stock_picklist.xml index 0e27c170..b8dc8f07 100644 --- a/stock_picklist/report/stock_picklist.xml +++ b/stock_picklist/report/stock_picklist.xml @@ -1,6 +1,5 @@ - -