Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e81252d
[ADD] survey_contact_generation: New module
chienandalu Jun 1, 2023
4e82811
[IMP] survey_contact_generation: Add test coverage
stefan-tecnativa Jun 14, 2023
1185d08
[IMP] survey_contact_generation: pre-commit stuff
stefan-tecnativa Jun 15, 2023
7d357c8
[MIG] survey_contact_generation: Migration to 15.0
stefan-tecnativa Jun 15, 2023
a8058db
[IMP] survey_contact_generation: multiple choice
chienandalu Jun 20, 2023
566c180
[IMP] survey_contact_generation: Improve test coverage
stefan-tecnativa Jun 22, 2023
0893b37
[FIX] survey_contact_generation: Multiple choices text answers were
stefan-tecnativa Jun 22, 2023
99d44cc
Added translation using Weblate (Italian)
mymage Oct 27, 2023
771f8a5
Translated using Weblate (Italian)
mymage Oct 29, 2023
2821b01
Translated using Weblate (Spanish)
Ivorra78 Nov 11, 2023
148bcc4
[IMP] survey_contact_generation: parent company
chienandalu Feb 8, 2024
42b62ab
Translated using Weblate (Italian)
mymage Feb 12, 2024
311221f
[IMP] survey_contact_generation: link partner
chienandalu Feb 13, 2024
42adb5c
Translated using Weblate (Italian)
mymage Feb 26, 2024
9d5b686
[IMP] survey_contact_generation: partner hook method
chienandalu Mar 14, 2024
60b3166
[IMP] survey_contact_generation: email case match
chienandalu Apr 22, 2024
4d89d5e
[IMP] survey_contact_generation: pre-commit auto fixes
pilarvargas-tecnativa Apr 7, 2025
da411a9
[MIG] survey_contact_generation: Migration to version 17.0
pilarvargas-tecnativa Apr 7, 2025
6c50027
[IMP-FIX] survey_contact_generation: Set descriptive field name to av…
pilarvargas-tecnativa Nov 10, 2025
d4fe800
Translated using Weblate (Italian)
mymage Nov 11, 2025
41bf20f
[IMP] survey_contact_generation: add posibility to create more than o…
eduezerouali-tecnativa Jul 10, 2026
5a7372f
[IMP] survey_contact_generation: pre-commit auto fixes
adasatorres-tecnativa Aug 11, 2026
3acadf5
[MIG] survey_contact_generation: Migration to version 19.0
adasatorres-tecnativa Aug 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions survey_contact_generation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
.. 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
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1cc82509977655cfc45ab7ead533ec21a2b39cc308129b35a4ad8b84cbd07891
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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
: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/19.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-19-0/survey-19-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=19.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:

1. Go to the configured survey.
2. 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.
3. If you want the generated to have a parent company, set the option
*Create Parent Contact* and link the company_name field to a question
in the survey.
4. 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.

To generate a hierarchy of contacts out of a single survey:

1. A question mapped to the *Name* contact field opens a contact of its
own. Any other question fills in a field of the contact opened by its
*Node*.
2. In such a question, set *Node* to the question opening the contact it
hangs from. Leave it empty and its answers will belong to the main
generated contact.
3. Contacts typed as *Contact* share their address with their parent, so
set *Contact address type* to *Other address* in the questions
opening a contact that holds an address of its own.

For instance, this survey generates a company, two of its workcenters
with their own address, and an employee hanging from each workcenter:

===================== ============= ============ =============
Question Contact field Node Address type
===================== ============= ============ =============
Company name name
Workcenter 1 name Company name Other address
Workcenter 1 street street Workcenter 1
Workcenter 1 employee name Workcenter 1
Workcenter 2 name Company name Other address
Workcenter 2 street street Workcenter 2
Workcenter 2 employee name Workcenter 2
===================== ============= ============ =============

A node whose name goes unanswered generates no contact, and whatever
hangs from it hangs from its own node instead.

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 <https://github.com/OCA/survey/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 <https://github.com/OCA/survey/issues/new?body=module:%20survey_contact_generation%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__

- David Vidal
- Ernesto Tejeda
- Stefan Ungureanu
- Pilar Vargas
- Eduardo Ezerouali
- Adasat Torres

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-pilarvargas-tecnativa| image:: https://github.com/pilarvargas-tecnativa.png?size=40px
:target: https://github.com/pilarvargas-tecnativa
:alt: pilarvargas-tecnativa

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-pilarvargas-tecnativa|

