From dce20fad21571321d5dd0bf22ccd99ed851f5651 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 1 Jun 2023 17:57:40 +0200 Subject: [PATCH 01/27] [ADD] survey_contact_generation: New module TT40985 --- survey_contact_generation/README.rst | 110 +++++ survey_contact_generation/__init__.py | 1 + survey_contact_generation/__manifest__.py | 15 + survey_contact_generation/i18n/es.po | 59 +++ .../i18n/survey_contact_generation.pot | 57 +++ survey_contact_generation/models/__init__.py | 3 + .../models/survey_question.py | 37 ++ .../models/survey_survey.py | 11 + .../models/survey_user_input.py | 42 ++ .../readme/CONFIGURE.rst | 10 + .../readme/CONTRIBUTORS.rst | 4 + .../readme/DESCRIPTION.rst | 1 + survey_contact_generation/readme/USAGE.rst | 3 + .../static/description/icon.png | Bin 0 -> 8322 bytes .../static/description/index.html | 449 ++++++++++++++++++ .../views/survey_question_views.xml | 15 + .../views/survey_survey_views.xml | 14 + 17 files changed, 831 insertions(+) create mode 100644 survey_contact_generation/README.rst create mode 100644 survey_contact_generation/__init__.py create mode 100644 survey_contact_generation/__manifest__.py create mode 100644 survey_contact_generation/i18n/es.po create mode 100644 survey_contact_generation/i18n/survey_contact_generation.pot create mode 100644 survey_contact_generation/models/__init__.py create mode 100644 survey_contact_generation/models/survey_question.py create mode 100644 survey_contact_generation/models/survey_survey.py create mode 100644 survey_contact_generation/models/survey_user_input.py create mode 100644 survey_contact_generation/readme/CONFIGURE.rst create mode 100644 survey_contact_generation/readme/CONTRIBUTORS.rst create mode 100644 survey_contact_generation/readme/DESCRIPTION.rst create mode 100644 survey_contact_generation/readme/USAGE.rst create mode 100644 survey_contact_generation/static/description/icon.png create mode 100644 survey_contact_generation/static/description/index.html create mode 100644 survey_contact_generation/views/survey_question_views.xml create mode 100644 survey_contact_generation/views/survey_survey_views.xml diff --git a/survey_contact_generation/README.rst b/survey_contact_generation/README.rst new file mode 100644 index 00000000..3de33b55 --- /dev/null +++ b/survey_contact_generation/README.rst @@ -0,0 +1,110 @@ +========================== +Survey contacts generation +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b9b083394402c8f4a1902549fe422a7abd87a9aa0616c9f5c760673cfcb43da7 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_contact_generation + :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_contact_generation + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/survey&target_branch=13.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to generate new contacts from surveys answers. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure the contact generation: + +#. Go to the configured survey. +#. In the *Contact* section of the *Options* tab, set + *Generate Contact* on, if you want contacts to be + generated from the answers to this survey. +#. In each question associated with a future new contact, + specify the corresponding contact field. To do this, + go to the 'Options' tab, then navigate to the 'Contact' group, + and select the 'Contact field' field. + + + +Usage +===== + +if the survey is properly configured, once it is submited +by an anonomous user, a new contact is create or an +existing one is linked. + +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 to smash 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 + * Ernesto Tejeda + +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_contact_generation/__init__.py b/survey_contact_generation/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/survey_contact_generation/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/survey_contact_generation/__manifest__.py b/survey_contact_generation/__manifest__.py new file mode 100644 index 00000000..465a9607 --- /dev/null +++ b/survey_contact_generation/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2023 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Survey contacts generation", + "summary": "Generate new contacts from surveys", + "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": ["views/survey_question_views.xml", "views/survey_survey_views.xml"], +} diff --git a/survey_contact_generation/i18n/es.po b/survey_contact_generation/i18n/es.po new file mode 100644 index 00000000..3cf14824 --- /dev/null +++ b/survey_contact_generation/i18n/es.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * survey_contact_generation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-06-13 15:49+0000\n" +"PO-Revision-Date: 2023-06-13 17:49+0200\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: \n" +"X-Generator: Poedit 3.0.1\n" + +#. module: survey_contact_generation +#: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__allowed_field_ids +msgid "Allowed Field" +msgstr "" + +#. module: survey_contact_generation +#: model_terms:ir.ui.view,arch_db:survey_contact_generation.survey_form +#: model_terms:ir.ui.view,arch_db:survey_contact_generation.survey_question_form +msgid "Contact" +msgstr "Contacto" + +#. module: survey_contact_generation +#: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__res_partner_field +msgid "Contact field" +msgstr "Campo de contacto" + +#. module: survey_contact_generation +#: model:ir.model.fields,field_description:survey_contact_generation.field_survey_survey__generate_contact +msgid "Generate Contact" +msgstr "Generar contacto" + +#. module: survey_contact_generation +#: model:ir.model.fields,help:survey_contact_generation.field_survey_survey__generate_contact +msgid "Generate contacts for anonymous survey users" +msgstr "Generar contacto para encuestas anónimas" + +#. module: survey_contact_generation +#: model:ir.model,name:survey_contact_generation.model_survey_survey +msgid "Survey" +msgstr "Planificación" + +#. module: survey_contact_generation +#: model:ir.model,name:survey_contact_generation.model_survey_question +msgid "Survey Question" +msgstr "Pregunta de la encuesta" + +#. module: survey_contact_generation +#: model:ir.model,name:survey_contact_generation.model_survey_user_input +msgid "Survey User Input" +msgstr "Entrada de usuario de la encuesta" diff --git a/survey_contact_generation/i18n/survey_contact_generation.pot b/survey_contact_generation/i18n/survey_contact_generation.pot new file mode 100644 index 00000000..45379a1f --- /dev/null +++ b/survey_contact_generation/i18n/survey_contact_generation.pot @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * survey_contact_generation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-06-13 15:49+0000\n" +"PO-Revision-Date: 2023-06-13 15:49+0000\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_contact_generation +#: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__allowed_field_ids +msgid "Allowed Field" +msgstr "" + +#. module: survey_contact_generation +#: model_terms:ir.ui.view,arch_db:survey_contact_generation.survey_form +#: model_terms:ir.ui.view,arch_db:survey_contact_generation.survey_question_form +msgid "Contact" +msgstr "" + +#. module: survey_contact_generation +#: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__res_partner_field +msgid "Contact field" +msgstr "" + +#. module: survey_contact_generation +#: model:ir.model.fields,field_description:survey_contact_generation.field_survey_survey__generate_contact +msgid "Generate Contact" +msgstr "" + +#. module: survey_contact_generation +#: model:ir.model.fields,help:survey_contact_generation.field_survey_survey__generate_contact +msgid "Generate contacts for anonymous survey users" +msgstr "" + +#. module: survey_contact_generation +#: model:ir.model,name:survey_contact_generation.model_survey_survey +msgid "Survey" +msgstr "" + +#. module: survey_contact_generation +#: model:ir.model,name:survey_contact_generation.model_survey_question +msgid "Survey Question" +msgstr "" + +#. module: survey_contact_generation +#: model:ir.model,name:survey_contact_generation.model_survey_user_input +msgid "Survey User Input" +msgstr "" diff --git a/survey_contact_generation/models/__init__.py b/survey_contact_generation/models/__init__.py new file mode 100644 index 00000000..93bb3b4a --- /dev/null +++ b/survey_contact_generation/models/__init__.py @@ -0,0 +1,3 @@ +from . import survey_question +from . import survey_survey +from . import survey_user_input diff --git a/survey_contact_generation/models/survey_question.py b/survey_contact_generation/models/survey_question.py new file mode 100644 index 00000000..fad3df40 --- /dev/null +++ b/survey_contact_generation/models/survey_question.py @@ -0,0 +1,37 @@ +# Copyright 2022 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import api, fields, models + + +class SurveyQuestion(models.Model): + _inherit = "survey.question" + + allowed_field_ids = fields.Many2many( + comodel_name="ir.model.fields", compute="_compute_allowed_field_ids", + ) + res_partner_field = fields.Many2one( + string="Contact field", + comodel_name="ir.model.fields", + domain="[('id', 'in', allowed_field_ids)]", + ) + + @api.depends("question_type") + def _compute_allowed_field_ids(self): + type_mapping = { + "textbox": ["char"], + "free_text": ["text"], + "numerical_box": ["integer", "float"], + "date": ["date"], + "datetime": ["datetime"], + } + for record in self: + record.allowed_field_ids = ( + self.env["ir.model.fields"] + .search( + [ + ("model", "=", "res.partner"), + ("ttype", "in", type_mapping.get(record.question_type, [])), + ] + ) + .ids + ) diff --git a/survey_contact_generation/models/survey_survey.py b/survey_contact_generation/models/survey_survey.py new file mode 100644 index 00000000..96321021 --- /dev/null +++ b/survey_contact_generation/models/survey_survey.py @@ -0,0 +1,11 @@ +# 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" + + generate_contact = fields.Boolean( + help="Generate contacts for anonymous survey users", + ) diff --git a/survey_contact_generation/models/survey_user_input.py b/survey_contact_generation/models/survey_user_input.py new file mode 100644 index 00000000..8e33eab5 --- /dev/null +++ b/survey_contact_generation/models/survey_user_input.py @@ -0,0 +1,42 @@ +# Copyright 2022 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import models + + +class SurveyUserInput(models.Model): + _inherit = "survey.user_input" + + def _prepare_partner(self): + self.ensure_one() + return { + line.question_id.res_partner_field.name: line[f"value_{line.answer_type}"] + for line in self.user_input_line_ids.filtered( + lambda r: r.question_id.res_partner_field + ) + } + + def _create_contact_post_process(self): + """After creating the lead send an internal message with the input link""" + self.partner_id.message_post_with_view( + "mail.message_origin_link", + values={"self": self.partner_id, "origin": self.survey_id}, + subtype_id=self.env.ref("mail.mt_note").id, + ) + + def _mark_done(self): + """Generate the contact when the survey is submitted""" + for user_input in self.filtered( + lambda r: r.survey_id.generate_contact and not self.partner_id + ): + vals = user_input._prepare_partner() + partner = False + email = vals.get("email") + if email: + partner = self.env["res.partner"].search( + [("email", "=", email)], limit=1 + ) + if not partner: + partner = self.env["res.partner"].create(vals) + self._create_contact_post_process() + self.write({"partner_id": partner.id, "email": partner.email}) + return super()._mark_done() diff --git a/survey_contact_generation/readme/CONFIGURE.rst b/survey_contact_generation/readme/CONFIGURE.rst new file mode 100644 index 00000000..18966aa7 --- /dev/null +++ b/survey_contact_generation/readme/CONFIGURE.rst @@ -0,0 +1,10 @@ +To configure the contact generation: + +#. Go to the configured survey. +#. In the *Contact* section of the *Options* tab, set + *Generate Contact* on, if you want contacts to be + generated from the answers to this survey. +#. In each question associated with a future new contact, + specify the corresponding contact field. To do this, + go to the 'Options' tab, then navigate to the 'Contact' group, + and select the 'Contact field' field. diff --git a/survey_contact_generation/readme/CONTRIBUTORS.rst b/survey_contact_generation/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..db689930 --- /dev/null +++ b/survey_contact_generation/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Tecnativa `_ + + * David Vidal + * Ernesto Tejeda diff --git a/survey_contact_generation/readme/DESCRIPTION.rst b/survey_contact_generation/readme/DESCRIPTION.rst new file mode 100644 index 00000000..ac10b74a --- /dev/null +++ b/survey_contact_generation/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows to generate new contacts from surveys answers. diff --git a/survey_contact_generation/readme/USAGE.rst b/survey_contact_generation/readme/USAGE.rst new file mode 100644 index 00000000..f7c7830c --- /dev/null +++ b/survey_contact_generation/readme/USAGE.rst @@ -0,0 +1,3 @@ +if the survey is properly configured, once it is submited +by an anonomous user, a new contact is create or an +existing one is linked. diff --git a/survey_contact_generation/static/description/icon.png b/survey_contact_generation/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ae0af814c13aaa36da581cafb348ae53540fdb93 GIT binary patch literal 8322 zcmV-|AbsD7P)PyA07*naRCr$PT?v>J#o7LPW@mPnU0LoMJP=Jdqlte+L`^tUl$gr|mO~IkhKFzN}#IrrK!qyA5(QTb5;zBuV=k02u$R{Mq=L z1QN&~1OBh>p(m%56Hmoio+QD4M|};=9s8%TAN*?HP#{nd4hD8qH#EHQ$DZGxFG*6J zsV7ElSbJORjLd~WNy@RJ>+&)JHqUDLEPsaLY2GgKt z^On#lGqYw^&mXju9{l*Dhh9IpXV&T38WS&?G_#2T5@<&e0206$^|Y}%uqgoG zB}F@x2&eChwvT9fT77kZ;RXuBPs5vD1mRw5yomAXM~4t!hv4MG&-Rttzp&6GNq$-P zel_r!R^Ma>1P!p-`f^E9vVLGw0Pt*=G{P`Wwe?IJ(PvtHlXZX+_HiOfel@&bnww%E zy@f`b4LfB_9m6m?E=i5tGY$|wwPRxrI7>-tiVhL+FQn=lb0GTYr;*w{|5xr=l2cnp zv;#%cr|Rp2B+&pPYIL#UX@v7lg-;L!h_<7Mgb{{uIuiXdew%_(QjR-k0Q5wXniBC= zp5LYbpwn50vHl|Ioeq3A?IX2awxDqrA1Onc7jSMqP?SML)B6Dc-uChXKqg80Z~MR$ z1DPSu3pm;Ur810TWcuV^5M>n6^p4v>&?xt7vLIsQ8V8(^BsE2cr2I6_j8xjJiZG1J zcp3s2BWclG$Rb*9M0o#}ZDDBpE^tNXZqU19XIj>0r7%_no68csH~iNru(*JK zLD4}N|3yAY=~w?aQ5eE7P7=_JC@Un(HMOwpior0fcRv@+l}dswu<)}2cO+cgQStyY|BD z;lG5**9;P9u2fQNff@PhVa>^-)I$>dWE3MFe37I$SfHT+KAQeV=+n7ts@DZu;MK3T z!OT6|Obp}I0M}-0<)@KaKl`|FJd76M1T4Gv0o2!%!y!r*<_R`cDmk`5!J&gN?z4@a z&X(Lr7!@$Q6lW|@1&gY+DZq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kCQX^aMuBm zq4abJcJ4r?&R%ph6~LTvGg>^v0HbYi+FoN`hM;$xUjXE?i8L+63qX~p4ByRc;8-Ei zD7mMRT=r=Q1SbQ9am{dC5z(*>_v`_I7A+vyszpMMOaL?*vpyQRrW@H5qt}}eYC3;~ z`5}A^W3Rd9u}r(@+IOHB86_4^gTNu)W!%(;PgEv%HxlrKLm&l$k6&T(Ez-l1S8;%ZSCsO6+4oU=1=;H1K zEJ{0?jZcw|W;49~+L5+g3&8Mov|p0o8{>I!hh?lssmL-a7K;J215pbWuN`kppa@79 zVHh^`do%0cWhzksil%2Xo$?nG(=ZBT8TBSW;0)-Z3y6Vh9Lat$ib%eWC5f$>bSmcs zinSz}^X9clc((HDJBm}1?2KPSHq`otLJt#0Cu7Fw$7G zVf0_fDu8yUK;t|5L}qc`Fs86g6AtTa7B6iKQ3kO~ZzD;GPhn`b*+1cRJdFX$oYc+7 zcupD92~d~~AJQARab~gWsAORvD#N5~8YAPHVXN?*Ge353VQ! zh^A*6+ZGZgNn?LWiHD&Zjb`Q$qjWS-?V4F*5O)`p0m#^Y6I zzZiw>-cT7PT3QCxpBHYCp#KjRN#W2`=-fef#;hgfGDGHgjW$k(IFsUO(1Y9Ke1LTG z9g@6$7pD>-3LxI}cok1=;a3>jGZTBbmDKF3qgs}oN7&D9G-X&E1SgcX|AYE!jqoNhA0MZGR%s28ALmfF(MGdOCu*spaFNI z);A~@fMsS*DOs4eL>!g_Dt3io|)HusZIIYdMT4eBSct zCKxkh68BC8k(F%*mgD+zOTP83xXjNs{K0D08wdt#q?~i6o_b{Qb7T-0(&j+_AN;Qr zO1l~&(HrY{j-)?$8~^|SFiAu~RGYHR zU|~+PIV;BNu3)w=!&A+)7+L<8U=Z&W+$z`Bymx1G&ruwxCtmTL1t6 M07*qoM6N<$g1NtQl>h($ literal 0 HcmV?d00001 diff --git a/survey_contact_generation/static/description/index.html b/survey_contact_generation/static/description/index.html new file mode 100644 index 00000000..fe775364 --- /dev/null +++ b/survey_contact_generation/static/description/index.html @@ -0,0 +1,449 @@ + + + + + + +Survey contacts generation + + + +
+

