From 46f75ca9fa490de22586dfd64b04203ab2a39bc4 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 7 Mar 2023 13:28:56 +0100 Subject: [PATCH 01/15] [ADD] survey_mail_result: New module TT40981 --- survey_result_mail/README.rst | 107 +++++ survey_result_mail/__init__.py | 1 + survey_result_mail/__manifest__.py | 20 + survey_result_mail/data/mail_template.xml | 27 ++ survey_result_mail/models/__init__.py | 2 + survey_result_mail/models/survey_survey.py | 12 + .../models/survey_user_input.py | 50 ++ survey_result_mail/readme/CONFIGURE.rst | 5 + survey_result_mail/readme/CONTRIBUTORS.rst | 3 + survey_result_mail/readme/DESCRIPTION.rst | 2 + survey_result_mail/readme/ROADMAP.rst | 2 + survey_result_mail/readme/USAGE.rst | 4 + .../reports/survey_answer_report.xml | 45 ++ .../static/description/icon.png | Bin 0 -> 6763 bytes .../static/description/index.html | 452 ++++++++++++++++++ .../templates/survey_answer_templates.xml | 411 ++++++++++++++++ .../views/survey_survey_views.xml | 12 + 17 files changed, 1155 insertions(+) create mode 100644 survey_result_mail/README.rst create mode 100644 survey_result_mail/__init__.py create mode 100644 survey_result_mail/__manifest__.py create mode 100644 survey_result_mail/data/mail_template.xml create mode 100644 survey_result_mail/models/__init__.py create mode 100644 survey_result_mail/models/survey_survey.py create mode 100644 survey_result_mail/models/survey_user_input.py create mode 100644 survey_result_mail/readme/CONFIGURE.rst create mode 100644 survey_result_mail/readme/CONTRIBUTORS.rst create mode 100644 survey_result_mail/readme/DESCRIPTION.rst create mode 100644 survey_result_mail/readme/ROADMAP.rst create mode 100644 survey_result_mail/readme/USAGE.rst create mode 100644 survey_result_mail/reports/survey_answer_report.xml create mode 100644 survey_result_mail/static/description/icon.png create mode 100644 survey_result_mail/static/description/index.html create mode 100644 survey_result_mail/templates/survey_answer_templates.xml create mode 100644 survey_result_mail/views/survey_survey_views.xml diff --git a/survey_result_mail/README.rst b/survey_result_mail/README.rst new file mode 100644 index 00000000..5f332703 --- /dev/null +++ b/survey_result_mail/README.rst @@ -0,0 +1,107 @@ +================== +Survey Result Mail +================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsurvey-lightgray.png?logo=github + :target: https://github.com/OCA/survey/tree/13.0/survey_result_mail + :alt: OCA/survey +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/survey-13-0/survey-13-0-survey_result_mail + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/200/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of surveys to allow you to send an automatic +email with the survey answers to the customer as soon as the questionary is completed. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure automatic result sending to the user: + +#. Go to the survey you want to configure. +#. In the *Options* tab, you'll find a new *Send survey answers* option that you can set + on to send an automatic email with the user's answers. + +Usage +===== + +To test this module, you can: + +#. Go to a survey an *Test* it. +#. Once finsished a mail with the aswers attached will be sent. + +Known issues / Roadmap +====================== + +* Hopefully in v15 a refactor of the template can be done to drastically reduce the + code. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_ + + * David Vidal + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px + :target: https://github.com/chienandalu + :alt: chienandalu + +Current `maintainer `__: + +|maintainer-chienandalu| + +This module is part of the `OCA/survey `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/survey_result_mail/__init__.py b/survey_result_mail/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/survey_result_mail/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/survey_result_mail/__manifest__.py b/survey_result_mail/__manifest__.py new file mode 100644 index 00000000..d4cb455b --- /dev/null +++ b/survey_result_mail/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2023 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Survey Result Mail", + "summary": "Send survey answers to the survey user", + "version": "13.0.1.0.0", + "development_status": "Beta", + "category": "Marketing/Survey", + "website": "https://github.com/OCA/survey", + "author": "Tecnativa, Odoo Community Association (OCA)", + "maintainers": ["chienandalu"], + "license": "AGPL-3", + "depends": ["survey"], + "data": [ + "templates/survey_answer_templates.xml", + "reports/survey_answer_report.xml", + "data/mail_template.xml", + "views/survey_survey_views.xml", + ], +} diff --git a/survey_result_mail/data/mail_template.xml b/survey_result_mail/data/mail_template.xml new file mode 100644 index 00000000..d11bb042 --- /dev/null +++ b/survey_result_mail/data/mail_template.xml @@ -0,0 +1,27 @@ + + + + Survey: Result + + Results for your ${object.survey_id.title} survey + ${(object.partner_id.email_formatted or object.email) |safe} + +
+

