From b87787893d25f735bdf9aba164bc8b1f23e2b72f Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 10 Feb 2023 15:26:25 +0700 Subject: fix line number in po/so and stock picking --- indoteknik_custom/models/stock_picking.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'indoteknik_custom/models/stock_picking.py') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 4049c535..2c75ccbc 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -96,24 +96,23 @@ class StockPicking(models.Model): def calculate_line_no(self): for picking in self: - for line in picking.move_ids_without_package: - # order_lines = picking.group_id.order_line - name = picking.group_id.name + name = picking.group_id.name + for move in picking.move_ids_without_package: if picking.group_id.sale_id: order = self.env['sale.order'].search([('name', '=', name)], limit=1) else: order = self.env['purchase.order'].search([('name', '=', name)], limit=1) - order_lines = order.order_line set_line = 0 - for order_line in order_lines: - if line.product_id == order_line.product_id: + if move.product_id == order_line.product_id: set_line = order_line.line_no break else: continue - line.line_no = set_line + move.line_no = set_line + for line in move.move_line_ids: + line.line_no = set_line def _compute_summary_qty(self): sum_qty_detail = sum_qty_operation = count_line_detail = count_line_operation = 0 -- cgit v1.2.3