我正在尝试创建报告,但我的代码似乎一切正常,但打印报告时出现此错误
这是错误消息的一部分:
File "/opt/odoo8/odoo/addons/report/models/report.py", line 135, in translate_doc
return self.translate_doc(cr, uid, doc_id, model, lang_field, template, values, context=context)
File "/opt/odoo8/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo8/odoo/addons/report/models/report.py", line 106, in translate_doc
doc = self.pool[model].browse(cr, uid, doc_id, context=ctx)
File "/opt/odoo8/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo8/odoo/openerp/models.py", line 5266, in browse
return self._browse(Environment(cr, uid, context or {}), ids)
QWebException: """"""""""""""""""""""""""""""maximum recursion depth exceeded" while evaluating
"translate_doc(doc_id, doc_model, 'user_id.partner_id.lang', 'school_erp.report_printstandard')"" while evaluating
"translate_doc(doc_id, doc_model, 'user_id.partner_id.lang', 'school_erp.report_printstandard')"" while evaluating
"translate_doc(doc_id, doc_model, 'user_id.partner_id.lang', 'school_erp.report_printstandard')"" while evaluating
这是我的代码:
在报告.xml 中:
<template id="report_printstandard">
<t t-call="report.html_container">
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'user_id.partner_id.lang', 'school_erp.report_printstandard')"/>
</t>
</t>
</template>
这是我的模块:
class school_standard(osv.osv):
_name = 'school.standard'
_rec_name = "code"
_columns = {
'name':fields.char('Standard Name', size=256, required=True),
'code':fields.char('Standard Code', size=8, required=True),
'user_id':fields.many2one('res.users', 'User'),
'student_line':fields.one2many('school.student', 'standard_id', 'Students'),
}
def get_uid(self, cr, uid, context=None):
return uid
_defaults = {
'user_id': get_uid,
}
school_standard()
我的代码有什么问题?