跳至内容
菜单
此问题已终结
2 回复
14758 查看

Hello everybody,

Usually, I use this code to inherit a report template in my own modules.

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <template id="report_saleorder_document_custom" inherit_id="sale.report_saleorder_document">
            <xpath expr="//div[@class='page']" position="replace">

..........

 

This new template id=report_saleorder_document_custom inherit sale.report_saleorder_document template. Ok.

But could we just OVERRIDE sale.report_saleorder_document rather than inherit it?

 

Thanks....

形象
丢弃
最佳答案

Hi, I'm posting this as an answer because my Karma level does not allow me to comment. 

@Pascal Tremblay; I've tried the code you provided (on a different template - website_portal.my_account_link), but it causes a "Invalid view definition" error in Odoo. 

Is there a good way to override a <template> definition from another module??

形象
丢弃
编写者 最佳答案

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <template id="sale.report_saleorder_document">
            <xpath expr="//div[@class='page']" position="replace">

形象
丢弃
相关帖文 回复 查看 活动
0
3月 15
3286
1
3月 23
3471
0
7月 22
1872
Inherit Qweb 已解决
4
2月 24
48042
0
5月 22
3306