Odoo Help


Inject data/variables into website controller

Jérémy Hermand
on 3/27/15, 6:49 AM 1,141 views


In my website I would like to have a customer list above my footer. I'd like a dynamic list.

How I can inject my customers for every website controller ?

Thank you



J'aimerais sur mon site internet rajouter la liste des clients au dessus du footer.

Pour se faire il faudrait que je rajoute aux controlleurs du site web cette liste, comment je peux faire pour rajouter des variables aux controllers (sorte de variables globales) ?


Jérémy Hermand
On 3/28/15, 6:52 AM

I have founded a solution for inject data in view, is it a good solution ?

# -*- coding: utf-8 -*-

from openerp import SUPERUSER_ID
from openerp.http import request
from openerp.osv import osv, fields

class view(osv.osv):
_inherit = "ir.ui.view"

def render(self, cr, uid, id_or_xml_id, values=None, engine='ir.qweb', context=None):
if request and getattr(request, 'website_enabled', False):
if values == None:
values = {}
              values['test'] = 'data to inject'

return super(view, self).render(cr, uid, id_or_xml_id, values=values, engine=engine, context=context)

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: 3/27/15, 6:49 AM
Seen: 1141 times
Last updated: 3/28/15, 6:52 AM