summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/stock_picking.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-02-10 15:26:25 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-02-10 15:26:25 +0700
commitb87787893d25f735bdf9aba164bc8b1f23e2b72f (patch)
treede41a18dd103a96225698e6a9bdb9349d80190e0 /indoteknik_custom/models/stock_picking.py
parent3de9e2a7e2b9b455fa85e33231612996538830f4 (diff)
fix line number in po/so and stock picking
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
-rw-r--r--indoteknik_custom/models/stock_picking.py13
1 files changed, 6 insertions, 7 deletions
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