Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5194 Vizualizări

I want to display separator for the 'Quantity' field in the report. It works fine for the amount. Here is the code for it: t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}' .

Now, If I use the same code  with removing  "display currency" key from above code (because Quantity does not need to show currency symbol) then it gives me the error while printing report:

display = self.pool['ir.qweb'].eval_object(options['display_currency'], qwebcontext)

QWebException: "display_currency" while evaluating

"translate_doc(doc_id, doc_model, 'partner_id.lang', 'account.report_invoice_document')"


If I use with "display_currency" key then it prints without error but the problem is currency symbol in Quantity field. Is there any way to display separator in PDF?

Imagine profil
Abandonează
Autor Cel mai bun răspuns

I did it with formatLang function. I made following changes:

in XML:

<span t-esc="formatLang(l.product_qty),digits=1)"/>  (digits=1 is used to display 1 digit after decimal.)

in py:

from openerp.report import report_sxw

class report_invoice_report(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context):
        super(report_invoice_report, self).__init__(cr, uid, name, context)

class wrapped_report_contribution_register(osv.AbstractModel):
    _name = 'report.account.report_invoice'
    _inherit = 'report.abstract_report'
    _template = 'account.report_invoice'
    _wrapped_report_class = report_invoice_report



Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
sept. 23
7011
0
sept. 23
29
0
sept. 22
2743
0
sept. 24
1432
PDF reports Rezolvat
5
iul. 25
2194