Traceback (most recent call last): File "/home/abhi/Developer/odoo/addons/report/controllers/main.py", line 96, in report_download response = self.report_routes(reportname, docids=docids, converter='pdf') File "/home/abhi/Developer/odoo/odoo/http.py", line 506, in response_wrap response = f(*args, **kw) File "/home/abhi/Developer/odoo/addons/report/controllers/main.py", line 45, in report_routes pdf = report_obj.with_context(context).get_pdf(docids, reportname, data=data) File "/home/abhi/Developer/odoo/addons/report/models/report.py", line 178, in get_pdf html = self.with_context(context).get_html(docids, report_name, data=data) File "/home/abhi/Developer/odoo/addons/report/models/report.py", line 144, in get_html return self.render(report.report_name, docargs) File "/home/abhi/Developer/odoo/addons/report/models/report.py", line 120, in render return view_obj.render_template(template, values) File "/home/abhi/Developer/odoo/odoo/addons/base/ir/ir_ui_view.py", line 1043, in render_template return self.browse(self.get_view_id(template)).render(values, engine) File "/home/abhi/Developer/odoo/addons/website/models/ir_ui_view.py", line 115, in render return super(View, self).render(values, engine=engine) File "/home/abhi/Developer/odoo/addons/web_editor/models/ir_ui_view.py", line 26, in render return super(IrUiView, self).render(values=values, engine=engine) File "/home/abhi/Developer/odoo/odoo/addons/base/ir/ir_ui_view.py", line 1063, in render return self.env[engine].render(self.id, qcontext) File "/home/abhi/Developer/odoo/odoo/addons/base/ir/ir_qweb/ir_qweb.py", line 53, in render return super(IrQWeb, self).render(id_or_xml_id, values=values, **context) File "/home/abhi/Developer/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 248, in render self.compile(template, options)(self, body.append, values or {}) File "/home/abhi/Developer/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 317, in _compiled_fn raise e QWebException: 'account.invoice' object has no attribute 'amount_to_text' Traceback (most recent call last): File "/home/abhi/Developer/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 315, in _compiled_fn return compiled(self, append, values, options, log) File "<template>", line 1, in template_account_report_invoice_document_420 File "<template>", line 3, in body_call_content_419 File "<template>", line 289, in foreach_403 File "<template>", line 309, in foreach_402 File "<template>", line 321, in foreach_400 AttributeError: 'account.invoice' object has no attribute 'amount_to_text' Error to render compiling AST AttributeError: 'account.invoice' object has no attribute 'amount_to_text' Template: account.report_invoice_document Path: /templates/t/t/div/t[2]/table/tbody/t/t[3]/tr/td[10]/span/span Node: <span t-esc="o.amount_to_text(l.price_subtotal, 'INR')"/>
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
https://drive.google.com/open?id=0Bxi-NOmvbWd_RkpkUHhnNUM0STQ
i did but i got a same error bro global name 'amount_to_text' is not defined
and i put code inside a account.invoice.py
from odoo.tools import amount_to_text_en
please help me thank u
Hi,
Inherit the account.invoice model and define a function amount_to_text in it.
class AccountInvoice(models.Model):
_inherit = "account.invoice"
@api.multi
def amount_to_text(self, amount, currency='INR'):
return amount_to_text(amount, currency)
Then in the template,
<span t-esc="o.amount_to_text(l.price_subtotal, 'INR')"/>
Thanks
when i select the field in word it show like this :Seven Thousand, Three Hundred And Sixteen Dollars and Seven Thousand, Four
Hundred Cents
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up