summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_order.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
-rwxr-xr-xindoteknik_custom/models/sale_order.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 9cdd9a7b..35d1f087 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -3296,16 +3296,6 @@ class SaleOrder(models.Model):
def button_refund(self):
self.ensure_one()
-
- if self.state not in ['cancel', 'sale']:
- raise UserError(f"❌ SO {self.name} tidak bisa direfund. Status harus Cancel atau Sale.")
- if self.state == 'sale':
- not_done_pickings = self.picking_ids.filtered(lambda p: p.state not in ['done', 'cancel'])
- if not_done_pickings:
- raise UserError(
- f"❌ SO {self.name} Belum melakukan kirim barang "
- f"({', '.join(not_done_pickings.mapped('name'))}). Selesaikan Pengiriman untuk melakukan refund."
- )
invoice_ids = self.invoice_ids.filtered(lambda inv: inv.state != 'cancel')