Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

How to Add Amount in Words / Text to Printed Invoice?

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
pdfinvoicereportprints
7 Replies
33611 Tampilan
Avatar
Budi Hartono

 I am a beginner in programming both python and Odoo. I need a amount to text function that will display amount total in text in the printed invoice. I tried to follow this QWeb report tutorial: https://www.youtube.com/watch?v=tCAUm3MWYzk

Somehow I could create a module that modify the printed pdf. But I really don't have idea on how to put amount in text in the invoice PDF. I have searched the Odoo forum, only to find these guidances that failed to make me understand since I'm a noob:

https://www.odoo.com/forum/help-1/question/detailed-procedure-to-do-the-number-to-text-conversion-10504

https://www.odoo.com/forum/help-1/question/conversion-of-amount-to-text-in-openerp-43765

Here is the file content that modify the original report_invoice.xml. How to call the amount_to_text function in this report_invoice.xml below with the amount_to_text function that already exists in odoo/openerp/tools/amount_to_text.py?

addons/amount_text/views/report_invoice.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <template id="report_invoice_document_inherit" inherit_id="account.report_invoice_document">
            <xpath expr="//div[@class='page']/div[@class='row mt32 mb32']" position="replace">

<div class="row mt32 mb32">32 mb32']" position="replace">
                <div class="row mt32 mb32">
                  <div class="col-xs-2" t-if="o.name">
                      <strong>Keterangan:</strong>
                      <p t-field="o.name"/>
                  </div>
                  <div class="col-xs-2" t-if="o.date_invoice">
                      <strong>Tanggal Invoice:</strong>
                      <p t-field="o.date_invoice"/>
                  </div>
                  <div class="col-xs-2" t-if="o.origin">
                      <strong>Asal:</strong>
                      <p t-field="o.origin"/>
                  </div>
                  <div class="col-xs-2" t-if="o.partner_id.ref">
                      <strong>Kode Customer:</strong>
                      <p t-field="o.partner_id.ref"/>
                  </div>
                  <div class="col-xs-2" t-if="o.reference">
                      <strong>Referensi:</strong>
                      <p t-field="o.reference"/>
                  </div>
              </div>
            </xpath>
            <xpath expr="//table[@class='table table-condensed']" position="after">
            <p>
                <strong>Amount in Text:</strong>                
                <!-- <span t-esc="openerp.tools.amount_to_text(o.amount_total, 'usd')"/> -->
            </p>
            </xpath>
        </template>
    </data>
</openerp>

3
Avatar
Buang
Herry prasetyo

  Pravitha thank you very much 

Susana Castillo

Thanks for sharing. 

Avatar
Zbik
Jawaban Terbai

You inherit class account_invoice() like this:

class account_invoice(models.Model):
    _inherit = "account.invoice"
   @api.multi
   def amount_to_text(self, amount, currency='Euro'):
       return amount_to_text(amount, currency)

call in xml

<span t-esc="o.amount_to_text(o.amount_total, 'Euro')"/> 


5
Avatar
Buang
Avatar
Pravitha
Jawaban Terbai

 https://github.com/Pravithavarghese1/purchase_amount_to_text

inherit account_invoice():

from odoo.tools import amount_to_text_en

class AccountInvoice(models.Model):
_inherit = "account.invoice"
_description = "Invoice"

    @api.multi
def amount_to_text(self, amount, currency):
    convert_amount_in_words = amount_to_text_en.amount_to_text(amount, lang='en', currency='')
        convert_amount_in_words = convert_amount_in_words.replace(' and Zero Cent', ' Only ')  
        return convert_amount_in_words


In xml:

<span t-esc="o.amount_to_text(o.amount_total, o.currency_id)"/>
2
Avatar
Buang
Avatar
Arafat Ali
Jawaban Terbai

For Odoo 10, you can get this free here: https://www.maxibi.com/prints-amount-text-english-using-odoo-free-module/

0
Avatar
Buang
Wimpy

website maintenance, can you provide new link?

Avatar
bunny
Jawaban Terbai
<span t-esc="o.amount_to_text(o.amount_total, 'INR')"/> 
0
Avatar
Buang
Avatar
B.hind
Jawaban Terbai

hi ,

when i try this code , it isn't working , i have this error

i dont  know how to solve it

