~openerp-community-leaders/poweremail/poweremail-github-mirror

« back to all changes in this revision

Viewing changes to serveraction.py

  • Committer: Sharoon Thomas
  • Date: 2012-04-20 11:12:10 UTC
  • mfrom: (237.1.2)
  • Revision ID: git-v1:903e8c8b76ec0d2150336cc2dec07aac18e0537a
Merge pull request #21 from eLBati/dev

[FIX] allowing multiple templates to be associated to the same model

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
        for action in self.browse(cr, uid, ids, context):
72
72
            obj_pool = self.pool.get(action.model_id.model)
73
 
            obj = obj_pool.browse(cr, uid, context['active_id'], context=context)
74
73
            cxt = {
75
74
                'context':context,
76
 
                'object': obj,
77
75
                'time':time,
78
76
                'cr': cr,
79
77
                'pool' : self.pool,
80
78
                'uid' : uid
81
79
            }
 
80
            if context.get('active_id', False):
 
81
                obj = obj_pool.browse(cr, uid, context['active_id'], context=context)
 
82
                cxt['object'] = obj
82
83
            expr = eval(str(action.condition), cxt)
83
84
            if not expr:
84
85
                continue