summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-10-14 21:07:48 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-10-14 21:07:48 +0700
commit8e9a84acd044954189cad84200b401516427c0fb (patch)
treedda8259aebebf4f23a797187829964fc4d0618c4 /indoteknik_custom/models/purchase_order.py
parent9a57defbaf402e921ed32ceb1a7818bbaf3d4006 (diff)
add line no in purchase order
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 84a95f9a..6023afdd 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -38,6 +38,14 @@ class PurchaseOrder(models.Model):
summary_qty_receipt = fields.Float('Summary Qty Receipt', compute='_compute_summary_qty')
count_line_product = fields.Float('Total Item', compute='compute_count_line_product')
+ def calculate_line_no(self):
+ line_no = 0
+ for line in self.order_line:
+ if line.product_id.type == 'product':
+ line_no += 1
+ line.line_no = line_no
+ # _logger.info('Calculate PO Line No %s' % line.id)
+
def calculate_po_status_beginning(self):
purchases = self.env['purchase.order'].search([
('po_status', '=', False),