change name of send_mail to send_email in email_template.

bzr revid: ysa@tinyerp.com-20110202090221-sus0zj8x9thzxn65
This commit is contained in:
YSA (Openerp)
2011-02-02 14:32:21 +05:30
parent 67112d28cd
commit ff7ed1d65d
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -233,7 +233,7 @@ class email_message(osv.osv):
for attid in values['attachments_ids']:
attachment = attachment_pool.browse(cr, uid, attid, context)#,['datas_fname','datas'])
payload[attachment.datas_fname] = attachment.datas
result = account_obj.send_mail(cr, uid,
result = account_obj.send_email(cr, uid,
[values['account_id'][0]],
{'To':values.get('email_to') or u'',
'CC':values.get('email_cc') or u'',
+5 -2
View File
@@ -143,14 +143,17 @@ unless it is already specified in the From Email, e.g: John Doe <john@doe.com>",
def _constraint_unique(self, cr, uid, ids, context=None):
default_ids = self.search(cr, uid, [('default','=',True)])
print "default_ids::",default_ids
if len(default_ids) > 1:
return False
elif not default_ids:
return False
else:
return True
_constraints = [
(_constraint_unique,
'Error: You are not allowed to set default more than 1 account.',
'Error: You must be define one default smtp server account !.',
[])
]
@@ -243,7 +246,7 @@ unless it is already specified in the From Email, e.g: John Doe <john@doe.com>",
return False
#**************************** MAIL SENDING FEATURES ***********************#
def send_mail(self, cr, uid, ids, addresses, subject='', body=None, payload=None, message_id=None, context=None):
def send_email(self, cr, uid, ids, addresses, subject='', body=None, payload=None, message_id=None, context=None):
#TODO: Replace all this with a single email object
if body is None:
body = {}
+1 -1
View File
@@ -3,7 +3,7 @@
<data noupdate="1">
<record id="email_smtp_server_administrator0" model="email.smtp_server">
<field name="name">Administrator</field>
<field eval="0" name="default"/>
<field eval="1" name="default"/>
<field eval="1" name="smtptls"/>
<field name="email_id">example@test.com</field>
<field name="state">draft</field>