3
我是odoo的新手,我通過繼承sales_order創建了一個模塊創建自定義報告。我在打印報告時遇到上述錯誤。需要幫助嗎?QWebException:「NoneType」對象在評估「doc.with_context({'lang':doc.partner_id.lang})時沒有屬性'with_context'」「
以下是代碼片段:
測試/ my_module.py:
class sale_order(models.Model):
_name = 'sale.order'
_description = 'Inheritance'
_inherit = 'sale.order'
測試/視圖/ 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>
如何訪問記錄在custom_report_template
?
我也想知道。你有沒有發現? – user568021