【问题标题】:How to edit default Header of the invoice Qweb reports . Odoo 14如何编辑发票 Qweb 报告的默认标题。奥多 14
【发布时间】:2021-03-01 11:18:10
【问题描述】:

我正在使用 Odoo 14,我想自定义“report_invoice_document”的标题。 我尝试添加此代码:

<?xml version="1.0" encoding="utf-8"?>
  <odoo>
     <data>
       <template id="report_invoice_extend" inherit_id="account.report_invoice_document">
        <t t-call="my_module.external_layout_footer_inherit_cr">
    
        </t>
     </template>
    </data>
 </odoo>


<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="external_layout_footer_inherit_cr"
            inherit_id="report.external_layout_footer">
            <xpath expr="//div[@class='footer']" position="replace">
                <div class="footer">
                    <span>Test</span>
                </div>
            </xpath>
        </template>
</odoo>

但我收到了这个错误:

raise ValueError(formatted_message).with_traceback(from_traceback) from from_exception odoo.exceptions.ValidationError: Error while validating view:

Element '<t t-call="my_module.external_layout_footer_inherit_cr">' cannot be located in parent view

我的代码有什么问题?请帮忙。

【问题讨论】:

  • 如果要制作自定义抬头发票,必须在body类中添加data-oe-model和data-oe-id。
  • @Aung Ko Ko Lin,你能举个例子吗?
  • @Obay Abd-Algader,我编辑了帖子,我尝试了链接中的解决方案,但出现以下错误:元素 '' 不能位于父视图中

标签: javascript python xml odoo


【解决方案1】:

举个例子

<div class="article page" t-attf-data-oe-model="account.move" t-attf-data-oe-id="{{o.id}}" t-attf-style="color:{{style.text_color}} !important;font-size:{{int(style.body_font)}}px !important;font-family:{{style.font_family}} !important;">
</div>

【讨论】:

    猜你喜欢
    • 2021-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-11
    相关资源
    最近更新 更多