Survey contacts generation

+ + +

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

+

This module allows to generate new contacts from surveys answers.

+

Table of contents

+ +
+

Configuration

+

To configure the contact generation:

+
    +
  1. Go to the configured survey.
  2. +
  3. In the Contact section of the Options tab, set +Generate Contact on, if you want contacts to be +generated from the answers to this survey.
  4. +
  5. In each question associated with a future new contact, +specify the corresponding contact field. To do this, +go to the ‘Options’ tab, then navigate to the ‘Contact’ group, +and select the ‘Contact field’ field.
  6. +
+
+
+

Usage

+

if the survey is properly configured, once it is submited +by an anonomous user, a new contact is create or an +existing one is linked.

+
+
+

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 to smash 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
    • +
    • Ernesto Tejeda
    • +
    +
  • +
+
+
+

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_contact_generation/views/survey_question_views.xml b/survey_contact_generation/views/survey_question_views.xml new file mode 100644 index 00000000..ae2e34c4 --- /dev/null +++ b/survey_contact_generation/views/survey_question_views.xml @@ -0,0 +1,15 @@ + + + + survey.question + + + + + + + + + + + diff --git a/survey_contact_generation/views/survey_survey_views.xml b/survey_contact_generation/views/survey_survey_views.xml new file mode 100644 index 00000000..66eea35f --- /dev/null +++ b/survey_contact_generation/views/survey_survey_views.xml @@ -0,0 +1,14 @@ + + + + survey.survey + + + + + + + + + + From 869e7ee9134f51457c540d3b958050ff480f5d76 Mon Sep 17 00:00:00 2001 From: Stefan Date: Wed, 14 Jun 2023 13:59:44 +0200 Subject: [PATCH 02/27] [IMP] survey_contact_generation: Add test coverage --- survey_contact_generation/README.rst | 18 ++--- survey_contact_generation/__manifest__.py | 7 +- .../demo/survey_contact_generation_demo.xml | 48 +++++++++++++ survey_contact_generation/i18n/es.po | 68 ++++++++++++++++++- .../i18n/survey_contact_generation.pot | 64 ++++++++++++++++- .../readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 9 ++- .../tests/survey_contact_generation_tour.js | 52 ++++++++++++++ survey_contact_generation/tests/__init__.py | 1 + .../tests/test_survey_contact_generation.py | 38 +++++++++++ survey_contact_generation/views/assets.xml | 15 ++++ 11 files changed, 299 insertions(+), 22 deletions(-) create mode 100644 survey_contact_generation/demo/survey_contact_generation_demo.xml create mode 100644 survey_contact_generation/static/tests/survey_contact_generation_tour.js create mode 100644 survey_contact_generation/tests/__init__.py create mode 100644 survey_contact_generation/tests/test_survey_contact_generation.py create mode 100644 survey_contact_generation/views/assets.xml diff --git a/survey_contact_generation/README.rst b/survey_contact_generation/README.rst index 3de33b55..2ecd7954 100644 --- a/survey_contact_generation/README.rst +++ b/survey_contact_generation/README.rst @@ -2,13 +2,10 @@ Survey contacts generation ========================== -.. - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:b9b083394402c8f4a1902549fe422a7abd87a9aa0616c9f5c760673cfcb43da7 - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -22,11 +19,11 @@ Survey contacts generation .. |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_contact_generation :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/survey&target_branch=13.0 - :alt: Try me on Runboat +.. |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| +|badge1| |badge2| |badge3| |badge4| |badge5| This module allows to generate new contacts from surveys answers. @@ -49,8 +46,6 @@ To configure the contact generation: go to the 'Options' tab, then navigate to the 'Contact' group, and select the 'Contact field' field. - - Usage ===== @@ -63,7 +58,7 @@ 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 to smash it by providing a detailed and welcomed +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. @@ -83,6 +78,7 @@ Contributors * David Vidal * Ernesto Tejeda + * Stefan Ungureanu Maintainers ~~~~~~~~~~~ diff --git a/survey_contact_generation/__manifest__.py b/survey_contact_generation/__manifest__.py index 465a9607..d999cd22 100644 --- a/survey_contact_generation/__manifest__.py +++ b/survey_contact_generation/__manifest__.py @@ -11,5 +11,10 @@ "maintainers": ["chienandalu"], "license": "AGPL-3", "depends": ["survey"], - "data": ["views/survey_question_views.xml", "views/survey_survey_views.xml"], + "data": [ + "views/survey_question_views.xml", + "views/survey_survey_views.xml", + "views/assets.xml", + ], + "demo": ["demo/survey_contact_generation_demo.xml"], } diff --git a/survey_contact_generation/demo/survey_contact_generation_demo.xml b/survey_contact_generation/demo/survey_contact_generation_demo.xml new file mode 100644 index 00000000..800c8f9c --- /dev/null +++ b/survey_contact_generation/demo/survey_contact_generation_demo.xml @@ -0,0 +1,48 @@ + + + + + Contact Creation Survey + 80e5f1e2-1a9d-4c51-8e23-09e93f7fa2c5 + open + public + + + + + + 0 + Name + textbox + + + + + + 1 + Email + textbox + + + + + 2 + Notes + free_text + + + + + 3 + Color + numerical_box + + + + + 4 + Date + date + + + diff --git a/survey_contact_generation/i18n/es.po b/survey_contact_generation/i18n/es.po index 3cf14824..fde335e6 100644 --- a/survey_contact_generation/i18n/es.po +++ b/survey_contact_generation/i18n/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-13 15:49+0000\n" -"PO-Revision-Date: 2023-06-13 17:49+0200\n" +"POT-Creation-Date: 2023-06-14 11:55+0000\n" +"PO-Revision-Date: 2023-06-14 13:58+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: es\n" @@ -20,7 +20,13 @@ msgstr "" #. module: survey_contact_generation #: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__allowed_field_ids msgid "Allowed Field" -msgstr "" +msgstr "Campo permitido" + +#. module: survey_contact_generation +#: model:survey.question,question:survey_contact_generation.survey_contact_q3 +#: model:survey.question,title:survey_contact_generation.survey_contact_q3 +msgid "Color" +msgstr "Color" #. module: survey_contact_generation #: model_terms:ir.ui.view,arch_db:survey_contact_generation.survey_form @@ -28,11 +34,28 @@ msgstr "" msgid "Contact" msgstr "Contacto" +#. module: survey_contact_generation +#: model:survey.survey,title:survey_contact_generation.survey_contact_creation +msgid "Contact Creation Survey" +msgstr "Encuesta de creación de contactos" + #. module: survey_contact_generation #: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__res_partner_field msgid "Contact field" msgstr "Campo de contacto" +#. module: survey_contact_generation +#: model:survey.question,question:survey_contact_generation.survey_contact_q4 +#: model:survey.question,title:survey_contact_generation.survey_contact_q4 +msgid "Date" +msgstr "Fecha" + +#. module: survey_contact_generation +#: model:survey.question,question:survey_contact_generation.survey_contact_q1 +#: model:survey.question,title:survey_contact_generation.survey_contact_q1 +msgid "Email" +msgstr "Correo electrónico" + #. module: survey_contact_generation #: model:ir.model.fields,field_description:survey_contact_generation.field_survey_survey__generate_contact msgid "Generate Contact" @@ -43,6 +66,27 @@ msgstr "Generar contacto" msgid "Generate contacts for anonymous survey users" msgstr "Generar contacto para encuestas anónimas" +#. module: survey_contact_generation +#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q0 +#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q1 +#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q2 +#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q3 +#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q4 +msgid "If other, please specify:" +msgstr "Si es otro, especifíquelo:" + +#. module: survey_contact_generation +#: model:survey.question,question:survey_contact_generation.survey_contact_q0 +#: model:survey.question,title:survey_contact_generation.survey_contact_q0 +msgid "Name" +msgstr "Nombre" + +#. module: survey_contact_generation +#: model:survey.question,question:survey_contact_generation.survey_contact_q2 +#: model:survey.question,title:survey_contact_generation.survey_contact_q2 +msgid "Notes" +msgstr "Notas" + #. module: survey_contact_generation #: model:ir.model,name:survey_contact_generation.model_survey_survey msgid "Survey" @@ -57,3 +101,21 @@ msgstr "Pregunta de la encuesta" #: model:ir.model,name:survey_contact_generation.model_survey_user_input msgid "Survey User Input" msgstr "Entrada de usuario de la encuesta" + +#. module: survey_contact_generation +#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q0 +#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q1 +#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q2 +#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q3 +#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q4 +msgid "The answer you entered is not valid." +msgstr "La respuesta que has introducido no es válida." + +#. module: survey_contact_generation +#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q0 +#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q1 +#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q2 +#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q3 +#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q4 +msgid "This question requires an answer." +msgstr "Esta pregunta requiere una respuesta." diff --git a/survey_contact_generation/i18n/survey_contact_generation.pot b/survey_contact_generation/i18n/survey_contact_generation.pot index 45379a1f..890cd2c3 100644 --- a/survey_contact_generation/i18n/survey_contact_generation.pot +++ b/survey_contact_generation/i18n/survey_contact_generation.pot @@ -6,8 +6,6 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-13 15:49+0000\n" -"PO-Revision-Date: 2023-06-13 15:49+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -20,17 +18,40 @@ msgstr "" msgid "Allowed Field" msgstr "" +#. module: survey_contact_generation +#: model:survey.question,question:survey_contact_generation.survey_contact_q3 +#: model:survey.question,title:survey_contact_generation.survey_contact_q3 +msgid "Color" +msgstr "" + #. module: survey_contact_generation #: model_terms:ir.ui.view,arch_db:survey_contact_generation.survey_form #: model_terms:ir.ui.view,arch_db:survey_contact_generation.survey_question_form msgid "Contact" msgstr "" +#. module: survey_contact_generation +#: model:survey.survey,title:survey_contact_generation.survey_contact_creation +msgid "Contact Creation Survey" +msgstr "" + #. module: survey_contact_generation #: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__res_partner_field msgid "Contact field" msgstr "" +#. module: survey_contact_generation +#: model:survey.question,question:survey_contact_generation.survey_contact_q4 +#: model:survey.question,title:survey_contact_generation.survey_contact_q4 +msgid "Date" +msgstr "" + +#. module: survey_contact_generation +#: model:survey.question,question:survey_contact_generation.survey_contact_q1 +#: model:survey.question,title:survey_contact_generation.survey_contact_q1 +msgid "Email" +msgstr "" + #. module: survey_contact_generation #: model:ir.model.fields,field_description:survey_contact_generation.field_survey_survey__generate_contact msgid "Generate Contact" @@ -41,6 +62,27 @@ msgstr "" msgid "Generate contacts for anonymous survey users" msgstr "" +#. module: survey_contact_generation +#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q0 +#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q1 +#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q2 +#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q3 +#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q4 +msgid "If other, please specify:" +msgstr "" + +#. module: survey_contact_generation +#: model:survey.question,question:survey_contact_generation.survey_contact_q0 +#: model:survey.question,title:survey_contact_generation.survey_contact_q0 +msgid "Name" +msgstr "" + +#. module: survey_contact_generation +#: model:survey.question,question:survey_contact_generation.survey_contact_q2 +#: model:survey.question,title:survey_contact_generation.survey_contact_q2 +msgid "Notes" +msgstr "" + #. module: survey_contact_generation #: model:ir.model,name:survey_contact_generation.model_survey_survey msgid "Survey" @@ -55,3 +97,21 @@ msgstr "" #: model:ir.model,name:survey_contact_generation.model_survey_user_input msgid "Survey User Input" msgstr "" + +#. module: survey_contact_generation +#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q0 +#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q1 +#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q2 +#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q3 +#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q4 +msgid "The answer you entered is not valid." +msgstr "" + +#. module: survey_contact_generation +#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q0 +#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q1 +#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q2 +#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q3 +#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q4 +msgid "This question requires an answer." +msgstr "" diff --git a/survey_contact_generation/readme/CONTRIBUTORS.rst b/survey_contact_generation/readme/CONTRIBUTORS.rst index db689930..e3851e7f 100644 --- a/survey_contact_generation/readme/CONTRIBUTORS.rst +++ b/survey_contact_generation/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * David Vidal * Ernesto Tejeda + * Stefan Ungureanu diff --git a/survey_contact_generation/static/description/index.html b/survey_contact_generation/static/description/index.html index fe775364..3ac2edcf 100644 --- a/survey_contact_generation/static/description/index.html +++ b/survey_contact_generation/static/description/index.html @@ -3,7 +3,7 @@ - + Survey contacts generation -
-

