AssertionError:Element odoo有额外的内容:report,第7行

时间:2017-07-05 05:55:22

标签: openerp odoo-10

当我尝试在报告代码中提供report_name时,会抛出以下错误: AssertionError: Element odoo has extra content: report, line 7

*。XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>

   <report id="action_report_followup"
   model="account_followup.followup"
   report_name="PPPPPPPPPPpppp" //Here is the problem
   string="Follow-up Report"
   report_type="qweb-pdf"
   name="payment_followup.report_followup"
   file="payment_followup.report_followup"
   menu="True"/>

</odoo>

如果删除属性report_name,它将正常工作,并使用string的值作为报告名称。我需要提供其他名称。我该如何解决这个问题?

2 个答案:

答案 0 :(得分:2)

您在此处尝试使用的属性"report_name"是罪魁祸首。没有"report_name"等属性。请改用属性"name"

请参阅以下示例:

<?xml version="1.0" encoding="utf-8"?>
<odoo>

   <report id="action_report_followup"
   model="account_followup.followup"
   string="Follow-up Report"
   report_type="qweb-pdf"
   name="payment_followup.report_followup"
   file="payment_followup.report_followup"
   menu="True"/>

</odoo>

答案 1 :(得分:2)

你可以尝试一次。

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data>
        <report
            string="Follow-up Report"
            id="action_report_followup"
            model="account_followup.followup"
            report_type="qweb-pdf"
            name="payment_followup.report_followup"
            file="payment_followup.report_followup"
            menu="True"/>
    </data>
</odoo>