跳至內容
選單
此問題已被標幟
2 回覆
14797 瀏覽次數

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
3313
1
3月 23
3526
0
7月 22
1912
Inherit Qweb 已解決
4
2月 24
48119
0
5月 22
3340