Odoo Help


Replace all Qweb template using inheritance

Yassine TEIMI
on 12/9/15, 6:24 AM 3,178 views

I'm working on the survey module, especially on the survey_result.xml file containing all the templates results. I want to change the whole result_matrix template code (the result displayed for all matrix question type) using inheritance. 

So I used :

<template name="matrix_result_extended" inherit_id="survey.result_ matrix">
<xpath expr="." position="replace">
<!-- custom code here to replace all template code -->

But it seems that it doesn't work, because the parent result_matrix is not recognized by the qweb engine anymore when trying to render the survey results.

Is there a clean way to replace all code template by a completely new one ? 



| 6 5 7
Lodz, Poland

On 12/9/15, 2:59 PM

You redefine the full template with the same id="survey.result_matrix" and without inherit_id  (and with depends in __openerp__.py)

And I do this redefinition on the survey module, not on a custom module ?

Yassine TEIMI
on 12/10/15, 3:35 AM

I think you mean redefine on a custom module "survey_extension" for example, with the same id="survey.result_matrix", and on the survey module __openerp__.py file add "survey_extension" on depends option. Is that correct ?

Yassine TEIMI
on 12/10/15, 3:52 AM

Yes, I mean custom module.

on 12/12/15, 7:30 AM

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 12/9/15, 6:24 AM
Seen: 3178 times
Last updated: 12/12/15, 8:03 AM