+ Dear ${object.partner_id.name or 'participant'}

+ + You'll find attached your survey answers so you can review them. + + Thank you for your participation. +

+
+
+ + Survey Results + ${object.partner_id.lang} + + +
+
diff --git a/survey_result_mail/models/__init__.py b/survey_result_mail/models/__init__.py new file mode 100644 index 00000000..8db4d71b --- /dev/null +++ b/survey_result_mail/models/__init__.py @@ -0,0 +1,2 @@ +from . import survey_survey +from . import survey_user_input diff --git a/survey_result_mail/models/survey_survey.py b/survey_result_mail/models/survey_survey.py new file mode 100644 index 00000000..82d10d1b --- /dev/null +++ b/survey_result_mail/models/survey_survey.py @@ -0,0 +1,12 @@ +# Copyright 2023 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class SurveySurvey(models.Model): + _inherit = "survey.survey" + + send_result_mail = fields.Boolean( + help="When the survey is submitted, an email will be sent to the user with" + "the answers" + ) diff --git a/survey_result_mail/models/survey_user_input.py b/survey_result_mail/models/survey_user_input.py new file mode 100644 index 00000000..eecb106e --- /dev/null +++ b/survey_result_mail/models/survey_user_input.py @@ -0,0 +1,50 @@ +# Copyright 2023 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import fields, models +from odoo.tools import format_date, format_datetime + + +class SurveyUserInput(models.Model): + _inherit = "survey.user_input" + + survey_result = fields.Html(compute="_compute_survey_result") + + def _render_user_input(self): + """We're rendering the template results to add them to the pdf report. This + should be easier in v15""" + self.ensure_one() + return ( + self.env["ir.ui.view"] + .sudo() + .render_template( + "survey_result_mail.survey_page_print", + { + "review": True, + "survey": self.survey_id, + "answer": self, + "questions_to_display": self.survey_id.question_ids, + "scoring_display_correction": ( + self.scoring_type == "scoring_with_answers" and self + ), + "format_datetime": lambda dt: format_datetime( + self.env, dt, dt_format=False + ), + "format_date": lambda date: format_date(self.env, date), + }, + ) + ) + + def _compute_survey_result(self): + for user_input in self: + user_input.survey_result = user_input._render_user_input() + + def _mark_done(self): + """Send the answers when submitted on the so configured surveys""" + res = super()._mark_done() + for user_input in self.filtered( + lambda x: x.survey_id.send_result_mail and x.partner_id.email + ): + self.env.ref( + "survey_result_mail.mail_template_user_input_result" + ).send_mail(user_input.id, notif_layout="mail.mail_notification_light") + return res diff --git a/survey_result_mail/readme/CONFIGURE.rst b/survey_result_mail/readme/CONFIGURE.rst new file mode 100644 index 00000000..d6ba24e3 --- /dev/null +++ b/survey_result_mail/readme/CONFIGURE.rst @@ -0,0 +1,5 @@ +To configure automatic result sending to the user: + +#. Go to the survey you want to configure. +#. In the *Options* tab, you'll find a new *Send survey answers* option that you can set + on to send an automatic email with the user's answers. diff --git a/survey_result_mail/readme/CONTRIBUTORS.rst b/survey_result_mail/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..fedc8467 --- /dev/null +++ b/survey_result_mail/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Tecnativa `_ + + * David Vidal diff --git a/survey_result_mail/readme/DESCRIPTION.rst b/survey_result_mail/readme/DESCRIPTION.rst new file mode 100644 index 00000000..ccd0f984 --- /dev/null +++ b/survey_result_mail/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module extends the functionality of surveys to allow you to send an automatic +email with the survey answers to the filler as soon as the questionary is completed. diff --git a/survey_result_mail/readme/ROADMAP.rst b/survey_result_mail/readme/ROADMAP.rst new file mode 100644 index 00000000..cb522e06 --- /dev/null +++ b/survey_result_mail/readme/ROADMAP.rst @@ -0,0 +1,2 @@ +* Hopefully in v15 a refactor of the template can be done to drastically reduce the + code. diff --git a/survey_result_mail/readme/USAGE.rst b/survey_result_mail/readme/USAGE.rst new file mode 100644 index 00000000..9be8ee43 --- /dev/null +++ b/survey_result_mail/readme/USAGE.rst @@ -0,0 +1,4 @@ +To test this module, you can: + +#. Go to a survey an *Test* it. +#. Once finsished a mail with the aswers attached will be sent. diff --git a/survey_result_mail/reports/survey_answer_report.xml b/survey_result_mail/reports/survey_answer_report.xml new file mode 100644 index 00000000..908ae56c --- /dev/null +++ b/survey_result_mail/reports/survey_answer_report.xml @@ -0,0 +1,45 @@ + + + + + + diff --git a/survey_result_mail/static/description/icon.png b/survey_result_mail/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..dc2bf859b076687a2a160a5680d090bc1699e3ab GIT binary patch literal 6763 zcmV-x8kFUUP)*G^uIRrYZcLWl}R|&h+;35D1b+we$X0Rjnq6%)97%WjrYS zf1f^m^uK@m?Y9%R+G?vy8{@~1@1IqA;@4k)J?F2#{_3?=t=6dAJbGMVD=MKY*EjPx zYN3S|QhodOotZ(iN@MKUvDbd{%{PN#Rbnon4NYrWgl54w*IaX{C6-uXWMjmL5g%l( zXMk;5+Ab#yM^Cn388j0c!-o%_kpVKd>x9GEsV zv(ahCYms=(SeRJw)b3$z_muPD0@JoMZA%k#(~V0ny>u4W1h*|s+tO%YBvz#jP0xlV z2c`{8&jx`rTGWgf3nLAB+m@zh0@eYTwx#KrAaM2W1%~@@D4*o{cHXWvDr;PF$tB)V zl0=bh_tbN&k_IM)rD#LbGoZyX24|L!#w=`st_Y$tRy= zm+LF6sTLveuEfU07hlX?8t80G16V%#=p(iL_S>r+cib_m*xPTvU2(UZ0v3R<^wLYK zM3uYt_%X#SZH7*AV~72bWhln{^5ros=xpKTf@Qu1{Q{@17HCJ zfNS;DS7!kO3qzGl#TXJfwo=|4n7S&JLa;c!U|>N#CBVdj`RoXVwk*bV!POmq{PCoP zF)k@Z+q#@pG8QIglBx>E_xybG&8J;}Io1%<(jR~PpnC1?s3rWw%8 zIp>@zI~1kXT5Bz_(7VF}fbEr6UeT_Va$8k9Y8_s~3rrm^LYc4<>#x7Q+H%V+yMyja zx8eQw-&ZfZ@IsfgG>wZcx~THf00%I@lAV82*}P9_L3gJIM~@z@e*XFAE(eVUCKec` z@ULdry4-Thsi8xMb|<};ZcBEST}_!X#ru2;nfnS(QEm=QUC;oQ&p!K1O`kqp4_jSe z1`Qe{7Wx4P9H92!fB)!nC!KVXdh^XUMP;wE&N?a^1Vo>C`|Ya^2NE7WQ0t+y6k92C-&L|77Srz+P429tkq)jrGY z)=yH0y7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!rX#|zEVx@P=Du4M1c?Q6+kgw3vWq3ZY-As5xGys`yW)f&7Rajh z^6nf6yRh^WXz)!*+{crh03F#FG-%L(Y`ejG8Bx8llG?U3vyr!Z8Qc&oOLwpyTuWmv zdYn9YGH&mhnaQAk0}p3b=A!I+uaofq00viM;l?KW5PDB`PX?BlMd2!;)vXe)dBd?} zY(K$WeP;Vfc8k|3*~i>3)WG~dH2;%rOg2&L2F(@ORi^*RHa9JsJy_f5NfIkn%_|X> zofoi}O9-n1UG@2xg|8|fw{Dp$nx1)>kFt*PS~eOy?TRa|_}aYV{{Tq~$q-^buDbvL N002ovPDHLkV1k?Pi^l)} literal 0 HcmV?d00001 diff --git a/survey_result_mail/static/description/index.html b/survey_result_mail/static/description/index.html new file mode 100644 index 00000000..852d5e3a --- /dev/null +++ b/survey_result_mail/static/description/index.html @@ -0,0 +1,452 @@ + + + + + + +Survey Result Mail + + + +
+

