[FIX] email_template: check if context is None
bzr revid: olt@tinyerp.com-20100727113321-n65pyrn7di0krwi1
This commit is contained in:
parent
016a061b1b
commit
d67d7487e5
|
@ -68,6 +68,8 @@ class email_template_send_wizard(osv.osv_memory):
|
|||
return template
|
||||
|
||||
def _get_template_value(self, cr, uid, field, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
template = self._get_template(cr, uid, context)
|
||||
if not template:
|
||||
return False
|
||||
|
@ -119,6 +121,8 @@ class email_template_send_wizard(osv.osv_memory):
|
|||
}
|
||||
|
||||
def fields_get(self, cr, uid, fields=None, context=None, write_access=True):
|
||||
if context is None:
|
||||
context = {}
|
||||
result = super(email_template_send_wizard, self).fields_get(cr, uid, fields, context, write_access)
|
||||
if 'attachment_ids' in result and 'src_model' in context:
|
||||
result['attachment_ids']['domain'] = [('res_model','=',context['src_model']),('res_id','=',context['active_id'])]
|
||||
|
@ -165,6 +169,8 @@ class email_template_send_wizard(osv.osv_memory):
|
|||
else:
|
||||
return value
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
mail_ids = []
|
||||
template = self._get_template(cr, uid, context)
|
||||
for id in context['src_rec_ids']:
|
||||
|
|
Loading…
Reference in New Issue