Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d3d52c3
[ADD] survey_sale_generation: New module 13.0
chienandalu Dec 30, 2022
e5d420e
[IMP] survey_sale_generation: add tests
chienandalu Jan 16, 2023
018d3f1
survey_sale_generation 13.0.1.1.0
OCA-git-bot Jan 17, 2023
55242c6
[IMP] survey_sale_generation: black, isort, prettier
stefan-tecnativa Jun 1, 2023
f95c066
[MIG] survey_sale_generation: Migration to 15.0
stefan-tecnativa Jun 1, 2023
ea89d49
Added translation using Weblate (Italian)
mymage Oct 27, 2023
d2601c2
Translated using Weblate (Italian)
mymage Oct 29, 2023
9bdd986
Translated using Weblate (Spanish)
Ivorra78 Nov 11, 2023
4e6ed8f
[IMP] survey_sale_generation: send template and multiplier
chienandalu Aug 2, 2023
25d2836
[IMP] survey_sale_generation: multiple products
chienandalu Sep 18, 2023
6333b8c
[IMP] survey_sale_generation: quotation template
chienandalu Sep 18, 2023
abbadbe
[IMP] survey_sale_generation: support answer types in comments
chienandalu Nov 7, 2023
3f3a516
[IMP] Update translations
chienandalu Nov 16, 2023
e69c4f6
[FIX] survey_sale_generation: quotation sending user
chienandalu Nov 17, 2023
1b6a66f
[FIX] Create order with SUPERUSER as it's done in eCommerce
chienandalu Jan 26, 2024
3774260
[IMP] survey_sale_generation: sale field links
chienandalu Feb 12, 2024
68bf71c
[IMP] survey_sale_generation: sale template on answer
chienandalu Oct 25, 2024
bc99b5e
[IMP] survey_sale_generation: pre-commit auto fixes
pilarvargas-tecnativa Apr 10, 2025
5614892
[MIG] survey_sale_generation: Migration to version 17.0
pilarvargas-tecnativa Apr 10, 2025
a069586
[UPD] Update survey_sale_generation.pot
Apr 25, 2025
ef41bd3
[BOT] post-merge updates
OCA-git-bot Apr 25, 2025
82916ef
Translated using Weblate (Italian)
mymage Apr 28, 2025
4bcff99
[FIX] survey_sale_generation: use env.company instead of create_uid.c…
pilarvargas-tecnativa Jul 22, 2025
f6f3975
[BOT] post-merge updates
OCA-git-bot Jul 22, 2025
9f6ab0d
[IMP] survey_sale_generation: Prioritise company from order template …
pilarvargas-tecnativa Jul 23, 2025
f784720
[BOT] post-merge updates
OCA-git-bot Jul 23, 2025
e5a95b3
[IMP] survey_sale_generation: pre-commit auto fixes
Sep 11, 2025
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
154 changes: 154 additions & 0 deletions survey_sale_generation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
======================
Survey sale generation
======================

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

.. |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/18.0/survey_sale_generation
:alt: OCA/survey
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/survey-18-0/survey-18-0-survey_sale_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=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to generate quotations from surveys submits.

**Table of contents**

.. contents::
:local:

Configuration
=============

You can configure either a new or an existing survey.

1. Go to *Surveys* and choose an existing one or create it.
2. In the *Options* tab, *Sales* group, set *Generate Quotations* on.
3. You can set your preferred sales team for the generated quotations.

Now you'll have to configure the products linked to the questions.

For *Numerical value* questions:

1. In the *Answers* tab choose the linked products.
2. The resulting quotation will have as many items of that products as
the user defines.

For *Multiple choice: only one answer*:

1. In the *Answers* tab link multiple products to every given choice.
2. The resulting quotation will have the products linked to the survey
user's choice.

For *Multiple choice: multiple answers allowed*:

1. In the *Answers* tab link products to every given choice.
2. The resulting quotation will have the products linked to the survey
user's choices.
3. By default a unit of product will be added per answer to the
quotation. If you want to set a variable choice, you can link a
numeric question that will act as multiplier.

