diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-01 15:08:58 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-01 15:08:58 +0700 |
| commit | 957b582146f82e50bfa6af533febd2908918d140 (patch) | |
| tree | a2db93bf06ed34edf3e165f654cda553416c9c96 | |
| parent | 6852040680b803a76ee2314b365fa1f0a87085d3 (diff) | |
fix error delivery amt text
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 6a847c1d..39f1326c 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -61,13 +61,14 @@ class AccountMove(models.Model): tb = Terbilang() for record in self: - if record.sale_id.delivery_amt <= 0: + 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)) - record.delivery_amt_text = tb.getresult().title() - + res = tb.getresult().title() + record.delivery_amt_text = res @api.constrains('bills_efaktur_document') def _constrains_efaktur_document(self): |
