summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-04-01 15:13:26 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-04-01 15:13:26 +0700
commitc82c2e8c2823b125c749d77b2178271f48bada8f (patch)
treefde4e8ad029357100fe9417d49b0a3006d5af727
parent957b582146f82e50bfa6af533febd2908918d140 (diff)
trying to fix error compute delivery amt text
-rw-r--r--indoteknik_custom/models/account_move.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index 39f1326c..f80cc109 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -61,14 +61,16 @@ class AccountMove(models.Model):
tb = Terbilang()
for record in self:
- if not record.sale_id or record.sale_id.delivery_amt <= 0:
- continue
-
res = ''
- if record.sale_id.delivery_amt > 0:
- tb.parse(int(record.sale_id.delivery_amt))
- res = tb.getresult().title()
- record.delivery_amt_text = res
+
+ try:
+ if record.sale_id.delivery_amt > 0:
+ tb.parse(int(record.sale_id.delivery_amt))
+ res = tb.getresult().title()
+ record.delivery_amt_text = res
+ except:
+ record.delivery_amt_text = res
+
@api.constrains('bills_efaktur_document')
def _constrains_efaktur_document(self):