Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Associate surveys with specific objects

Subscribe

Get notified when there's activity on this post

This question has been flagged
surveys
3 Replies
6200 Views
Avatar
Javier Macchi

I am working with the Surveys module in Odoo v14, and it seems to be powerful enough to design different questionaires to be used in many different situations... for example to send it to clients to ask for their satisfaction about a given product or service, or to a candidate that has applied for a job to ask them detailed questions about their previous experience.

The problem I'm facing is how to associate those survey responses to the object that originated them, for example if I send the satisfaction survey to a given customer, I want to be able to see that survey response from the client record. Or if I send the previous experience survey to a candidate, I want to access it from the candidate record.

Currently I can only access the surveys from the surveys module, and have to manually search for the specific survey response I want to find, which is highly inefficient and also lacks any traceability and direct link to the original object. Has anybody faced this situation and has found a solution or workaround for this problem?

Any ideas are appreciated, thanks!

1
Avatar
Discard
Avatar
Samuel Moguilner
Best Answer

Is it possible to implement this functionality even if the user is not logged in? If I collect email addresses through the survey, is there a method to match these emails with the corresponding contacts? Thanks in advance!

1
Avatar
Discard
Avatar
XOLUTO
Best Answer

Answer above only covers use cases when survey is related to a user.

But in real life you want to relate survey results to products, affiliates, partners, ... 

In my case I have service tasks to assess partners, doing a supplier audit/assessment.

So you have somehow relate the survey to a particular partner and their products, which is not supported out of the box.

The approach I've implemented in odoo is outlined as follows

  • Inherit Controller to write related business object info)
  • In calling the  survey (URL-Action) pass the context (related business object info)
  • Inherited Controller process the context and add it to survey.user_input

Custom Controller

Important here: add an additional parameter, in my case task_id

The clue is to pass your context info in the additional_vals which are then evaluated and written by default to the survey.user_input.

You have to inherit of course the according to your needs.

class SurveyController(Survey):        
​@http.route('/survey/start/', type='http', auth='public', ​website=True)   
def survey_start(self, survey_token, answer_token=None, email=False, task_id=None,**post):
    ​ ​# the clue, add additional_vals, which are then written to the survey anser       
​ ​additional_vals = {} # f
​ ​if task_id:           
​ ​ ​reffering_task = request.env['project.task'].sudo().search([
​ ​ ​ ​('id', '=', task_id)], limit=1)           
​ ​ ​additional_vals = {'my_partner_id': reffering_task.partner_id.id,
​ ​ ​ 'my_standard_id': reffering_task.standard_id.id                    # rest of the controller remain unchanged
​....

Call Survey:

Survey is called by url action. you have to add your context info (in my case task_id) to be evaluated be the survey controller start (see above)

...
   self.ensure_one()       
​url = '%s?%s' % (self.get_start_url(), werkzeug.urls.url_encode(
​ ​{'answer_token': answer and answer.access_token or None,
​ ​'task_id': self.id}))  # open via URL-Action       
​return {
​ ​'type': 'ir.actions.act_url',
​​'name': "Start Survey", 
​ ​'target': 'new', 
​ ​'url': url       
​}
0
Avatar
Discard
Avatar
Ray Carnes (ray)
Best Answer

Since the Customer is a Contact in Odoo (res.partner records) you can use Odoo Studio to create a smart button to access all responses, because the partner_id field is already on the Survey Response (if the Customer is logged in when they reply).

First, create a field on the Contact to link to the Survey Responses:



Next, use Odoo Studio to create the Smart Button:







Once you send a Survey and receive a response, you will see them from the Contact record.


0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Survey Visual Changes Possible?
surveys
Avatar
Avatar
Avatar
2
Mar 24
4248
Survey for Events, Odoo 15
surveys
Avatar
0
Sep 23
1894
Duplicate question in surveys Solved
surveys
Avatar
Avatar
Avatar
2
May 23
2747
survey results
surveys
Avatar
Avatar
1
Dec 20
4393
print survey Solved
surveys
Avatar
Avatar
Avatar
2
Oct 20
4307
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now