[IMP] survey_record_generation: add README
This commit is contained in:
146
survey_record_generation/README.rst
Normal file
146
survey_record_generation/README.rst
Normal file
@@ -0,0 +1,146 @@
|
||||
========================
|
||||
Survey record generation
|
||||
========================
|
||||
|
||||
..
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:03eeb5c11b7d8330051c416331c84103b2641351fdc1d0a1bad43acd09501a33
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |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/16.0/survey_record_generation
|
||||
:alt: OCA/survey
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/survey-16-0/survey-16-0-survey_record_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=16.0
|
||||
:alt: Try me on Runboat
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module allows to generate any record from surveys answers.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Use Cases / Context
|
||||
===================
|
||||
|
||||
In several cases we want to use survey application to create records.
|
||||
Website form application give the same possibility but the design is integrated on the web site.
|
||||
Futhermore this module add other functionnalities like "duplicate" check, or creation of several interconnected records
|
||||
|
||||
Typical use case : Information request form
|
||||
|
||||
#. Submitting the form will create a contact (partner) only if it does not already exist in the database.
|
||||
#. Submitting the form will also create a crm opportunity linked to previously created partner
|
||||
|
||||
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
Record generation configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. |Image of record creation list| image:: https://raw.githubusercontent.com/OCA/survey/16.0/survey_record_generation/static/description/record-creations.png
|
||||
|
||||
#. Go to the the survey
|
||||
#. In *Record creation* tab add a new line
|
||||
#. Set a name for created record, select the Model of the record (eg: Prospect)
|
||||
#. Add a field configuration. So for each field :
|
||||
|
||||
.. |Image of record creation fields| image:: https://raw.githubusercontent.com/OCA/survey/16.0/survey_record_generation/static/description/record-creation-customer.png
|
||||
|
||||
#. You can check "unicity constraint" to prevent duplicates.
|
||||
In case of duplicates and if other record use this record to fill a m2o field, the founded record will be used
|
||||
#. You can configure explicitly where Odoo should retrieve the value of field :
|
||||
* **fixed**: To set explicit value
|
||||
* **question**: If value come from user's answer
|
||||
For m2o or m2m links, question should be configured before. See Question answers configuration section below.
|
||||
* **other created record**: If value come from other created record (m2o case only)
|
||||
|
||||
|
||||
|
||||
Question answers configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In a survey question : to configure value of choices
|
||||
|
||||
.. |Question answers| image:: https://raw.githubusercontent.com/OCA/survey/16.0/survey_record_generation/static/description/question-answers.png
|
||||
|
||||
#. Configure a multiple choice question
|
||||
#. Select value type associated to answer:
|
||||
* **Value** > eg: to fill a selection field
|
||||
* **Record** > to fill m2o or m2m field
|
||||
#. In case of *record* type:
|
||||
#. Select referenced model
|
||||
#. You can directly fill answers (eventualy with help of the domain field)
|
||||
#. Or create new answers and set associated record
|
||||
#. In case of *value* type:
|
||||
#. Add new selectable answers and set associated value
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
When a survey is properly configured, once it is submited by a user, records should be created.
|
||||
|
||||
To find records generated from a participation go to:
|
||||
|
||||
#. Survey > participation
|
||||
#. Click on **# Generated records** button (top-right)
|
||||
|
||||
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_record_generation%0Aversion:%2016.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
|
||||
~~~~~~~
|
||||
|
||||
* Elabore
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* `Elabore <https://www.elabore.coop>`_
|
||||
|
||||
* Clément Thomas
|
||||
|
||||
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.
|
||||
|
||||
This module is part of the `OCA/survey <https://github.com/OCA/survey/tree/16.0/survey_record_generation>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
@@ -1,10 +1,36 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
from odoo import models
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class SurveyUserInput(models.Model):
|
||||
_inherit = "survey.user_input"
|
||||
|
||||
generated_record_ids = fields.One2many('survey.generated.record', 'user_input_id', 'Generated records')
|
||||
generated_records_count = fields.Integer("Attempts Count", compute='_compute_generated_records_count')
|
||||
|
||||
def _compute_generated_records_count(self):
|
||||
for user_input in self:
|
||||
user_input.generated_records_count = len(user_input.generated_record_ids)
|
||||
|
||||
|
||||
def action_redirect_to_generated_records(self):
|
||||
self.ensure_one()
|
||||
|
||||
action = self.env['ir.actions.act_window']._for_xml_id('survey_record_generation.survey_generated_record_action')
|
||||
""" context = dict(self.env.context or {})
|
||||
|
||||
context['create'] = False
|
||||
context['search_default_survey_id'] = self.survey_id.id
|
||||
context['search_default_group_by_survey'] = False
|
||||
if self.partner_id:
|
||||
context['search_default_partner_id'] = self.partner_id.id
|
||||
elif self.email:
|
||||
context['search_default_email'] = self.email
|
||||
|
||||
action['context'] = context """
|
||||
|
||||
return action
|
||||
|
||||
def _mark_done(self):
|
||||
# generate records
|
||||
for user_input in self:
|
||||
@@ -58,13 +84,25 @@ class SurveyUserInput(models.Model):
|
||||
else:
|
||||
# Create record
|
||||
record = self.env[model].create(vals)
|
||||
# Link generated records to user input
|
||||
self.env['survey.generated.record'].create({
|
||||
'survey_record_creation_name':record_creation.name,
|
||||
'survey_record_creation_id':record_creation.id,
|
||||
'user_input_id':user_input.id,
|
||||
"created_record_id":"%s,%s" % (model,record.id)
|
||||
})
|
||||
|
||||
created_records[record_creation.id] = record
|
||||
|
||||
|
||||
|
||||
# update linked records
|
||||
for field_to_update in fields_to_update:
|
||||
record_to_update = created_records[field_to_update.survey_record_creation_id.id]
|
||||
linked_record = created_records[field_to_update.other_created_record_id.id]
|
||||
record_to_update.write({field_to_update.field_id.name:linked_record.id})
|
||||
|
||||
|
||||
|
||||
|
||||
return super()._mark_done()
|
||||
|
40
survey_record_generation/readme/CONFIGURE.rst
Normal file
40
survey_record_generation/readme/CONFIGURE.rst
Normal file
@@ -0,0 +1,40 @@
|
||||
Record generation configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. |Image of record creation list| image:: ../static/description/record-creations.png
|
||||
|
||||
#. Go to the the survey
|
||||
#. In *Record creation* tab add a new line
|
||||
#. Set a name for created record, select the Model of the record (eg: Prospect)
|
||||
#. Add a field configuration. So for each field :
|
||||
|
||||
.. |Image of record creation fields| image:: ../static/description/record-creation-customer.png
|
||||
|
||||
#. You can check "unicity constraint" to prevent duplicates.
|
||||
In case of duplicates and if other record use this record to fill a m2o field, the founded record will be used
|
||||
#. You can configure explicitly where Odoo should retrieve the value of field :
|
||||
* **fixed**: To set explicit value
|
||||
* **question**: If value come from user's answer
|
||||
For m2o or m2m links, question should be configured before. See Question answers configuration section below.
|
||||
* **other created record**: If value come from other created record (m2o case only)
|
||||
|
||||
|
||||
|
||||
Question answers configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In a survey question : to configure value of choices
|
||||
|
||||
.. |Question answers| image:: ../static/description/question-answers.png
|
||||
|
||||
#. Configure a multiple choice question
|
||||
#. Select value type associated to answer:
|
||||
* **Value** > eg: to fill a selection field
|
||||
* **Record** > to fill m2o or m2m field
|
||||
#. In case of *record* type:
|
||||
#. Select referenced model
|
||||
#. You can directly fill answers (eventualy with help of the domain field)
|
||||
#. Or create new answers and set associated record
|
||||
#. In case of *value* type:
|
||||
#. Add new selectable answers and set associated value
|
||||
|
10
survey_record_generation/readme/CONTEXT.rst
Normal file
10
survey_record_generation/readme/CONTEXT.rst
Normal file
@@ -0,0 +1,10 @@
|
||||
In several cases we want to use survey application to create records.
|
||||
Website form application give the same possibility but the design is integrated on the web site.
|
||||
Futhermore this module add other functionnalities like "duplicate" check, or creation of several interconnected records
|
||||
|
||||
Typical use case : Information request form
|
||||
|
||||
#. Submitting the form will create a contact (partner) only if it does not already exist in the database.
|
||||
#. Submitting the form will also create a crm opportunity linked to previously created partner
|
||||
|
||||
|
3
survey_record_generation/readme/CONTRIBUTORS.rst
Normal file
3
survey_record_generation/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
* `Elabore <https://www.elabore.coop>`_
|
||||
|
||||
* Clément Thomas
|
1
survey_record_generation/readme/DESCRIPTION.rst
Normal file
1
survey_record_generation/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1 @@
|
||||
This module allows to generate any record from surveys answers.
|
6
survey_record_generation/readme/USAGE.rst
Normal file
6
survey_record_generation/readme/USAGE.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
When a survey is properly configured, once it is submited by a user, records should be created.
|
||||
|
||||
To find records generated from a participation go to:
|
||||
|
||||
#. Survey > participation
|
||||
#. Click on **# Generated records** button (top-right)
|
526
survey_record_generation/static/description/index.html
Normal file
526
survey_record_generation/static/description/index.html
Normal file
@@ -0,0 +1,526 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||
<title>Survey record generation</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
Despite the name, some widely supported CSS2 features are used.
|
||||
|
||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: gray; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic, pre.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="survey-record-generation">
|
||||
<h1 class="title">Survey record generation</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:03eeb5c11b7d8330051c416331c84103b2641351fdc1d0a1bad43acd09501a33
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/survey/tree/16.0/survey_record_generation"><img alt="OCA/survey" src="https://img.shields.io/badge/github-OCA%2Fsurvey-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/survey-16-0/survey-16-0-survey_record_generation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/survey&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module allows to generate any record from surveys answers.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#use-cases-context" id="toc-entry-1">Use Cases / Context</a></li>
|
||||
<li><a class="reference internal" href="#configuration" id="toc-entry-2">Configuration</a><ul>
|
||||
<li><a class="reference internal" href="#record-generation-configuration" id="toc-entry-3">Record generation configuration</a></li>
|
||||
<li><a class="reference internal" href="#question-answers-configuration" id="toc-entry-4">Question answers configuration</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#usage" id="toc-entry-5">Usage</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-6">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-7">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-8">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-9">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-10">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="use-cases-context">
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Use Cases / Context</a></h1>
|
||||
<p>In several cases we want to use survey application to create records.
|
||||
Website form application give the same possibility but the design is integrated on the web site.
|
||||
Futhermore this module add other functionnalities like “duplicate” check, or creation of several interconnected records</p>
|
||||
<p>Typical use case : Information request form</p>
|
||||
<ol class="arabic simple">
|
||||
<li>Submitting the form will create a contact (partner) only if it does not already exist in the database.</li>
|
||||
<li>Submitting the form will also create a crm opportunity linked to previously created partner</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="configuration">
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
|
||||
<div class="section" id="record-generation-configuration">
|
||||
<h2><a class="toc-backref" href="#toc-entry-3">Record generation configuration</a></h2>
|
||||
<ol class="arabic">
|
||||
<li><p class="first">Go to the the survey</p>
|
||||
</li>
|
||||
<li><p class="first">In <em>Record creation</em> tab add a new line</p>
|
||||
</li>
|
||||
<li><p class="first">Set a name for created record, select the Model of the record (eg: Prospect)</p>
|
||||
</li>
|
||||
<li><p class="first">Add a field configuration. So for each field :</p>
|
||||
<blockquote>
|
||||
<ol class="arabic simple">
|
||||
<li><dl class="first docutils">
|
||||
<dt>You can check “unicity constraint” to prevent duplicates.</dt>
|
||||
<dd>In case of duplicates and if other record use this record to fill a m2o field, the founded record will be used</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><dl class="first docutils">
|
||||
<dt>You can configure explicitly where Odoo should retrieve the value of field :</dt>
|
||||
<dd><ul class="first last">
|
||||
<li><strong>fixed</strong>: To set explicit value</li>
|
||||
<li><dl class="first docutils">
|
||||
<dt><strong>question</strong>: If value come from user’s answer</dt>
|
||||
<dd>For m2o or m2m links, question should be configured before. See Question answers configuration section below.</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><strong>other created record</strong>: If value come from other created record (m2o case only)</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ol>
|
||||
</blockquote>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="question-answers-configuration">
|
||||
<h2><a class="toc-backref" href="#toc-entry-4">Question answers configuration</a></h2>
|
||||
<p>In a survey question : to configure value of choices</p>
|
||||
<ol class="arabic simple">
|
||||
<li>Configure a multiple choice question</li>
|
||||
<li><dl class="first docutils">
|
||||
<dt>Select value type associated to answer:</dt>
|
||||
<dd><ul class="first last">
|
||||
<li><strong>Value</strong> > eg: to fill a selection field</li>
|
||||
<li><strong>Record</strong> > to fill m2o or m2m field</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><dl class="first docutils">
|
||||
<dt>In case of <em>record</em> type:</dt>
|
||||
<dd><ol class="first last arabic">
|
||||
<li>Select referenced model</li>
|
||||
<li>You can directly fill answers (eventualy with help of the domain field)</li>
|
||||
<li>Or create new answers and set associated record</li>
|
||||
</ol>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><dl class="first docutils">
|
||||
<dt>In case of <em>value</em> type:</dt>
|
||||
<dd><ol class="first last arabic">
|
||||
<li>Add new selectable answers and set associated value</li>
|
||||
</ol>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#toc-entry-5">Usage</a></h1>
|
||||
<p>When a survey is properly configured, once it is submited by a user, records should be created.</p>
|
||||
<p>To find records generated from a participation go to:</p>
|
||||
<ol class="arabic simple">
|
||||
<li>Survey > participation</li>
|
||||
<li>Click on <strong># Generated records</strong> button (top-right)</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#toc-entry-6">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/survey/issues">GitHub Issues</a>.
|
||||
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
|
||||
<a class="reference external" href="https://github.com/OCA/survey/issues/new?body=module:%20survey_record_generation%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#toc-entry-7">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-8">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Elabore</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-9">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li><a class="reference external" href="https://www.elabore.coop">Elabore</a><ul>
|
||||
<li>Clément Thomas</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org">
|
||||
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
||||
</a>
|
||||
<p>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.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/survey/tree/16.0/survey_record_generation">OCA/survey</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
survey_record_generation/static/description/question-answers.png
Normal file
BIN
survey_record_generation/static/description/question-answers.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
Binary file not shown.
After Width: | Height: | Size: 105 KiB |
BIN
survey_record_generation/static/description/record-creations.png
Normal file
BIN
survey_record_generation/static/description/record-creations.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 150 KiB |
Reference in New Issue
Block a user