summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/tukar_guling.py
diff options
context:
space:
mode:
authorAndriFP <113114423+andrifp@users.noreply.github.com>2025-09-10 17:56:31 +0700
committerAndriFP <113114423+andrifp@users.noreply.github.com>2025-09-10 17:56:31 +0700
commit10da5e27e658030f171f694d6696f93e4a472447 (patch)
tree14a5f684bae4bc0803ed3c61cb1ce1bed23e33f6 /indoteknik_custom/models/tukar_guling.py
parent914bcd75dd2baddb2841cbfba6a64ebd453fecdb (diff)
parent4db6034c07414dcd09292e3c41d6fd4598868148 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into pum-v2
Diffstat (limited to 'indoteknik_custom/models/tukar_guling.py')
-rw-r--r--indoteknik_custom/models/tukar_guling.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py
index d2e00781..6e839bf0 100644
--- a/indoteknik_custom/models/tukar_guling.py
+++ b/indoteknik_custom/models/tukar_guling.py
@@ -134,7 +134,7 @@ class TukarGuling(models.Model):
if not self.val_inv_opt and self.is_has_invoice == True:
raise UserError("Kalau sudah ada invoice Return Invoice Option harus diisi!")
for rec in self:
- if rec.val_inv_opt == 'cancel_invoice' and self.is_has_invoice == True:
+ if rec.val_inv_opt == 'cancel_invoice' and self.is_has_invoice == True and rec.invoice_id.state != 'cancel':
raise UserError("Tidak bisa mengubah Return karena sudah ada invoice dan belum di cancel.")
elif rec.val_inv_opt == 'tanpa_cancel' and self.is_has_invoice == True:
continue