Survey contacts generation

+
+ + +Odoo Community Association + +
+

Survey contacts generation

-

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

+

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

This module allows to generate new contacts from surveys answers.

Table of contents

@@ -386,7 +391,7 @@

Survey contacts generation

-

Configuration

+

Configuration

To configure the contact generation:

  1. Go to the configured survey.
  2. @@ -403,12 +408,12 @@

    Configuration

-

Usage

+

Usage

if the survey is properly configured, once it is submited by an anonomous user, a new contact is create or an existing one is linked.

-

Bug Tracker

+

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 to smash it by providing a detailed and welcomed @@ -416,15 +421,15 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -451,5 +456,6 @@

Maintainers

+
From 0e8ce23d3ea064b9edbc5b3fe05788a95794ed0d Mon Sep 17 00:00:00 2001 From: Weblate Date: Mon, 10 Nov 2025 11:59:23 +0000 Subject: [PATCH 24/27] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: survey-17.0/survey-17.0-survey_contact_generation Translate-URL: https://translation.odoo-community.org/projects/survey-17-0/survey-17-0-survey_contact_generation/ --- survey_contact_generation/i18n/es.po | 54 ++++++++-------------------- survey_contact_generation/i18n/it.po | 54 ++++++++-------------------- 2 files changed, 30 insertions(+), 78 deletions(-) diff --git a/survey_contact_generation/i18n/es.po b/survey_contact_generation/i18n/es.po index 6c96976f..1ef59f6b 100644 --- a/survey_contact_generation/i18n/es.po +++ b/survey_contact_generation/i18n/es.po @@ -18,9 +18,9 @@ msgstr "" "X-Generator: Weblate 4.17\n" #. module: survey_contact_generation -#: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__allowed_field_ids -msgid "Allowed Field" -msgstr "Campo permitido" +#: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__allowed_partner_field_domain +msgid "Allowed Partner Field Domain" +msgstr "" #. module: survey_contact_generation #: model:survey.question,title:survey_contact_generation.survey_contact_q3 @@ -96,18 +96,6 @@ msgstr "Generar contacto para encuestas anónimas" msgid "Generating Survey User Input" msgstr "" -#. module: survey_contact_generation -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q0 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q1 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q2 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q3 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q4 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q5 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q6 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q_company_name -msgid "If other, please specify:" -msgstr "Si es otro, especifíquelo:" - #. module: survey_contact_generation #: model:survey.question,title:survey_contact_generation.survey_contact_q0 msgid "Name" @@ -165,31 +153,19 @@ msgstr "Entrada de usuario de la encuesta" msgid "Tags" msgstr "Etiquetas" -#. module: survey_contact_generation -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q0 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q1 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q2 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q3 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q4 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q5 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q6 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q_company_name -msgid "The answer you entered is not valid." -msgstr "La respuesta que has introducido no es válida." - -#. module: survey_contact_generation -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q0 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q1 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q2 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q3 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q4 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q5 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q6 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q_company_name -msgid "This question requires an answer." -msgstr "Esta pregunta requiere una respuesta." - #. module: survey_contact_generation #: model:survey.question.answer,value:survey_contact_generation.survey_contact_q6_sug1 msgid "Vendor" msgstr "Vendedor" + +#~ msgid "Allowed Field" +#~ msgstr "Campo permitido" + +#~ msgid "If other, please specify:" +#~ msgstr "Si es otro, especifíquelo:" + +#~ msgid "The answer you entered is not valid." +#~ msgstr "La respuesta que has introducido no es válida." + +#~ msgid "This question requires an answer." +#~ msgstr "Esta pregunta requiere una respuesta." diff --git a/survey_contact_generation/i18n/it.po b/survey_contact_generation/i18n/it.po index 3d465781..756a94d1 100644 --- a/survey_contact_generation/i18n/it.po +++ b/survey_contact_generation/i18n/it.po @@ -17,9 +17,9 @@ msgstr "" "X-Generator: Weblate 4.17\n" #. module: survey_contact_generation -#: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__allowed_field_ids -msgid "Allowed Field" -msgstr "Campi permessi" +#: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__allowed_partner_field_domain +msgid "Allowed Partner Field Domain" +msgstr "" #. module: survey_contact_generation #: model:survey.question,title:survey_contact_generation.survey_contact_q3 @@ -95,18 +95,6 @@ msgstr "Genera contatti per utenti sondaggio anonimo" msgid "Generating Survey User Input" msgstr "Generazione risposte utente sondaggio" -#. module: survey_contact_generation -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q0 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q1 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q2 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q3 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q4 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q5 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q6 -#: model:survey.question,comments_message:survey_contact_generation.survey_contact_q_company_name -msgid "If other, please specify:" -msgstr "Se altro, specificare:" - #. module: survey_contact_generation #: model:survey.question,title:survey_contact_generation.survey_contact_q0 msgid "Name" @@ -166,31 +154,19 @@ msgstr "Risposta utente al sondaggio" msgid "Tags" msgstr "Etichette" -#. module: survey_contact_generation -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q0 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q1 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q2 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q3 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q4 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q5 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q6 -#: model:survey.question,validation_error_msg:survey_contact_generation.survey_contact_q_company_name -msgid "The answer you entered is not valid." -msgstr "La risposta data non è valida." - -#. module: survey_contact_generation -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q0 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q1 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q2 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q3 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q4 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q5 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q6 -#: model:survey.question,constr_error_msg:survey_contact_generation.survey_contact_q_company_name -msgid "This question requires an answer." -msgstr "Questa domanda richiede una risposta." - #. module: survey_contact_generation #: model:survey.question.answer,value:survey_contact_generation.survey_contact_q6_sug1 msgid "Vendor" msgstr "Fornitore" + +#~ msgid "Allowed Field" +#~ msgstr "Campi permessi" + +#~ msgid "If other, please specify:" +#~ msgstr "Se altro, specificare:" + +#~ msgid "The answer you entered is not valid." +#~ msgstr "La risposta data non è valida." + +#~ msgid "This question requires an answer." +#~ msgstr "Questa domanda richiede una risposta." From cbe2664a224e154e9d47bf09c10efe4f0fea29f8 Mon Sep 17 00:00:00 2001 From: mymage Date: Tue, 11 Nov 2025 09:44:31 +0000 Subject: [PATCH 25/27] Translated using Weblate (Italian) Currently translated at 100.0% (27 of 27 strings) Translation: survey-17.0/survey-17.0-survey_contact_generation Translate-URL: https://translation.odoo-community.org/projects/survey-17-0/survey-17-0-survey_contact_generation/it/ --- survey_contact_generation/i18n/it.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/survey_contact_generation/i18n/it.po b/survey_contact_generation/i18n/it.po index 756a94d1..bbd58fe5 100644 --- a/survey_contact_generation/i18n/it.po +++ b/survey_contact_generation/i18n/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2024-02-26 07:16+0000\n" +"PO-Revision-Date: 2025-11-11 12:42+0000\n" "Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" @@ -14,12 +14,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.17\n" +"X-Generator: Weblate 5.10.4\n" #. module: survey_contact_generation #: model:ir.model.fields,field_description:survey_contact_generation.field_survey_question__allowed_partner_field_domain msgid "Allowed Partner Field Domain" -msgstr "" +msgstr "Dominio campo partner consentito" #. module: survey_contact_generation #: model:survey.question,title:survey_contact_generation.survey_contact_q3 From 5b6e78faf5eec0158162b178932e726dad6d67b1 Mon Sep 17 00:00:00 2001 From: Laya Rabasa Date: Tue, 11 Aug 2026 09:37:49 +0000 Subject: [PATCH 26/27] [IMP] survey_contact_generation: pre-commit auto fixes --- .../demo/survey_contact_generation_demo.xml | 2 +- survey_contact_generation/models/survey_question.py | 6 +++--- survey_contact_generation/models/survey_user_input.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/survey_contact_generation/demo/survey_contact_generation_demo.xml b/survey_contact_generation/demo/survey_contact_generation_demo.xml index b01dd4fe..f67b608e 100644 --- a/survey_contact_generation/demo/survey_contact_generation_demo.xml +++ b/survey_contact_generation/demo/survey_contact_generation_demo.xml @@ -1,6 +1,6 @@ - + Contact Creation Survey 80e5f1e2-1a9d-4c51-8e23-09e93f7fa2c5 diff --git a/survey_contact_generation/models/survey_question.py b/survey_contact_generation/models/survey_question.py index dbe62743..e1585764 100644 --- a/survey_contact_generation/models/survey_question.py +++ b/survey_contact_generation/models/survey_question.py @@ -53,9 +53,9 @@ def default_get(self, fields): return result res = self.env[partner_field.relation].search([], limit=1) if res: - result[ - "res_partner_field_resource_ref" - ] = f"{partner_field.relation},{res.id}" + result["res_partner_field_resource_ref"] = ( + f"{partner_field.relation},{res.id}" + ) return result @api.model diff --git a/survey_contact_generation/models/survey_user_input.py b/survey_contact_generation/models/survey_user_input.py index 58addb9a..eaa04164 100644 --- a/survey_contact_generation/models/survey_user_input.py +++ b/survey_contact_generation/models/survey_user_input.py @@ -23,9 +23,9 @@ def _prepare_partner(self): for line in elegible_inputs - basic_inputs: field_name = line.question_id.res_partner_field.name if line.question_id.res_partner_field.ttype == "many2one": - vals[ - field_name - ] = line.suggested_answer_id.res_partner_field_resource_ref.id + vals[field_name] = ( + line.suggested_answer_id.res_partner_field_resource_ref.id + ) elif line.question_id.res_partner_field.ttype == "many2many": vals.setdefault(field_name, []) vals[field_name] += [ From 1e7cc4983700b6ebf3d1ad2818fc0beb6e732722 Mon Sep 17 00:00:00 2001 From: Laya Rabasa Date: Wed, 17 Jun 2026 16:51:04 +0000 Subject: [PATCH 27/27] [MIG] survey_contact_generation: Migration to 18.0 --- survey_contact_generation/README.rst | 18 ++++------ survey_contact_generation/__manifest__.py | 2 +- .../demo/survey_contact_generation_demo.xml | 7 ---- .../static/description/index.html | 34 ++++++++---------- .../survey_contact_generation_tour.esm.js | 35 ++++++++++--------- 5 files changed, 40 insertions(+), 56 deletions(-) diff --git a/survey_contact_generation/README.rst b/survey_contact_generation/README.rst index 0ace717a..37b5e4c8 100644 --- a/survey_contact_generation/README.rst +++ b/survey_contact_generation/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ========================== Survey contacts generation ========================== @@ -11,23 +7,23 @@ Survey contacts generation !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:88258b218ef6c2d962226485f10c68c20b12f1afacd5dd070883960d0b9c5273 + !! source digest: sha256:2e0c4714ac81aad4af2b53c4abb4a1563618e3d5a237ed7e93c48219514fd899 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |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/license-AGPL--3-blue.png +.. |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/17.0/survey_contact_generation + :target: https://github.com/OCA/survey/tree/18.0/survey_contact_generation :alt: OCA/survey .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/survey-17-0/survey-17-0-survey_contact_generation + :target: https://translation.odoo-community.org/projects/survey-18-0/survey-18-0-survey_contact_generation :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/survey&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/survey&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -68,7 +64,7 @@ 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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -111,6 +107,6 @@ Current `maintainer `__: |maintainer-pilarvargas-tecnativa| -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_contact_generation/__manifest__.py b/survey_contact_generation/__manifest__.py index de931de2..10fdd7ca 100644 --- a/survey_contact_generation/__manifest__.py +++ b/survey_contact_generation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Survey contacts generation", "summary": "Generate new contacts from surveys", - "version": "17.0.1.0.1", + "version": "18.0.1.0.0", "development_status": "Beta", "category": "Marketing/Survey", "website": "https://github.com/OCA/survey", diff --git a/survey_contact_generation/demo/survey_contact_generation_demo.xml b/survey_contact_generation/demo/survey_contact_generation_demo.xml index f67b608e..673afe40 100644 --- a/survey_contact_generation/demo/survey_contact_generation_demo.xml +++ b/survey_contact_generation/demo/survey_contact_generation_demo.xml @@ -46,13 +46,6 @@ numerical_box - - - 4 - Date - date - - 4 diff --git a/survey_contact_generation/static/description/index.html b/survey_contact_generation/static/description/index.html index 3b17ec76..d44429c2 100644 --- a/survey_contact_generation/static/description/index.html +++ b/survey_contact_generation/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Survey contacts generation -
+
+

