openerp - QWebException: "'NoneType' object has no attribute 'with_context'" while evaluating "doc.with_context({'lang':doc.partner_id.lang})" -
i new odoo, created module inheriting sales_order create custom report. getting above error when printing report. need please?
here code snippets:
test/my_module.py:
class sale_order(models.model): _name = 'sale.order' _description = 'inheritance' _inherit = 'sale.order'
test/views/report_template_view.xml:
<?xml version="1.0" encoding="utf-8"?> <openerp> <data> <template id="test_report"> <t t-call="report.html_container"> <t t-call="report.internal_layout"> <t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})"/> <div class="page"> <div class="oe_structure"/> <div> <strong><left>user</left></strong> <p t-field="doc.user_id"/> </div> </div> </t> </t> </template> </data>
how can access records in custom_report_template
?
i know i'm late name of variable containing recordset passed template docs not doc. , trying value variable don't have anything.
doc.with_context({'lang':doc.partner_id.lang})
i think need docs
not doc
because doc
none
why template in loop docs :
<t t-foreach="docs" t-as="o">
Comments
Post a Comment