Permalink
Browse files

IMP Passem vals al context per l'active filter

  • Loading branch information...
1 parent 94b6a99 commit c8dfa9081cfc8ed4927823158286beedda4c7d9f @ecarreras ecarreras committed Apr 17, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 poweremail_template.py
@@ -83,12 +83,15 @@ def send_on_create(self, cr, uid, vals, context=None):
def send_on_write(self, cr, uid, ids, vals, context=None):
+ if not context:
+ context = {}
result = self.old_write(cr, uid, ids, vals, context)
for tid in self.template_hooks['sow']:
template = self.pool.get('poweremail.templates').browse(cr, uid, tid,
context)
# Ensure it's still configured to send on write
if template.send_on_write:
+ context['vals'] = vals.copy()
self.pool.get('poweremail.templates').generate_mail(cr, uid, tid,
ids, context)
return result

0 comments on commit c8dfa90

Please sign in to comment.