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

Replace all Qweb template using inheritance

By
Yassine TEIMI
on 12/9/15, 6:24 AM 1,353 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 -->
</xpath>
</template>


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 ? 
 

0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


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

zbik
on 12/12/15, 7:30 AM

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: 12/9/15, 6:24 AM
Seen: 1353 times
Last updated: 12/12/15, 8:03 AM