summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-06-28 12:29:12 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-06-28 12:29:12 +0700
commitff7390468fb11915b35c9f522379132dde19a54d (patch)
tree865993df18894eeb54eaa49a302eefbb5a1532f4
parent4501a0a17ae56ca822827a7aa500ce269391ee78 (diff)
bug fix vendor subtotal
-rwxr-xr-xindoteknik_custom/models/sale_order.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 3b3ce13a..5f37e3b2 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -470,13 +470,11 @@ class SaleOrderLine(models.Model):
fee_third_party_line = fields.Float('FeeThirdPartyLine', compute='compute_fee_third_party_line', default=0)
line_no = fields.Integer('No', default=0, copy=False)
note_procurement = fields.Char(string='Note', help="Harap diisi jika ada keterangan tambahan dari Procurement, agar dapat dimonitoring")
- vendor_subtotal = fields.Float(
- string='Vendor Subtotal', compute="compute_vendor_subtotal")
+ vendor_subtotal = fields.Float(string='Vendor Subtotal', compute="_compute_vendor_subtotal")
- def compute_vendor_subtotal(self):
- # self.vendor_subtotal = 1
+ def _compute_vendor_subtotal(self):
for line in self:
- if line.purchase_price > 0:
+ if line.purchase_price > 0 and line.product_uom_qty > 0:
# product = line.product_id
# if product:
@@ -485,8 +483,10 @@ class SaleOrderLine(models.Model):
# vendor_price = line.purchase_price
# else:
# vendor_price = line.purchase_price + (line.purchase_price*11/100)
-
- line.vendor_subtotal = line.purchase_price * line.product_uom_qty
+ subtotal = line.purchase_price * line.product_uom_qty
+ line.vendor_subtotal = subtotal
+ else:
+ line.vendor_subtotal = 0
def compute_item_margin(self):
for line in self: