diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-07-10 15:20:13 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-07-10 15:20:13 +0700 |
| commit | fca284ba540d92c8e379d7779173278408a8d31f (patch) | |
| tree | 309f0f16850d2929f9e4edb52362cb284a3e640d | |
| parent | f60d2e5a3011a06d5b72c4aac80e11da642368e2 (diff) | |
refactor Re-Calculate SO di PO
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index efc98e2f..db76a919 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -220,12 +220,9 @@ class PurchaseOrder(models.Model): 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') - - unit_price = line.price_unit - sale_order_line.purchase_price = unit_price - - total_percent_margin = self.total_percent_margin - self.sale_order_id.total_percent_margin = total_percent_margin + 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() |