This module is part of the `OCA/survey <https://github.com/OCA/survey/tree/19.0/survey_contact_generation>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions survey_contact_generation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
27 changes: 27 additions & 0 deletions survey_contact_generation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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": "19.0.1.0.0",
"development_status": "Beta",
"category": "Marketing/Survey",
"website": "https://github.com/OCA/survey",
"author": "Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["pilarvargas-tecnativa"],
"license": "AGPL-3",
"depends": ["survey"],
"data": [
"views/survey_question_views.xml",
"views/survey_survey_views.xml",
],
"demo": [
"demo/survey_contact_generation_demo.xml",
"demo/survey_contact_nesting_demo.xml",
],
"assets": {
"web.assets_tests": [
"/survey_contact_generation/static/tests/survey_contact_generation_tour.esm.js",
],
},
}
101 changes: 101 additions & 0 deletions survey_contact_generation/demo/survey_contact_generation_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Survey-->
<record model="survey.survey" id="survey_contact_creation">
<field name="title">Contact Creation Survey</field>
<field name="access_mode">public</field>
<field name="users_can_go_back" eval="True" />
<field name="generate_contact" eval="True" />
<field name="create_parent_contact" eval="True" />
</record>
<record model="survey.question" id="survey_contact_q_company_name">
<field name="survey_id" ref="survey_contact_creation" />
<field name="sequence">0</field>
<field name="title">Company name</field>
<field name="question_type">char_box</field>
<field name="constr_mandatory" eval="True" />
<field name="res_partner_field" ref="base.field_res_partner__company_name" />
</record>
<record model="survey.question" id="survey_contact_q0">
<field name="survey_id" ref="survey_contact_creation" />
<field name="sequence">0</field>
<field name="title">Name</field>
<field name="question_type">char_box</field>
<field name="constr_mandatory" eval="True" />
<field name="res_partner_field" ref="base.field_res_partner__name" />
</record>
<record model="survey.question" id="survey_contact_q1">
<field name="survey_id" ref="survey_contact_creation" />
<field name="sequence">1</field>
<field name="title">Email</field>
<field name="question_type">char_box</field>
<field name="res_partner_field" ref="base.field_res_partner__email" />
</record>
<record model="survey.question" id="survey_contact_q2">
<field name="survey_id" ref="survey_contact_creation" />
<field name="sequence">2</field>
<field name="title">Notes</field>
<field name="question_type">text_box</field>
<field name="res_partner_field" ref="base.field_res_partner__comment" />
</record>
<record model="survey.question" id="survey_contact_q3">
<field name="survey_id" ref="survey_contact_creation" />
<field name="sequence">3</field>
<field name="title">Color</field>
<field name="question_type">numerical_box</field>
<field name="res_partner_field" ref="base.field_res_partner__color" />
</record>
<record model="survey.question" id="survey_contact_q5">
<field name="survey_id" ref="survey_contact_creation" />
<field name="sequence">4</field>
<field name="title">Country</field>
<field name="question_type">simple_choice</field>
<field name="res_partner_field" ref="base.field_res_partner__country_id" />
</record>
<record model="survey.question.answer" id="survey_contact_q5_sug1">
<field name="question_id" ref="survey_contact_q5" />
<field name="sequence">1</field>
<field name="value">Spain</field>
<field name="res_partner_field_resource_ref" ref="base.es" />
</record>
<record model="survey.question.answer" id="survey_contact_q5_sug2">
<field name="question_id" ref="survey_contact_q5" />
<field name="sequence">2</field>
<field name="value">Romania</field>
<field name="res_partner_field_resource_ref" ref="base.ro" />
</record>
<record model="survey.question" id="survey_contact_q6">
<field name="survey_id" ref="survey_contact_creation" />
<field name="sequence">4</field>
<field name="title">Tags</field>
<field name="question_type">multiple_choice</field>
<field name="res_partner_field" ref="base.field_res_partner__category_id" />
</record>
<record model="survey.question.answer" id="survey_contact_q6_sug1">
<field name="question_id" ref="survey_contact_q6" />
<field name="sequence">1</field>
<field name="value">Vendor</field>
<field
name="res_partner_field_resource_ref"
ref="base.res_partner_category_0"
/>
</record>
<record model="survey.question.answer" id="survey_contact_q6_sug2">
<field name="question_id" ref="survey_contact_q6" />
<field name="sequence">2</field>
<field name="value">Prospects</field>
<field
name="res_partner_field_resource_ref"
ref="base.res_partner_category_2"
/>
</record>
<record model="survey.question.answer" id="survey_contact_q6_sug3">
<field name="question_id" ref="survey_contact_q6" />
<field name="sequence">3</field>
<field name="value">Employees</field>
<field
name="res_partner_field_resource_ref"
ref="base.res_partner_category_3"
/>
</record>
</odoo>
86 changes: 86 additions & 0 deletions survey_contact_generation/demo/survey_contact_nesting_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- A survey generating a hierarchy of contacts:

Company
├── Workcenter 1 (holds its own address)
│ └── Employee 1
└── Workcenter 2 (holds its own address)
└── Employee 2
-->
<record model="survey.survey" id="survey_contact_nesting">
<field name="title">Nested Contact Creation Survey</field>
<field name="access_token">6c1b2f84-9a3d-4e77-b0c2-1d5e8a4f7c93</field>
<field name="access_mode">public</field>
<field name="users_can_go_back" eval="True" />
<field name="generate_contact" eval="True" />
</record>
<record model="survey.question" id="survey_nesting_q_company">
<field name="survey_id" ref="survey_contact_nesting" />
<field name="sequence">0</field>
<field name="title">Company name</field>
<field name="question_type">char_box</field>
<field name="constr_mandatory" eval="True" />
<field name="res_partner_field" ref="base.field_res_partner__name" />
</record>
<!-- First workcenter, hanging from the company-->
<record model="survey.question" id="survey_nesting_q_workcenter_1">
<field name="survey_id" ref="survey_contact_nesting" />
<field name="sequence">1</field>
<field name="title">Workcenter 1</field>
<field name="question_type">char_box</field>
<field name="res_partner_field" ref="base.field_res_partner__name" />
<field name="survey_question_node_id" ref="survey_nesting_q_company" />
<field name="res_partner_type">other</field>
</record>
<record model="survey.question" id="survey_nesting_q_workcenter_1_street">
<field name="survey_id" ref="survey_contact_nesting" />
<field name="sequence">2</field>
<field name="title">Workcenter 1 street</field>
<field name="question_type">char_box</field>
<field name="res_partner_field" ref="base.field_res_partner__street" />
<field name="survey_question_node_id" ref="survey_nesting_q_workcenter_1" />
</record>
<record model="survey.question" id="survey_nesting_q_employee_1">
<field name="survey_id" ref="survey_contact_nesting" />
<field name="sequence">3</field>
<field name="title">Workcenter 1 employee</field>
<field name="question_type">char_box</field>
<field name="res_partner_field" ref="base.field_res_partner__name" />
<field name="survey_question_node_id" ref="survey_nesting_q_workcenter_1" />
</record>
<record model="survey.question" id="survey_nesting_q_employee_1_email">
<field name="survey_id" ref="survey_contact_nesting" />
<field name="sequence">4</field>
<field name="title">Workcenter 1 employee email</field>
<field name="question_type">char_box</field>
<field name="res_partner_field" ref="base.field_res_partner__email" />
<field name="survey_question_node_id" ref="survey_nesting_q_employee_1" />
</record>
<!-- Second workcenter, sibling of the first one-->
<record model="survey.question" id="survey_nesting_q_workcenter_2">
<field name="survey_id" ref="survey_contact_nesting" />
<field name="sequence">5</field>
<field name="title">Workcenter 2</field>
<field name="question_type">char_box</field>
<field name="res_partner_field" ref="base.field_res_partner__name" />
<field name="survey_question_node_id" ref="survey_nesting_q_company" />
<field name="res_partner_type">other</field>
</record>
<record model="survey.question" id="survey_nesting_q_workcenter_2_street">
<field name="survey_id" ref="survey_contact_nesting" />
<field name="sequence">6</field>
<field name="title">Workcenter 2 street</field>
<field name="question_type">char_box</field>
<field name="res_partner_field" ref="base.field_res_partner__street" />
<field name="survey_question_node_id" ref="survey_nesting_q_workcenter_2" />
</record>
<record model="survey.question" id="survey_nesting_q_employee_2">
<field name="survey_id" ref="survey_contact_nesting" />
<field name="sequence">7</field>
<field name="title">Workcenter 2 employee</field>
<field name="question_type">char_box</field>
<field name="res_partner_field" ref="base.field_res_partner__name" />
<field name="survey_question_node_id" ref="survey_nesting_q_workcenter_2" />
</record>
</odoo>
Loading
Loading