【问题标题】:odoo / OpenERP V8 - template lost for the QWEB reportsodoo / OpenERP V8 - QWEB 报告的模板丢失
【发布时间】:2015-04-22 16:49:27
【问题描述】:

系统: 奥多 V8。

问题: 在上一个 PDF 订单 上,我发现不知何故没有应用模板。 (只有扁平丑陋的文字) 所有字段都在这里,包括页脚但页眉不在这里,也没有应用样式或图片(在以前的报告中默认情况下) 所有 PDF 报告都发生了同样的情况,所以我想我以某种方式更改或取消了模板。我该如何解决?

之前: 安装后一切正常。基本模板已应用,适用于销售和采购 PDF 文件。

更新: 公司设置中模型的内容(设置=>报告选项卡下的公司)是正确的(当我预览页面时一切正常)

external_layout qview 是:

<?xml version="1.0"?>
<t t-name="report.external_layout">
    <!-- Multicompany -->
    <t t-if="o and 'company_id' in o">
        <t t-set="company" t-value="o.company_id"/>
    </t>
    <t t-if="not o or not 'company_id' in o">
        <t t-set="company" t-value="res_company"/>
    </t>

    <t t-call="report.external_layout_header"/>
    <t t-raw="0"/>
    <t t-call="report.external_layout_footer"/>
</t>

external_layout_header qview 是(我们可以清楚地看到对 RML 标头的调用,这是预期的):

<?xml version="1.0"?>
<t t-name="report.external_layout_header">
    <div class="header">
        <div class="row">
            <div class="col-xs-3">
                <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>
            </div>
            <div class="col-xs-9 text-right" style="margin-top:20px;" t-field="company.rml_header1"/>
        </div>
        <div class="row zero_min_height">
            <div class="col-xs-12">
                <div style="border-bottom: 1px solid black;"/>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-3">
                <div t-field="company.partner_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}" style="border-bottom: 1px solid black;"/>
            </div>
        </div>
    </div>
</t>

页脚和页眉似乎都包含在内。但所有 PDF 报告的结果是: - 没有标题 - 内容还可以(但没有字体和样式) - 页脚正常(但没有字体和样式)

谢谢

【问题讨论】:

  • 当我在 external_layout 中删除对页脚的调用时,它不会显示在报告中。这意味着 external_layout 被正确地称为模板。
  • 无论我在 external_layout_header 中更改什么

标签: templates styles report odoo qweb


【解决方案1】:

你好斯蒂芬·坦皮尼,

请阅读这篇文章

Click to See the Answer for your questioned post References

我希望这对你有帮助..:)

【讨论】:

  • 您好,谢谢您的回答。我检查了链接。我的模板在公司设置中没问题。但它没有被应用。我将检查 QView 的外部报告并检查 QView 是否正常。
  • 新数据库检查是否相同??
  • 是的。你可以查看我对这个问题的回答。它与 web.base.url 相关
【解决方案2】:

我发现我的问题和这个类似:https://github.com/odoo/odoo/issues/1105

这是由于 web.base.url 值不同,具体取决于在一个地方或另一个地方工作。然后我只是将它修复为最常见的值,并且不得不忘记在一些带有隧道的计算机上工作。 检查详细信息以修复值:https://bugs.launchpad.net/openobject-server/+bug/1295022

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多