Survey Result Mail

+ + +

Beta License: AGPL-3 OCA/survey Translate me on Weblate Try me on Runbot

+

This module extends the functionality of surveys to allow you to send an automatic +email with the survey answers to the customer as soon as the questionary is completed.

+

Table of contents

+ +
+

Configuration

+

To configure automatic result sending to the user:

+
    +
  1. Go to the survey you want to configure.
  2. +
  3. In the Options tab, you’ll find a new Send survey answers option that you can set +on to send an automatic email with the user’s answers.
  4. +
+
+
+

Usage

+

To test this module, you can:

+
    +
  1. Go to a survey an Test it.
  2. +
  3. Once finsished a mail with the aswers attached will be sent.
  4. +
+
+
+

Known issues / Roadmap

+
    +
  • Hopefully in v15 a refactor of the template can be done to drastically reduce the +code.
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

chienandalu

+

This module is part of the OCA/survey project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/survey_result_mail/templates/survey_answer_templates.xml b/survey_result_mail/templates/survey_answer_templates.xml new file mode 100644 index 00000000..fd6c0d38 --- /dev/null +++ b/survey_result_mail/templates/survey_answer_templates.xml @@ -0,0 +1,411 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/survey_result_mail/views/survey_survey_views.xml b/survey_result_mail/views/survey_survey_views.xml new file mode 100644 index 00000000..a85d3ffb --- /dev/null +++ b/survey_result_mail/views/survey_survey_views.xml @@ -0,0 +1,12 @@ + + + + survey.survey + + + + + + + + From 15b6357bf32e4ff0562c85ef5b8a4e07fda102bf Mon Sep 17 00:00:00 2001 From: David Date: Thu, 6 Jul 2023 16:47:04 +0200 Subject: [PATCH 02/15] [MIG] survey_result_mail: Migration to 15.0 TT44285 --- survey_result_mail/README.rst | 33 ++- survey_result_mail/__manifest__.py | 2 +- survey_result_mail/data/mail_template.xml | 43 +++- survey_result_mail/i18n/es.po | 159 ++++++++++++ .../i18n/survey_result_mail.pot | 119 +++++++++ survey_result_mail/models/survey_survey.py | 6 +- .../models/survey_user_input.py | 90 +++++-- survey_result_mail/readme/CONFIGURE.rst | 2 + survey_result_mail/readme/ROADMAP.rst | 2 - .../reports/survey_answer_report.xml | 20 +- .../static/description/index.html | 60 ++--- .../templates/survey_answer_templates.xml | 240 +++++++----------- .../views/survey_survey_views.xml | 4 + 13 files changed, 551 insertions(+), 229 deletions(-) create mode 100644 survey_result_mail/i18n/es.po create mode 100644 survey_result_mail/i18n/survey_result_mail.pot delete mode 100644 survey_result_mail/readme/ROADMAP.rst diff --git a/survey_result_mail/README.rst b/survey_result_mail/README.rst index 5f332703..89793e75 100644 --- a/survey_result_mail/README.rst +++ b/survey_result_mail/README.rst @@ -2,10 +2,13 @@ Survey Result Mail ================== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:54459cf43cc6be2d16ae50918ced3e0c4c694334599675fdfca12834dfa66c91 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -14,19 +17,19 @@ Survey Result Mail :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsurvey-lightgray.png?logo=github - :target: https://github.com/OCA/survey/tree/13.0/survey_result_mail + :target: https://github.com/OCA/survey/tree/15.0/survey_result_mail :alt: OCA/survey .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/survey-13-0/survey-13-0-survey_result_mail + :target: https://translation.odoo-community.org/projects/survey-15-0/survey-15-0-survey_result_mail :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/200/13.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/survey&target_branch=15.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module extends the functionality of surveys to allow you to send an automatic -email with the survey answers to the customer as soon as the questionary is completed. +email with the survey answers to the filler as soon as the questionary is completed. **Table of contents** @@ -41,6 +44,8 @@ To configure automatic result sending to the user: #. Go to the survey you want to configure. #. In the *Options* tab, you'll find a new *Send survey answers* option that you can set on to send an automatic email with the user's answers. +#. You can also choose which mail template to send. This module provides two. One with + the answers inlined and another with the answers attached as pdf report. Usage ===== @@ -50,19 +55,13 @@ To test this module, you can: #. Go to a survey an *Test* it. #. Once finsished a mail with the aswers attached will be sent. -Known issues / Roadmap -====================== - -* Hopefully in v15 a refactor of the template can be done to drastically reduce the - code. - Bug Tracker =========== Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -102,6 +101,6 @@ Current `maintainer `__: |maintainer-chienandalu| -This module is part of the `OCA/survey `_ project on GitHub. +This module is part of the `OCA/survey `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/survey_result_mail/__manifest__.py b/survey_result_mail/__manifest__.py index d4cb455b..2b99c173 100644 --- a/survey_result_mail/__manifest__.py +++ b/survey_result_mail/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Survey Result Mail", "summary": "Send survey answers to the survey user", - "version": "13.0.1.0.0", + "version": "15.0.1.0.0", "development_status": "Beta", "category": "Marketing/Survey", "website": "https://github.com/OCA/survey", diff --git a/survey_result_mail/data/mail_template.xml b/survey_result_mail/data/mail_template.xml index d11bb042..22eb571b 100644 --- a/survey_result_mail/data/mail_template.xml +++ b/survey_result_mail/data/mail_template.xml @@ -1,27 +1,54 @@ - - Survey: Result + + Survey: Results (with report) - Results for your ${object.survey_id.title} survey + Results for your {{object.survey_id.title}} survey ${(object.partner_id.email_formatted or object.email) |safe} + >{{ (object.partner_id.email_formatted or object.email) }}