File "/opt/odoo/addons/recu_facture/facture.py", line 23, in amount_to_text
    return amount_to_text(amount,currency)
QWebException: ""global name 'amount_to_text' is not defined" while evaluating
"o.amount_to_text(o.amount_total,'Euro')"" while evaluating
"translate_doc(doc_id, doc_model, 'partner_id.lang','recu_facture.recufacture_document')"
0
Avatar
Buang
Pravitha

import amount_to_text from tools.

"from odoo.tools import amount_to_text"

Avatar
le_dilem
Jawaban Terbai

Hi,

https://github.com/ledilem/Odoo

0
Avatar
Buang
Budi Hartono
Penulis

Thanks, I'll take a look

Avatar
Budi Hartono
Penulis Jawaban Terbai

Hi zbik,

Thanks a lot for your reply.

I did what you told, and I got this error.

QWebException: ""'account.invoice' object has no attribute 'amount_to_text'" while evaluating
"o.amount_to_text(o.amount_total, 'Euro')"" while evaluating
"translate_doc(doc_id, doc_model, 'partner_id.lang', 'account.report_invoice_document')"

FYI, these are the files in my modules:

amount_text folder:

views\report_invoice.xml
__init__.py
__openerp__.py
account_invoice.py
In the account_invoice.py

from openerp.tools import amount_to_text
class account_invoice(models.Model):
    _inherit = "account.invoice"
   @api.multi
   def amount_to_text(self, amount, currency='Euro'):
       return amount_to_text(amount, currency)

__init__.py

import account_invoice

__openerp__.py

{
   "name": "Amount Text",
    "version": "1.0.0",
    "depends": ["base"],
    "author": "Budi Hartono",
    "category": "",
    "description": """
    Amount to text.
    """,
    "website": "http://www.recoremedia.com",
    "depends": ["base"],
    "data": ["views/report_invoice.xml"],
    "installable": True,
    "active": False,
    #    "certificate": "",
}

views\report_invoice.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <template id="report_invoice_document_inherit" inherit_id="account.report_invoice_document">
            <xpath expr="//div[@class='page']/div[@class='row mt32 mb32']" position="replace">
                <div class="row mt32 mb32">
                  <div class="col-xs-2" t-if="o.name">
                      <strong>Keterangan:</strong>
                      <p t-field="o.name"/>
                  </div>
                  <div class="col-xs-2" t-if="o.date_invoice">
                      <strong>Tanggal Invoice:</strong>
                      <p t-field="o.date_invoice"/>
                  </div>
                  <div class="col-xs-2" t-if="o.origin">
                      <strong>Asal:</strong>
                      <p t-field="o.origin"/>
                  </div>
                  <div class="col-xs-2" t-if="o.partner_id.ref">
                      <strong>Kode Customer:</strong>
                      <p t-field="o.partner_id.ref"/>
                  </div>
                  <div class="col-xs-2" t-if="o.reference">
                      <strong>Referensi:</strong>
                      <p t-field="o.reference"/>
                  </div>
              </div>
            </xpath>
            <xpath expr="//table[@class='table table-condensed']" position="after">
            <p>
                <strong>Amount in Text:</strong>                
                <span t-esc="o.amount_to_text(o.amount_total, 'Euro')"/> 
            </p>
            </xpath>
        </template>
    </data>
</openerp>

0
Avatar
Buang
Zbik

Try it: "depends": ["account", "report"]

Zbik

... in __openerp__.py and ... update your module.

Budi Hartono
Penulis

Hi zbik, Thanks, now it's working. You saved my live :) Anyway, I still have to add some import directives in the account_invoice.py to avoid further error messages: from openerp import api from openerp import models, fields

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Invoice on basic layout
pdf invoice qweb report
Avatar
0
Apr 24
2584
Can not print/preview account report (invoice) Diselesaikan
pdf invoice report v14
Avatar
1
Mar 22
4323
Invoice PDF preview Issue
accounting pdf invoice report Odoo17
Avatar
Avatar
1
Okt 25
2547
PDF Invoice line overflow
pdf invoice
Avatar
Avatar
Avatar
2
Jul 25
1530
Quote PDF Spacing & Layout
pdf invoice
Avatar
Avatar
1
Agu 25
2088
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now