summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/account_move.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index e26e8266..4d0d6ae5 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -7,6 +7,7 @@ import base64
import PyPDF2
import os
import re
+from terbilang import Terbilang
_logger = logging.getLogger(__name__)
@@ -54,6 +55,15 @@ class AccountMove(models.Model):
bills_invoice_document = fields.Binary(string="Invoice", required=False)
is_invoice_uploaded = fields.Boolean(string="Is Invoice Uploaded", default=False)
is_efaktur_uploaded = fields.Boolean(string="Is eFaktur Uploaded", default=False)
+ delivery_amt_text = fields.Char(string="Delivery Amt Terbilang", compute='compute_delivery_amt_text')
+
+ def compute_delivery_amt_text(self):
+ tb = Terbilang()
+
+ for record in self:
+ if record.sale_id.delivery_amt > 0:
+ tb.parse(int(record.sale_id.delivery_amt))
+ record.delivery_amt_text = tb.getresult().title()
@api.constrains('bills_efaktur_document')
def _constrains_efaktur_document(self):