summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHafidBuroiroh <hafidburoiroh09@gmail.com>2025-10-24 11:27:57 +0700
committerHafidBuroiroh <hafidburoiroh09@gmail.com>2025-10-24 11:27:57 +0700
commit4b257da93f1eb1d025303113d6884b22df59c1b4 (patch)
treee240aab8c57085156073153264db722cb4b628e1
parent12f1df2b2dabd0fba5dc0e2584c9a588c378118c (diff)
<hafid> refund barang kurang
-rw-r--r--indoteknik_custom/models/refund_sale_order.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py
index 47565dfc..e6547a88 100644
--- a/indoteknik_custom/models/refund_sale_order.py
+++ b/indoteknik_custom/models/refund_sale_order.py
@@ -753,10 +753,11 @@ class RefundSaleOrder(models.Model):
line_vals = []
for so in self.sale_order_ids:
for line in so.order_line:
- if line.qty_delivered == 0:
+ barang_kurang = line.product_uom_qty - line.qty_delivered
+ if line.qty_delivered == 0 or barang_kurang > 0:
line_vals.append((0, 0, {
'product_id': line.product_id.id,
- 'quantity': line.product_uom_qty,
+ 'quantity': barang_kurang,
'from_name': so.name,
'prod_id': so.id,
'reason': '',