Issue on bi_translate_amount v14 (#1,560)
Status: OPEN
Date: 01/07/2021
Assigned to
Contact
Sachinay Bhujbal
sachinay.bhujbal@browseinfo.in

Description
when I try to print more than one invoice in same time showing error , please fix it
by
ahmad aldaher
on 7/1/21, 4:32 PM
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/api.py", line 789, in get
field_cache = field_cache[record.env.cache_key(field)]
KeyError: ('en_US',)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/fields.py", line 970, in __get__
value = env.cache.get(record, self)
File "/opt/odoo14/odoo/odoo/api.py", line 793, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'account.move(1,).amount_in_words'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/models.py", line 4988, in ensure_one
_id, = self._ids
ValueError: too many values to unpack (expected 1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/addons/base/models/qweb.py", line 331, in _compiled_fn
return compiled(self, append, new, options, log)
File "<template>", line 1, in template_account_report_invoice_document_3126
File "<template>", line 2, in body_call_content_3124
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_qweb.py", line 380, in _get_field
content = converter.record_to_html(record, field_name, field_options)
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_qweb_fields.py", line 128, in record_to_html
value = record[field_name]
File "/opt/odoo14/odoo/odoo/models.py", line 5666, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/opt/odoo14/odoo/odoo/fields.py", line 1019, in __get__
self.compute_value(recs)
File "/opt/odoo14/odoo/odoo/fields.py", line 1175, in compute_value
records._compute_field_value(self)
File "/opt/odoo14/odoo/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
return super()._compute_field_value(field)
File "/opt/odoo14/odoo/odoo/models.py", line 4061, in _compute_field_value
getattr(self, field.compute)()
File "/opt/odoo14/odoo-custom-addons/bi_translate_amount/models/account_invoice.py", line 18, in _amount_in_words
num = self.amount_total
File "/opt/odoo14/odoo/odoo/fields.py", line 963, in __get__
record.ensure_one()
File "/opt/odoo14/odoo/odoo/models.py", line 4991, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: account.move(1, 2)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 2121, in report_download
response = self.report_routes(reportname, docids=docids, converter=converter, context=context)
File "/opt/odoo14/odoo/odoo/http.py", line 531, in response_wrap
response = f(*args, **kw)
File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 2056, in report_routes
pdf = report.with_context(context)._render_qweb_pdf(docids, data=data)[0]
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_actions_report.py", line 804, in _render_qweb_pdf
html = self_sudo.with_context(context)._render_qweb_html(res_ids, data=data)[0]
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_actions_report.py", line 845, in _render_qweb_html
return self._render_template(self.sudo().report_name, data), 'html'
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_actions_report.py", line 583, in _render_template
return view_obj._render_template(template, values)
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_ui_view.py", line 1709, in _render_template
return self.browse(self.get_view_id(template))._render(values, engine)
File "/opt/odoo14/odoo/addons/web_editor/models/ir_ui_view.py", line 28, in _render
return super(IrUiView, self)._render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_ui_view.py", line 1717, in _render
return self.env[engine]._render(self.id, qcontext)
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_qweb.py", line 55, in _render
result = super(IrQWeb, self)._render(id_or_xml_id, values=values, **context)
File "/opt/odoo14/odoo/odoo/addons/base/models/qweb.py", line 258, in _render
self.compile(template, options)(self, body.append, values or {})
File "/opt/odoo14/odoo/odoo/addons/base/models/qweb.py", line 333, in _compiled_fn
raise e
File "/opt/odoo14/odoo/odoo/addons/base/models/qweb.py", line 331, in _compiled_fn
return compiled(self, append, new, options, log)
File "<template>", line 1, in template_account_report_invoice_with_payments_3069
File "<template>", line 2, in body_call_content_3067
File "<template>", line 3, in foreach_3066
File "/opt/odoo14/odoo/odoo/addons/base/models/qweb.py", line 338, in _compiled_fn
raise QWebException("Error to render compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)
odoo.addons.base.models.qweb.QWebException: Expected singleton: account.move(1, 2)
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/api.py", line 789, in get
field_cache = field_cache[record.env.cache_key(field)]
KeyError: ('en_US',)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/fields.py", line 970, in __get__
value = env.cache.get(record, self)
File "/opt/odoo14/odoo/odoo/api.py", line 793, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'account.move(1,).amount_in_words'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/models.py", line 4988, in ensure_one
_id, = self._ids
ValueError: too many values to unpack (expected 1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo14/odoo/odoo/addons/base/models/qweb.py", line 331, in _compiled_fn
return compiled(self, append, new, options, log)
File "<template>", line 1, in template_account_report_invoice_document_3126
File "<template>", line 2, in body_call_content_3124
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_qweb.py", line 380, in _get_field
content = converter.record_to_html(record, field_name, field_options)
File "/opt/odoo14/odoo/odoo/addons/base/models/ir_qweb_fields.py", line 128, in record_to_html
value = record[field_name]
File "/opt/odoo14/odoo/odoo/models.py", line 5666, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/opt/odoo14/odoo/odoo/fields.py", line 1019, in __get__
self.compute_value(recs)
File "/opt/odoo14/odoo/odoo/fields.py", line 1175, in compute_value
records._compute_field_value(self)
File "/opt/odoo14/odoo/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
return super()._compute_field_value(field)
File "/opt/odoo14/odoo/odoo/models.py", line 4061, in _compute_field_value
getattr(self, field.compute)()
File "/opt/odoo14/odoo-custom-addons/bi_translate_amount/models/account_invoice.py", line 18, in _amount_in_words
num = self.amount_total
File "/opt/odoo14/odoo/odoo/fields.py", line 963, in __get__
record.ensure_one()
File "/opt/odoo14/odoo/odoo/models.py", line 4991, in ensure_one
raise ValueError("Expected singleton: %s" % self)
ValueError: Expected singleton: account.move(1, 2)
Error to render compiling AST
ValueError: Expected singleton: account.move(1, 2)
Template: account.report_invoice_document
Path: /t/t/div/div[2]/div[2]/p/span
Node: <span class="m-0" t-field="o.amount_in_words"/>

Message and communication history