From c42b345a9005563e825e042dccaaff42fc02373b Mon Sep 17 00:00:00 2001 From: "Richard Mathot (OpenERP)" Date: Mon, 6 Jan 2014 09:47:08 +0100 Subject: [PATCH] [REF] Code cleaning bzr revid: rim@openerp.com-20140106084708-7yot3pjkfbezd6f8 --- .../wizard/survey_email_compose_message.py | 32 +++---- .../wizard/survey_email_compose_message.xml | 86 ++++++++----------- 2 files changed, 53 insertions(+), 65 deletions(-) diff --git a/addons/survey/wizard/survey_email_compose_message.py b/addons/survey/wizard/survey_email_compose_message.py index b6773d6c9ac..77f98ac68e3 100644 --- a/addons/survey/wizard/survey_email_compose_message.py +++ b/addons/survey/wizard/survey_email_compose_message.py @@ -37,7 +37,6 @@ class survey_mail_compose_message(osv.TransientModel): _log_access = True def _get_public_url(self, cr, uid, ids, name, arg, context=None): - """ Compute if the message is unread by the current user. """ res = dict((id, 0) for id in ids) survey_obj = self.pool.get('survey.survey') for wizard in self.browse(cr, uid, ids, context=context): @@ -45,7 +44,7 @@ class survey_mail_compose_message(osv.TransientModel): return res def _get_public_url_html(self, cr, uid, ids, name, arg, context=None): - """ Compute if the message is unread by the current user. """ + """ Compute if the message is unread by the current user """ urls = self._get_public_url(cr, uid, ids, name, arg, context=context) for key, url in urls.items(): urls[key] = '%s' % (url, _("Click here to start survey")) @@ -53,9 +52,9 @@ class survey_mail_compose_message(osv.TransientModel): _columns = { 'survey_id': fields.many2one('survey.survey', 'Survey', required=True), - 'public': fields.selection([('public_link', 'Share the public web link to your audience.'), \ - ('email_public_link', 'Send by email the public web link to your audience.'),\ - ('email_private', 'Send private invitation to your audience (only one response per recipient and per invitation).')], + 'public': fields.selection([('public_link', 'Share the public web link to your audience.'), + ('email_public_link', 'Send by email the public web link to your audience.'), + ('email_private', 'Send private invitation to your audience (only one response per recipient and per invitation).')], string='Share options', required=True), 'public_url': fields.function(_get_public_url, string="Public url", type="char"), 'public_url_html': fields.function(_get_public_url_html, string="Public HTML web link", type="char"), @@ -71,7 +70,7 @@ class survey_mail_compose_message(osv.TransientModel): _defaults = { 'public': 'email_private', - 'survey_id': lambda self,cr,uid,ctx={}: ctx.get('model') == 'survey.survey' and ctx.get('res_id') or None, + 'survey_id': lambda self, cr, uid, ctx={}: ctx.get('model') == 'survey.survey' and ctx.get('res_id') or None } def default_get(self, cr, uid, fields, context=None): @@ -122,7 +121,7 @@ class survey_mail_compose_message(osv.TransientModel): def send_mail(self, cr, uid, ids, context=None): """ Process the wizard content and proceed with sending the related - email(s), rendering any template patterns on the fly if needed. """ + email(s), rendering any template patterns on the fly if needed """ if context is None: context = {} @@ -168,15 +167,14 @@ class survey_mail_compose_message(osv.TransientModel): token = uuid.uuid4().__str__() # create response with token survey_response_obj.create(cr, uid, { - 'survey_id': wizard.survey_id.id, - 'deadline': wizard.date_deadline, - 'date_create': datetime.now(), - 'type': 'link', - 'state': 'new', - 'token': token, - 'partner_id': partner_id, - 'email': email, - }) + 'survey_id': wizard.survey_id.id, + 'deadline': wizard.date_deadline, + 'date_create': datetime.now(), + 'type': 'link', + 'state': 'new', + 'token': token, + 'partner_id': partner_id, + 'email': email}) return token for wizard in self.browse(cr, uid, ids, context=context): @@ -220,3 +218,5 @@ class survey_mail_compose_message(osv.TransientModel): create_response_and_send_mail(wizard, token, partner['id'], partner['email']) return {'type': 'ir.actions.act_window_close'} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/survey/wizard/survey_email_compose_message.xml b/addons/survey/wizard/survey_email_compose_message.xml index c9aa7539ecd..7f5cafcf78e 100644 --- a/addons/survey/wizard/survey_email_compose_message.xml +++ b/addons/survey/wizard/survey_email_compose_message.xml @@ -1,39 +1,27 @@ - - + Survey - Send by Email - - - -

Hello,

-

We are conducting a survey, and your response would be appreciated.

-

Please, click here to start survey

-

Thanks for your participation!

- -]]>
+ + + + +

Hello,

+

We are conducting a survey, and your response would be appreciated.

+

Please, click here to start survey

+

Thanks for your participation!

+ + ]]> +
- - + + - + survey.mail.compose.message.form survey.mail.compose.message @@ -44,33 +32,36 @@ - - + +
-

You can share your survey web public link and/or send private invitations to your audience. People can answer once per invitation, and whenever they want with the public web link.

-

Copy, paste and share the web link below to your audience.

- -

Copy and paste the HTML code below to add this web link to any webpage:

- + You can share your survey web public link and/or send private invitations to your audience.
+ People can response once per invitation, and whenever they want with the public web link.
+
Copy, paste and share the web link below to your audience.
+
+ +
+
Copy and paste the HTML code below to add this web link to any webpage.
+
- - + +
-
-
@@ -78,22 +69,19 @@