Survey contacts generation

- - -Odoo Community Association - -
-

Survey contacts generation

-

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

+

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

This module allows to generate new contacts from surveys answers.

Table of contents

@@ -391,7 +386,7 @@

Survey contacts generation

-

Configuration

+

Configuration

To configure the contact generation:

  1. Go to the configured survey.
  2. @@ -408,28 +403,28 @@

    Configuration

-

Usage

+

Usage

if the survey is properly configured, once it is submited by an anonomous user, a new contact is create or an existing one is linked.

-

Bug Tracker

+

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 to smash it by providing a detailed and welcomed -feedback.

+feedback.

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -451,11 +446,10 @@

Maintainers

promote its widespread use.

Current maintainer:

pilarvargas-tecnativa

-

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_contact_generation/static/tests/survey_contact_generation_tour.esm.js b/survey_contact_generation/static/tests/survey_contact_generation_tour.esm.js index 0393f18d..58787c7b 100644 --- a/survey_contact_generation/static/tests/survey_contact_generation_tour.esm.js +++ b/survey_contact_generation/static/tests/survey_contact_generation_tour.esm.js @@ -3,83 +3,84 @@ import {registry} from "@web/core/registry"; registry.category("web_tour.tours").add("test_survey_contact_generation", { - test: true, url: "/survey/start/80e5f1e2-1a9d-4c51-8e23-09e93f7fa2c5", steps: () => [ { content: "Click on Start", trigger: "button.btn:contains('Start Survey')", + run: "click", }, { content: "Company Name", trigger: "div.js_question-wrapper input", - run: "text My Company Name", + run: "edit My Company Name", }, { content: "Submit and go to Next Page", trigger: 'button[value="next"]', + run: "click", }, { content: "Name", trigger: "div.js_question-wrapper input", - run: "text My Name", + run: "edit My Name", }, { content: "Submit and go to Next Page", trigger: 'button[value="next"]', + run: "click", }, { content: "Email", trigger: "div.js_question-wrapper input", - run: "text survey_contact_generation@test.com", + run: "edit survey_contact_generation@test.com", }, { content: "Submit and go to Next Page", trigger: 'button[value="next"]', + run: "click", }, { content: "Notes", trigger: "div.js_question-wrapper textarea", - run: "text This is a test note", + run: "edit This is a test note", }, { content: "Submit and go to Next Page", trigger: 'button[value="next"]', + run: "click", }, { content: "Color", trigger: "div.js_question-wrapper input", - run: "text 1", - }, - { - content: "Submit and go to Next Page", - trigger: 'button[value="next"]', - }, - { - content: "Date", - trigger: "div.js_question-wrapper input", - run: "text 01/01/2023", + run: "edit 1", }, { content: "Submit and go to Next Page", trigger: 'button[value="next"]', + run: "click", }, { content: "Country", trigger: "div.js_question-wrapper label:contains('Romania') i.fa-circle-thin", + run: "click", }, { content: "Tags", - trigger: "div.js_question-wrapper label:contains('Prospects') i", + trigger: + "div.js_question-wrapper label:contains('Prospects') i.fa-square-o", + run: "click", }, { content: "Tags", - trigger: "div.js_question-wrapper label:contains('Vendor') i", + trigger: "div.js_question-wrapper label:contains('Vendor') i.fa-square-o", + run: "click", }, { content: "Click Submit", trigger: "button[value='finish'].btn-secondary", + run: "click", }, { content: "Thank you",