How we can update dictionary in python ?
"update" key is not working in qweb.
<t t-set="my_dict" t-value="{}"/>
<t t-foreach="['name'] t-as="key">
<t t-foreach="['abc', 20] t-as="value">
<t t-set="my_dict" t-value="my_dict.update({key:value})"/>
</t>
</t>
<span t-esc="my_dict"/>
my_dict is display none.
you should write the function the python code and call it back in the xml Example: - python: from openerp.report import report_sxw from openerp.osv import osv class example_class(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(sale_common, self).__init__( cr, uid, name, context=context) self.localcontext.update({ 'update_your_dict': self.update_your_dict }) def update_your_dict(self, o): # your source code here return true - xml: Demo Function Python:
Thanks Anh Vu But I have to do in xml file not in py file.