Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Can we override a report template rather than inherit it?

By
Pascal Tremblay
on 2/16/15, 1:18 PM 1,347 views

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....

0
Ryan Cole
On 3/23/16, 7:57 PM

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??

0

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 3/1/15, 7:01 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/16/15, 1:18 PM
Seen: 1347 times
Last updated: 3/23/16, 7:57 PM