summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2024-04-03 14:39:17 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2024-04-03 14:39:17 +0700
commit4b5b7fb416989feaf6e39246c0f336923dc23457 (patch)
treeb2eed672a1aea1c73b409140b0dec02cf2d40b1f /indoteknik_custom/models/purchase_order.py
parentde2b61c0baa0d1d2bdf59adf5538a8e765620f05 (diff)
parent72b6d34df5606cf2be49bb66936be092b86c9d15 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 8f107de1..35fefbe2 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -458,10 +458,11 @@ class PurchaseOrder(models.Model):
return res
def compute_total_margin(self):
- if self.from_apo:
- self.compute_total_margin_from_apo()
- return
-
+ for rec in self:
+ if rec.from_apo:
+ rec.compute_total_margin_from_apo()
+ return
+
sum_so_margin = sum_sales_price = sum_margin = 0
for line in self.order_line:
sale_order_line = line.so_line_id