- Dear ${object.partner_id.name or 'participant'}

+ Dear . +

You'll find attached your survey answers so you can review them. - Thank you for your participation. + + Thanks you for your participation.

Survey Results - ${object.partner_id.lang} + {{object.partner_id.lang}} + +
+ + Survey: Results (inline) + + Results for your {{object.survey_id.title}} survey + {{ (object.partner_id.email_formatted or object.email) }} + +
+

+ Dear . +

+ + Here you have a copy of your answers: +

+

+ +

+

+ Thanks you for your participation. +

+
+
+ {{object.partner_id.lang}} -
diff --git a/survey_result_mail/i18n/es.po b/survey_result_mail/i18n/es.po new file mode 100644 index 00000000..65005cfb --- /dev/null +++ b/survey_result_mail/i18n/es.po @@ -0,0 +1,159 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * survey_result_mail +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-11-16 11:28+0000\n" +"PO-Revision-Date: 2023-11-16 12:36+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.4\n" + +#. module: survey_result_mail +#: model:ir.actions.report,print_report_name:survey_result_mail.survey_result_report +msgid "'Survey results - %s' % (object.survey_id.display_name)" +msgstr "'Resultados de la encuesta - %s' % (object.survey_id.display_name)" + +#. module: survey_result_mail +#: model:mail.template,body_html:survey_result_mail.mail_template_user_input_result_inline +msgid "" +"
\n" +"

