summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-07-10 09:26:14 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-07-10 09:26:14 +0000
commit73942b32febd327b82530dff25895ef94a9f738f (patch)
tree85b2b8307e6a2f92df0963c2675c1e4452a90df5 /indoteknik_custom/models/purchase_order.py
parent2c0bb838b406503aa6a10cc0c21d474429246e18 (diff)
parent03910d19a28cf5c7507a2763bc42875546f2b139 (diff)
Merged in calculate-po (pull request #47)
Calculate po
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 1eb76370..7091bb72 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -215,6 +215,16 @@ class PurchaseOrder(models.Model):
else:
self.approval_status = 'pengajuan1'
+ def re_calculate(self):
+ for line in self.order_line:
+ sale_order_line = self.env['sale.order.line'].search([
+ ('product_id', '=', line.product_id.id),
+ ('order_id', '=', line.order_id.sale_order_id.id)
+ ], limit=1, order='price_reduce_taxexcl')
+ for so_line in sale_order_line:
+ unit_price = line.price_unit
+ so_line.purchase_price = unit_price
+
def button_cancel(self):
res = super(PurchaseOrder, self).button_cancel()
self.approval_status = False