When the survey is submited an internal message is generated in the
resulting quotation with a link to the user answers. Optionally, you can
configure some of the questions so their input values are shown in such
message. This way it can be easier to track some relevant infos
concerning the request. To do so:

1. In the *Options* tab of the questions go to the *Sales* section.
2. Set *Show in sale order comment* on if you want those answers on the
internal notification.

If you want the generated quotation to use a quotation template you can
either:

- Choose it from the general survey options: *Sale Order Template*.
- In a single answer question, choose set the quotation depending on the
answer.

The answer value will prevail over the general option.

You can also configure the survey to send the quotation to the customer
by mail. When doing so, you can choose a mail template or use the
default one.

If you want to fill sale fields from the answers:

1. In the *Options* tab of the questions go to the *Sales* section.
2. Set *Sale the sale field* you want to fill with the given answer.

Usage
=====

Once the survey is configured, the users can fill them up as usual. The
quotations will be generated according to the survey users' choices.

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_sale_generation%0Aversion:%2018.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
- Stefan Ungureanu
- Pilar Vargas

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/18.0/survey_sale_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_sale_generation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
26 changes: 26 additions & 0 deletions survey_sale_generation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2022 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Survey sale generation",
"summary": "Generate sale orders from surveys",
"version": "18.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_result_mail", "sale_management"],
"data": [
"views/survey_question_views.xml",
"views/survey_survey_views.xml",
"views/survey_user_input_views.xml",
"views/sale_order_views.xml",
],
"demo": ["demo/survey_sale_demo.xml"],
"assets": {
"web.assets_tests": [
"/survey_sale_generation/static/tests/survey_sale_generation_tour.esm.js",
],
},
}
169 changes: 169 additions & 0 deletions survey_sale_generation/demo/survey_sale_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- We'll link these products to the survey questions -->
<record model="product.product" id="support_hours">
<field name="name">Support hours</field>
<field name="type">service</field>
<field name="list_price">100</field>
</record>
<record model="product.product" id="platinum_service">
<field name="name">Platinum support</field>
<field name="type">service</field>
<field name="list_price">10000</field>
</record>
<record model="product.product" id="gold_service">
<field name="name">Gold support</field>
<field name="type">service</field>
<field name="list_price">1000</field>
</record>
<record model="product.product" id="silver_service">
<field name="name">Silver support</field>
<field name="type">service</field>
<field name="list_price">500</field>
</record>
<record model="product.product" id="dedicated_server">
<field name="name">Dedicated Server</field>
<field name="type">service</field>
<field name="list_price">500</field>
</record>
<record model="product.product" id="advanced_backup">
<field name="name">Advanced Backup</field>
<field name="type">service</field>
<field name="list_price">500</field>
</record>
<record model="product.product" id="mail_management">
<field name="name">Mail Management</field>
<field name="type">service</field>
<field name="list_price">500</field>
</record>
<!-- Sales Team -->
<record model="crm.team" id="support_hiring">
<field name="name">Support Hiring</field>
</record>
<!-- Survey -->
<record model="survey.survey" id="survey_hire_support">
<field name="title">Hire Technical Support</field>
<field name="access_token">08b4db20-65cc-4c68-a711-cc364c54901b</field>
<field name="access_mode">public</field>
<field name="generate_quotations" eval="True" />
<field name="crm_team_id" ref="support_hiring" />
<field name="users_can_go_back" eval="True" />
</record>
<record model="survey.question" id="survey_support_q0_1">
<field name="survey_id" ref="survey_hire_support" />
<field name="sequence">0</field>
<field name="title">Name</field>
<field name="question_type">char_box</field>
<field name="show_in_sale_order_comment" eval="True" />
<field name="constr_mandatory" eval="True" />
</record>
<record model="survey.question" id="survey_support_q0">
<field name="survey_id" ref="survey_hire_support" />
<field name="sequence">1</field>
<field name="title">E-mail address</field>
<field name="question_type">char_box</field>
<field name="show_in_sale_order_comment" eval="True" />
<field name="constr_mandatory" eval="True" />
</record>
<record model="survey.question" id="survey_support_q1">
<field name="survey_id" ref="survey_hire_support" />
<field name="sequence">2</field>
<field name="title">How many hours will you hire monthly?</field>
<field name="question_type">numerical_box</field>
<field
name="product_ids"
eval="[Command.link(ref('survey_sale_generation.support_hours'))]"
/>
<field name="constr_mandatory" eval="True" />
</record>
<record model="survey.question" id="survey_support_q2">
<field name="survey_id" ref="survey_hire_support" />
<field name="sequence">3</field>
<field name="title">Choose your subscription level</field>
<field name="question_type">simple_choice</field>
<field name="constr_mandatory" eval="True" />
<field name="product_uom_qty_question_id" ref="survey_support_q1" />
</record>
<record model="survey.question.answer" id="survey_support_q2_sug1">
<field name="question_id" ref="survey_support_q2" />
<field name="sequence">1</field>
<field name="value">Platinum</field>
<field
name="product_ids"
eval="[Command.link(ref('survey_sale_generation.platinum_service'))]"
/>
</record>
<record model="survey.question.answer" id="survey_support_q2_sug2">
<field name="question_id" ref="survey_support_q2" />
<field name="sequence">2</field>
<field name="value">Gold</field>
<field
name="product_ids"
eval="[Command.link(ref('survey_sale_generation.gold_service'))]"
/>
</record>
<record model="survey.question.answer" id="survey_support_q2_sug3">
<field name="question_id" ref="survey_support_q2" />
<field name="sequence">3</field>
<field name="value">Silver</field>
<field
name="product_ids"
eval="[Command.link(ref('survey_sale_generation.silver_service'))]"
/>
</record>
<record model="survey.question" id="survey_support_q3">
<field name="survey_id" ref="survey_hire_support" />
<field name="sequence">5</field>
<field name="title">Choose your extras</field>
<field name="question_type">multiple_choice</field>
<field name="constr_mandatory" eval="False" />
</record>
<record model="survey.question.answer" id="survey_support_q3_sug1">
<field name="question_id" ref="survey_support_q3" />
<field name="sequence">1</field>
<field name="value">Dedicated Server</field>
<field
name="product_ids"
eval="[Command.link(ref('survey_sale_generation.dedicated_server'))]"
/>
</record>
<record model="survey.question.answer" id="survey_support_q3_sug2">
<field name="question_id" ref="survey_support_q3" />
<field name="sequence">2</field>
<field name="value">Advanced Backup</field>
<field
name="product_ids"
eval="[Command.link(ref('survey_sale_generation.advanced_backup'))]"
/>
</record>
<record model="survey.question.answer" id="survey_support_q3_sug3">
<field name="question_id" ref="survey_support_q3" />
<field name="sequence">3</field>
<field name="value">Mail Management</field>
<field
name="product_ids"
eval="[Command.link(ref('survey_sale_generation.mail_management'))]"
/>
</record>
<record model="survey.question" id="survey_support_q4">
<field name="survey_id" ref="survey_hire_support" />
<field name="sequence">6</field>
<field name="title">Referenced by</field>
<field name="question_type">simple_choice</field>
<field name="comments_allowed" eval="True" />
<field name="comment_count_as_answer" eval="True" />
<field name="comments_message">Other:</field>
<field name="sale_order_field" ref="sale.field_sale_order__origin" />
<field name="constr_mandatory" eval="True" />
</record>
<record model="survey.question.answer" id="survey_support_q4_sug1">
<field name="question_id" ref="survey_support_q4" />
<field name="sequence">1</field>
<field name="value">TV</field>
</record>
<record model="survey.question.answer" id="survey_support_q4_sug2">
<field name="question_id" ref="survey_support_q4" />
<field name="sequence">2</field>
<field name="value">Internet</field>
</record>
</odoo>
Loading
Loading