无法在odoo 8中创建自定义报告

时间:2015-08-18 17:25:58

标签: odoo odoo-8 qweb

从openErp 7迁移后,我试图在odoo 8中创建自己的自定义报告。 我已经关注this tutorial但是我在第一步遇到第3步时从服务器获取错误,并带有以下跟踪

 <div ng-repeat="place in places">
     <leaflet id="map{{ $index }}" defaults="defaults" center="center" markers="markers'{{ $index }}'"></leaflet>
 </div>

这看起来类似于this SO question,到目前为止,答案对于一个不是非常蟒蛇的编码器来说并不是很有帮助...

1 个答案:

答案 0 :(得分:0)

您是否阅读了Odoo Documentation for QWeb Reports

<!-- Report "Human readable name" document template -->
<record id="view_model_document_qweb" model="ir.ui.view">
    <field name="name">Human readable name</field>
    <field name="model">model</field>
    <field name="type">qweb</field>
    <field name="mode">primary</field>
    <field name="priority" eval="16" />
    <field name="active" eval="True" />
    <field name="arch" type="xml">
        <t t-name="module.view_model_document_qweb">
            <t t-call="report.external_layout">
                <div class="page">
                    <h2>Report title</h2>
                    <p>This object's name is <span t-field="o.name"/></p>
                </div>
            </t>
        </t>
    </field>
</record>

<!-- Report "Human readable name" translate_doc template -->
<record id="view_model_qweb" model="ir.ui.view">
    <field name="name">Human readable name</field>
    <field name="model">model</field>
    <field name="type">qweb</field>
    <field name="mode">primary</field>
    <field name="priority" eval="16" />
    <field name="active" eval="True" />
    <field name="arch" type="xml">
        <t t-name="module.view_model_qweb">
            <t t-call="report.html_container">
                <t t-foreach="doc_ids" t-as="doc_id">
                    <t t-raw="translate_doc(doc_id, doc_model, 'lang', 'module.view_model_document_qweb')"/>
                </t>
            </t>
        </t>
    </field>
</record>

<!-- Report action to show: "Human readable name" -->
<record id="action_report_human_readable_name" model="ir.actions.report.xml">
    <field name="name">Human readable name</field>
    <field name="model">model</field>
    <field name="report_type">qweb-pdf</field>
    <field name="report_name">module.view_model_qweb</field>
    <field name="attachment_use" eval="True" />
    <field name="attachment">(object.name+'.pdf')</field>
    <field name="paperformat_id" ref="report.paperformat_euro" />
    <field name="help">Something about Human readable name</field>
</record>

<!-- Button to print the report: "Human readable name" -->
<record id="human_readable_name_values" model="ir.values">
    <field name="name">Human readable name</field>
    <field name="model_id" ref="module.model_model" />
    <field name="model">model</field>
    <field name="value" eval="'ir.actions.report.xml,' +str(ref('action_report_human_readable_name'))" />
    <field name="key">action</field>
    <field name="key2">client_print_multi</field>
</record>

我从here

带来了摘录