[IMP] survey: code review

bzr revid: qdp-launchpad@openerp.com-20121023223358-vqey57o52eyi6fhf
This commit is contained in:
Quentin (OpenERP) 2012-10-24 00:33:58 +02:00
parent b8756e6606
commit 9c712d5336
2 changed files with 6 additions and 5 deletions

View File

@ -77,7 +77,7 @@ class survey(osv.osv):
'tot_comp_survey': lambda * a: 0,
'send_response': lambda * a: 1,
'response_user': lambda * a:1,
'date_open': strftime("%Y-%m-%d %H:%M:%S"),
'date_open': fields.datetime.now,
}
def survey_open(self, cr, uid, ids, arg):

View File

@ -64,7 +64,7 @@ class survey_send_invitation(osv.osv_memory):
msg = ""
name = ""
for sur in survey_obj.browse(cr, uid, context.get('active_ids', []), context=context):
name += "\t --> " + sur.title + "\n"
name += "\n --> " + sur.title + "\n"
if sur.state != 'open':
msg += sur.title + "\n"
data['mail_subject'] = _("Invitation for %s") % (sur.title)
@ -74,11 +74,12 @@ class survey_send_invitation(osv.osv_memory):
raise osv.except_osv(_('Warning!'), _('The following surveys are not in open state: %s') % msg)
data['mail'] = _('''
Hello %%(name)s, \n\n
Please find hereby a survey that we would like you to fill: %s\n
Would you please spent some of your time to fill-in our survey: \n%s\n
You can access this survey with the following parameters:
Your login ID: %%(login)s,\n
URL: %s
Your login ID: %%(login)s\n
Your password: %%(passwd)s\n
%s\n\n
\n\n
Thanks,''') % (name, self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='http://localhost:8069', context=context))
return data