[IMP] improve code
bzr revid: fka@tinyerp.com-20121003103524-j480eazwonxu1g4y
This commit is contained in:
@@ -50,7 +50,6 @@ class survey_send_invitation(osv.osv_memory):
|
||||
_defaults = {
|
||||
'send_mail': lambda *a: 1,
|
||||
'send_mail_existing': lambda *a: 1,
|
||||
'mail_from': lambda *a: tools.config['email_from']
|
||||
}
|
||||
|
||||
def genpasswd(self):
|
||||
@@ -68,13 +67,14 @@ class survey_send_invitation(osv.osv_memory):
|
||||
name += "\t --> " + sur.title + "\n"
|
||||
if sur.state != 'open':
|
||||
msg += sur.title + "\n"
|
||||
data['mail_subject'] = "Invitation for " + sur.title
|
||||
data['mail_subject_existing'] = "Invitation for " + sur.title
|
||||
data['mail_from'] = sur.responsible_id.email
|
||||
if msg:
|
||||
raise osv.except_osv(_('Warning!'), _('%sSurvey is not in open state') % msg)
|
||||
data['mail'] = '''Hello %(name)s, \n\n We are inviting you for following survey. \
|
||||
\n ''' + name + '''\n Your login ID: %(login)s, Your password: %(passwd)s
|
||||
\n link :- http://'''+ str(socket.gethostname()) + ''':8080 \n\n Thanks,'''
|
||||
data['mail_subject'] = "Invitation for " + sur.title
|
||||
data['mail_subject_existing'] = "Invitation for " + sur.title
|
||||
return data
|
||||
|
||||
def create_report(self, cr, uid, res_ids, report_name=False, file_name=False):
|
||||
|
||||
Reference in New Issue
Block a user