I have the following Snippet code :
<template id="snippet_colact_id" name="ColAct snippet">
<section class="oe_snippet_body snippet_colact_id">
<h3>Actions</h3>
<div t-esc="res_company.textHarvey()"/>
<div t-set="teachers" t-value="res_company.menusHarvey()"/>
<t t-foreach="teachers" t-as="teacher">
<p><t t-esc="teacher.id"/> <t t-esc="teacher.name"/></p>
</t>
</section>
</template>
class res_company(models.Model):
def textHarvey(req):
return "hello harvey"
def menusHarvey(req):
id_colacts = openerp.pooler.get_pool(http.request.cr.dbname).get('a_colact_collaborativeaction').search(http.request.cr, http.request.uid, [])
colacts = openerp.pooler.get_pool(http.request.cr.dbname).get('a_colact_collaborativeaction').browse(http.request.cr, http.request.uid, id_colacts)
return colacts
When I drag my snippet onto the page the values are correctly extracted from the DB, but when I later change the values in Odoo and then refersh the page the values don't change. It looks like the values are retrieved when the Snippet is dropped onto the page and that they never change after?
Great ! That worked (copying my code into the HTML editor)... it's a shame the designer doens't just leave the Snippet as it is all the same...