puts profile on email condition instead of fetchmail server

This commit is contained in:
florian-dacosta 2014-12-15 10:33:58 +01:00
parent 95274049ce
commit 01a9e55a3b

View File

@ -63,13 +63,8 @@ class file_document(orm.Model):
content_subtype=content_subtype, content_subtype=content_subtype,
**kwargs) **kwargs)
def _get_file_document_data(self, cr, uid, condition, msg, att, context=None):
def prepare_data_from_basic_condition(self, cr, uid, condition, msg, context=None): values = {
vals = {}
if condition.from_email in msg['from'] and condition.mail_subject in msg['subject']:
for att in msg['attachments']:
if condition.file_extension in att[0]:
vals = {
'file_type': condition.server_id.file_type, 'file_type': condition.server_id.file_type,
'name': msg['subject'], 'name': msg['subject'],
'direction': 'input', 'direction': 'input',
@ -78,6 +73,14 @@ class file_document(orm.Model):
'datas_fname': att[0], 'datas_fname': att[0],
'datas': base64.b64encode(att[1]) 'datas': base64.b64encode(att[1])
} }
return values
def prepare_data_from_basic_condition(self, cr, uid, condition, msg, context=None):
vals = {}
if condition.from_email in msg['from'] and condition.mail_subject in msg['subject']:
for att in msg['attachments']:
if condition.file_extension in att[0]:
vals = self._get_file_document_data(cr, uid, condition, msg, att, context=context)
break break
return vals return vals