diff options
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 8736a6f4..84a95f9a 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -34,8 +34,9 @@ class PurchaseOrder(models.Model): 'SO Margin%', compute='compute_total_margin', help="Total % Margin in Sales Order Header") amount_total_without_service = fields.Float('AmtTotalWithoutService', compute='compute_amt_total_without_service') - summary_qty_po = fields.Float('Summary Qty PO', compute='_compute_summary_qty') + summary_qty_po = fields.Float('Total Qty', compute='_compute_summary_qty') 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_po_status_beginning(self): purchases = self.env['purchase.order'].search([ @@ -122,16 +123,16 @@ class PurchaseOrder(models.Model): } self.env['purchase.order.line'].sudo().create(values) - # def compute_count_line_product(self): - # for order in self: - # count = 0 - # for line in order.order_line: - # if line.product_id.type == 'product': - # count += 1 - # if count == 0: - # order.count_line_product = 1 - # else: - # order.count_line_product = count + def compute_count_line_product(self): + for order in self: + count = 0 + for line in order.order_line: + if line.product_id.type == 'product': + count += 1 + if count == 0: + order.count_line_product = 1 + else: + order.count_line_product = count def compute_delivery_amount(self): for order in self: |
