This question has been flagged
1 Reply
3890 Views

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?

Avatar
Discard
Author Best Answer

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



Avatar
Discard