Skip to Content
Menu
This question has been flagged
3 Replies
1682 Views

I want to print a Quotation / Order report and it displays an error, but only in the Spanish language, if I change it to another language everything works correctly. This happens in any Community and Enterprise version


Error:
Odoo Server Error

Traceback (most recent call last):
  File "/home/odoo/src/odoo/14.0/addons/web/controllers/main.py", line 2125, in report_download
    report_name = safe_eval(report.print_report_name, {'object': obj, 'time': time})
  File "/home/odoo/src/odoo/14.0/odoo/tools/safe_eval.py", line 328, in safe_eval
    c = test_expr(expr, _SAFE_OPCODES, mode=mode)
  File "/home/odoo/src/odoo/14.0/odoo/tools/safe_eval.py", line 184, in test_expr
    code_obj = compile(expr, "", mode)
  File "<string>", line 2
    object.state == 'draft' and ‘Presupuesto de Reparación - %s' % (object.name) or
                                           ^
SyntaxError: invalid character in identifier

Avatar
Discard
Best Answer

Same is in german in the Angebot / Auftrag printing. There are the words "und" and "oder" they must be replaced by "and" and "or" as mentioned in the solution of Uzziel Contreras.

The error you get:

(object.state in ('draft', 'sent') und 'Angebot - %s' % (object.name)) oder 'Auftrag - %s' % (object.name)

Change it to:

(object.state in ('draft', 'sent') and 'Angebot - %s' % (object.name)) or 'Auftrag - %s' % (object.name)

Avatar
Discard
Author Best Answer

RESOLVED: Thank you so much!, it helped me a lot, to solve it carry out the following procedure:
1.- Activate the programmer mode.
2.- Go to Settings / Technical / Actions / Reports
3.- Search for "Presupuesto", select the report and open
4.- Edit the value "Printed report name" by:

(object.state in ('draft', 'sent') and 'Presupuesto - %s' % (object.name)) or 'Pedido - %s' % (object.name)

Apparently the code in Spanish for Odoo version 14 has an error.

Avatar
Discard
Best Answer

In this case it looks like a formatting error in the spanish translation. You can revert to the spanish Transifex translation team and/or correct the translation of the translated terms under Settings/Languages.

Avatar
Discard