From 9cf24c42f596578a80df7e796b7d0a90a2ec798a Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 10 Aug 2022 17:27:33 +0700 Subject: fix display name without internal reference --- vit_efaktur/wizard/pk.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vit_efaktur/wizard/pk.py b/vit_efaktur/wizard/pk.py index 6e3e824..e906346 100644 --- a/vit_efaktur/wizard/pk.py +++ b/vit_efaktur/wizard/pk.py @@ -343,11 +343,16 @@ class efaktur_pk_wizard(models.TransientModel): dpp = round(line['price_subtotal']) ppn = round(line['price_total']-line['price_subtotal']) dpp_satuan = round(dpp/jumlah_barang) + product_name = product_id.display_name + first_index = product_name.find("[") + second_index = product_name.find("]")+1 + str_will_replace = product_name[first_index:second_index] + display_name = product_name.replace(str_will_replace,"").strip() data = { 'FK': 'OF', 'KD_JENIS_TRANSAKSI': product_id.default_code or '', - 'FG_PENGGANTI': product_id.name or '', + 'FG_PENGGANTI': display_name or '', 'NOMOR_FAKTUR': dpp_satuan, 'MASA_PAJAK': jumlah_barang, 'TAHUN_PAJAK': harga_total, -- cgit v1.2.3