[trunk] email_template template preview error

Bug #717376 reported by Denis Konchekov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Low
OpenERP R&D Web Team

Bug Description

Fresh database with marketing modules. I created test template and tried to preview it. In console I had this traceback (I added context variable output for debugging purposes in code):

[2011-02-11 22:42:40,172][email] INFO:root:context: {'lang': u'en_US', 'tz': False, 'search_view': 185, 'active_model': 'email.template', '_terp_view_name': u'Template Preview', 'client': 'web', 'active_ids': [1], 'template_id': 104, 'active_id': 1}
[2011-02-11 22:42:40,173][email] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
  File "/home/kodemi/src/openerp6/server/openerp/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/kodemi/src/openerp6/server/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/kodemi/src/openerp6/server/openerp/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/kodemi/src/openerp6/server/openerp/osv/orm.py", line 1636, in fields_view_get
    xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
  File "/home/kodemi/src/openerp6/server/openerp/osv/orm.py", line 1319, in __view_look_dom_arch
    fields = self.fields_get(cr, user, fields_def.keys(), context)
  File "/home/kodemi/src/openerp6/server/openerp/osv/orm.py", line 1126, in fields_get
    res[f]['selection'] = field_col.selection(self, cr, user, context)
  File "/home/kodemi/src/openerp6/server/openerp/addons/email_template/email_template.py", line 727, in _get_model_recs
    ref_obj_name = self.pool.get('ir.model').read(cr, uid, ref_obj_id['object_name'][0], ['model'], context)['model']
TypeError: 'bool' object is unsubscriptable

In context output you can see, that template_id != active_id, but it must be equal.

Related branches

Revision history for this message
Denis Konchekov (dkonchekov) wrote :

Remark. There is context defenition in email_template.xml in record with id="wizard_email_template_preview":
    <field name="context">{'template_id': active_id}</field>

Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Hello Denis,

I have tested your scenario at my end.
And able to Reproduced it.[See the screenshot]
So, I am confirming this bug.

Thanks.

Changed in openobject-client-web:
assignee: nobody → OpenERP SA's Web Client R&D (openerp-dev-web)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :
Revision history for this message
Chirag Patel (OpenERP) (cpa-openerp) wrote :

Hello Denis Konchekov,

The fix for web-client has been committed to lp:~openerp-dev/openobject-client-web/trunk-bug-715688-sma
 with revision number 4584.

Soon it will be merged into trunk web-client.

Thanks for reporting.

Changed in openobject-client-web:
status: Confirmed → Fix Committed
Changed in openobject-client-web:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.