\n" +" Dear .\n" +"

\n" +"\n" +" Here you have a copy of your answers:\n" +"

\n" +"

\n" +" \n" +"

\n" +"

\n" +" Thanks you for your participation.\n" +"

\n" +"
\n" +" " +msgstr "" +"
\n" +"

\n" +" Estimado/a .\n" +"

\n" +"\n" +" Aquí tiene una copia de sus respuestas:\n" +"

\n" +"

\n" +" \n" +"

\n" +"

\n" +" Gracias por su participación.\n" +"

\n" +"
\n" +" " + +#. module: survey_result_mail +#: model:mail.template,body_html:survey_result_mail.mail_template_user_input_result_report +msgid "" +"
\n" +"

\n" +" Dear .\n" +"

\n" +"\n" +" You'll find attached your survey answers so you can review them.\n" +"\n" +"\n" +" Thanks you for your participation.\n" +"

\n" +"
\n" +" " +msgstr "" +"
\n" +"

\n" +" Estimado/a .\n" +"

\n" +"\n" +" Encontrará adjuntas sus respuestas a la encuesta para que pueda " +"revisarlas.\n" +"\n" +"\n" +" Gracias por su participación.\n" +"

\n" +"
\n" +" " + +#. module: survey_result_mail +#: model_terms:ir.ui.view,arch_db:survey_result_mail.survey_result_report_view_document +msgid "" +"Reponses to your survey" +msgstr "" +"Respuestas de su encuesta" + +#. module: survey_result_mail +#: model:ir.model.fields,field_description:survey_result_mail.field_survey_survey__result_mail_template_id +msgid "Result Mail Template" +msgstr "Plantilla de resultados de encuesta" + +#. module: survey_result_mail +#: model:mail.template,subject:survey_result_mail.mail_template_user_input_result_inline +#: model:mail.template,subject:survey_result_mail.mail_template_user_input_result_report +msgid "Results for your {{object.survey_id.title}} survey" +msgstr "Resultados para su encuesta {{object.survey_id.title}}" + +#. module: survey_result_mail +#: model:ir.model.fields,field_description:survey_result_mail.field_survey_survey__send_result_mail +msgid "Send survey answers" +msgstr "Enviar respuestas de encuesta" + +#. module: survey_result_mail +#: model:ir.model,name:survey_result_mail.model_survey_survey +msgid "Survey" +msgstr "Encuesta" + +#. module: survey_result_mail +#: model:ir.model.fields,field_description:survey_result_mail.field_survey_user_input__survey_result +msgid "Survey Result" +msgstr "Resultado de la encuesta" + +#. module: survey_result_mail +#: model:mail.template,report_name:survey_result_mail.mail_template_user_input_result_report +msgid "Survey Results" +msgstr "Resultados de la encuesta" + +#. module: survey_result_mail +#: model:ir.model,name:survey_result_mail.model_survey_user_input +msgid "Survey User Input" +msgstr "Entrada de usuario de la encuesta" + +#. module: survey_result_mail +#: model:ir.actions.report,name:survey_result_mail.survey_result_report +msgid "Survey results" +msgstr "Resultados de la encuesta" + +#. module: survey_result_mail +#: model:mail.template,name:survey_result_mail.mail_template_user_input_result_inline +msgid "Survey: Results (inline)" +msgstr "Encuesta: Resultados (en línea)" + +#. module: survey_result_mail +#: model:mail.template,name:survey_result_mail.mail_template_user_input_result_report +msgid "Survey: Results (with report)" +msgstr "Encuesta: Resultados (con informe)" + +#. module: survey_result_mail +#: model:ir.model.fields,help:survey_result_mail.field_survey_survey__send_result_mail +msgid "" +"When the survey is submitted, an email will be sent to the user withthe " +"answers" +msgstr "" +"Cuando se completa la encuesta se envía un correo al usuario con las " +"respuestas" diff --git a/survey_result_mail/i18n/survey_result_mail.pot b/survey_result_mail/i18n/survey_result_mail.pot new file mode 100644 index 00000000..00ef43ea --- /dev/null +++ b/survey_result_mail/i18n/survey_result_mail.pot @@ -0,0 +1,119 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * survey_result_mail +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: survey_result_mail +#: model:ir.actions.report,print_report_name:survey_result_mail.survey_result_report +msgid "'Survey results - %s' % (object.survey_id.display_name)" +msgstr "" + +#. module: survey_result_mail +#: model:mail.template,body_html:survey_result_mail.mail_template_user_input_result_inline +msgid "" +"
\n" +"

\n" +" Dear .\n" +"

\n" +"\n" +" Here you have a copy of your answers:\n" +"

\n" +"

\n" +" \n" +"

\n" +"

\n" +" Thanks you for your participation.\n" +"

\n" +"
\n" +" " +msgstr "" + +#. module: survey_result_mail +#: model:mail.template,body_html:survey_result_mail.mail_template_user_input_result_report +msgid "" +"
\n" +"

\n" +" Dear .\n" +"

\n" +"\n" +" You'll find attached your survey answers so you can review them.\n" +"\n" +"\n" +" Thanks you for your participation.\n" +"

\n" +"
\n" +" " +msgstr "" + +#. module: survey_result_mail +#: model_terms:ir.ui.view,arch_db:survey_result_mail.survey_result_report_view_document +msgid "Reponses to your survey" +msgstr "" + +#. module: survey_result_mail +#: model:ir.model.fields,field_description:survey_result_mail.field_survey_survey__result_mail_template_id +msgid "Result Mail Template" +msgstr "" + +#. module: survey_result_mail +#: model:mail.template,subject:survey_result_mail.mail_template_user_input_result_inline +#: model:mail.template,subject:survey_result_mail.mail_template_user_input_result_report +msgid "Results for your {{object.survey_id.title}} survey" +msgstr "" + +#. module: survey_result_mail +#: model:ir.model.fields,field_description:survey_result_mail.field_survey_survey__send_result_mail +msgid "Send survey answers" +msgstr "" + +#. module: survey_result_mail +#: model:ir.model,name:survey_result_mail.model_survey_survey +msgid "Survey" +msgstr "" + +#. module: survey_result_mail +#: model:ir.model.fields,field_description:survey_result_mail.field_survey_user_input__survey_result +msgid "Survey Result" +msgstr "" + +#. module: survey_result_mail +#: model:mail.template,report_name:survey_result_mail.mail_template_user_input_result_report +msgid "Survey Results" +msgstr "" + +#. module: survey_result_mail +#: model:ir.model,name:survey_result_mail.model_survey_user_input +msgid "Survey User Input" +msgstr "" + +#. module: survey_result_mail +#: model:ir.actions.report,name:survey_result_mail.survey_result_report +msgid "Survey results" +msgstr "" + +#. module: survey_result_mail +#: model:mail.template,name:survey_result_mail.mail_template_user_input_result_inline +msgid "Survey: Results (inline)" +msgstr "" + +#. module: survey_result_mail +#: model:mail.template,name:survey_result_mail.mail_template_user_input_result_report +msgid "Survey: Results (with report)" +msgstr "" + +#. module: survey_result_mail +#: model:ir.model.fields,help:survey_result_mail.field_survey_survey__send_result_mail +msgid "" +"When the survey is submitted, an email will be sent to the user withthe " +"answers" +msgstr "" diff --git a/survey_result_mail/models/survey_survey.py b/survey_result_mail/models/survey_survey.py index 82d10d1b..a2514e12 100644 --- a/survey_result_mail/models/survey_survey.py +++ b/survey_result_mail/models/survey_survey.py @@ -7,6 +7,10 @@ class SurveySurvey(models.Model): _inherit = "survey.survey" send_result_mail = fields.Boolean( + string="Send survey answers", help="When the survey is submitted, an email will be sent to the user with" - "the answers" + "the answers", + ) + result_mail_template_id = fields.Many2one( + comodel_name="mail.template", domain="[('model', '=', 'survey.user_input')]" ) diff --git a/survey_result_mail/models/survey_user_input.py b/survey_result_mail/models/survey_user_input.py index eecb106e..edaa7aa2 100644 --- a/survey_result_mail/models/survey_user_input.py +++ b/survey_result_mail/models/survey_user_input.py @@ -1,7 +1,9 @@ # Copyright 2023 Tecnativa - David Vidal # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from markupsafe import Markup + from odoo import fields, models -from odoo.tools import format_date, format_datetime +from odoo.tools import format_date, format_datetime, is_html_empty class SurveyUserInput(models.Model): @@ -9,22 +11,29 @@ class SurveyUserInput(models.Model): survey_result = fields.Html(compute="_compute_survey_result") + def _compute_survey_result(self): + for user_input in self: + user_input.survey_result = user_input._render_user_input() + def _render_user_input(self): - """We're rendering the template results to add them to the pdf report. This - should be easier in v15""" + """We're rendering the template results to add them to the pdf report""" self.ensure_one() + survey_sudo = self.survey_id.sudo() + answer_sudo = self.sudo() return ( self.env["ir.ui.view"] .sudo() - .render_template( + ._render_template( "survey_result_mail.survey_page_print", { - "review": True, - "survey": self.survey_id, - "answer": self, - "questions_to_display": self.survey_id.question_ids, + "is_html_empty": is_html_empty, + "review": False, + "survey": survey_sudo, + "answer": answer_sudo, + "questions_to_display": answer_sudo._get_print_questions(), "scoring_display_correction": ( - self.scoring_type == "scoring_with_answers" and self + survey_sudo.scoring_type == "scoring_with_answers" + and answer_sudo ), "format_datetime": lambda dt: format_datetime( self.env, dt, dt_format=False @@ -34,9 +43,57 @@ def _render_user_input(self): ) ) - def _compute_survey_result(self): - for user_input in self: - user_input.survey_result = user_input._render_user_input() + def _build_answers_html(self, given_answers=False): + """Basic html formatted answers. Can be used in mail communications and other + html fields without worring about styles""" + + def _answer_element(title, value): + return f"
  • {title}: {value}
  • " + + given_answers = (given_answers or self.user_input_line_ids).filtered( + lambda x: not x.skipped + ) + questions_dict = {} + for answer in given_answers.filtered(lambda x: x.answer_type != "suggestion"): + questions_dict[answer.question_id] = _answer_element( + answer.question_id.title, answer[f"value_{answer.answer_type}"] + ) + for answer in given_answers.filtered( + lambda x: x.question_id.question_type == "simple_choice" + ): + questions_dict[answer.question_id] = _answer_element( + answer.question_id.title, answer.suggested_answer_id.value + ) + multiple_choice_dict = {} + for answer in given_answers.filtered( + lambda x: x.question_id.question_type == "multiple_choice" + ): + multiple_choice_dict.setdefault(answer.question_id, []) + multiple_choice_dict[answer.question_id].append( + answer.suggested_answer_id.value + ) + for question, answers in multiple_choice_dict.items(): + questions_dict[question] = _answer_element( + question.title, " / ".join([x for x in answers if x]) + ) + matrix_dict = {} + for answer in given_answers.filtered( + lambda x: x.question_id.question_type == "matrix" + ): + matrix_dict.setdefault(answer.question_id, {}) + matrix_dict[answer.question_id].setdefault(answer.matrix_row_id, []) + matrix_dict[answer.question_id][answer.matrix_row_id].append( + answer.suggested_answer_id.value + ) + for question, rows in matrix_dict.items(): + questions_dict[question] = f"
  • {question.title}:
      " + for row, answers in rows.items(): + questions_dict[question] += _answer_element( + row.value, " / ".join([x for x in answers if x]) + ) + questions_dict[question] += "
  • " + answers_html = "".join([questions_dict[q] for q in given_answers.question_id]) + return Markup(answers_html) def _mark_done(self): """Send the answers when submitted on the so configured surveys""" @@ -44,7 +101,10 @@ def _mark_done(self): for user_input in self.filtered( lambda x: x.survey_id.send_result_mail and x.partner_id.email ): - self.env.ref( - "survey_result_mail.mail_template_user_input_result" - ).send_mail(user_input.id, notif_layout="mail.mail_notification_light") + template = self.survey_id.result_mail_template_id or self.env.ref( + "survey_result_mail.mail_template_user_input_result_inline" + ) + template.send_mail( + user_input.id, notif_layout="mail.mail_notification_light" + ) return res diff --git a/survey_result_mail/readme/CONFIGURE.rst b/survey_result_mail/readme/CONFIGURE.rst index d6ba24e3..db12575f 100644 --- a/survey_result_mail/readme/CONFIGURE.rst +++ b/survey_result_mail/readme/CONFIGURE.rst @@ -3,3 +3,5 @@ To configure automatic result sending to the user: #. Go to the survey you want to configure. #. In the *Options* tab, you'll find a new *Send survey answers* option that you can set on to send an automatic email with the user's answers. +#. You can also choose which mail template to send. This module provides two. One with + the answers inlined and another with the answers attached as pdf report. diff --git a/survey_result_mail/readme/ROADMAP.rst b/survey_result_mail/readme/ROADMAP.rst deleted file mode 100644 index cb522e06..00000000 --- a/survey_result_mail/readme/ROADMAP.rst +++ /dev/null @@ -1,2 +0,0 @@ -* Hopefully in v15 a refactor of the template can be done to drastically reduce the - code. diff --git a/survey_result_mail/reports/survey_answer_report.xml b/survey_result_mail/reports/survey_answer_report.xml index 908ae56c..746aab25 100644 --- a/survey_result_mail/reports/survey_answer_report.xml +++ b/survey_result_mail/reports/survey_answer_report.xml @@ -32,14 +32,14 @@ - + + survey.user_input + Survey results + survey_result_mail.survey_result_report_view + qweb-pdf + 'surevey_results.pdf' + 'Survey results - %s' % (object.survey_id.display_name) + diff --git a/survey_result_mail/static/description/index.html b/survey_result_mail/static/description/index.html index 852d5e3a..843b401b 100644 --- a/survey_result_mail/static/description/index.html +++ b/survey_result_mail/static/description/index.html @@ -1,20 +1,20 @@ - + - + Survey Result Mail