Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

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

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

Odoo 9 : Make changes on Survey module

Subscribe

Get notified when there's activity on this post

This question has been flagged
surveymoduleeditingodoo
5251 Views
Avatar
LatifaShi

Hi everyone I am working on editing the survey module in odoo 9.

When I answer a survey which is composed of pages and then click on submit survey, it calculates the whole score

of the survey and display it .. and what i want is that it calculates the score of each page and display it when i click

on submit survey for example :

it displays :

Your score is : 200 points and i want it to display :

Score of first page : 20 points second page : 50 points and so on ...

here is the code that i want to change but i don't know how should i change this function.

** questionnaire.py (survey.py) : class survey_user_input

    class survey_user_input(osv.Model):
    ''' Metadata for a set of one user's answers to a particular survey '''
    _name = "questionnaire.user_input"
    _rec_name = 'date_create'
    _description = 'Survey User Input'
    def _quizz_get_score(self, cr, uid, ids, name, args, context=None):
        ret = dict()
        for user_input in self.browse(cr, uid, ids, context=context):
            ret[user_input.id] = sum([uil.quizz_mark for uil in user_input.user_input_line_ids] or [0.0])
        return ret
    _columns = {
        'survey_id': fields.many2one('questionnaire.questionnaire', 'Questionnaire', required=True,
                                     readonly=1, ondelete='restrict'),
        'date_create': fields.datetime('Date de creation', required=True,
                                       readonly=1, copy=False),
        'deadline': fields.datetime("Date limite",
                                oldname="date_deadline"),
        'type': fields.selection([('manually', 'Manuellement'), ('link', 'Lien')],
                                 'Type de reponse', required=1, readonly=1,
                                 oldname="response_type"),
        'state': fields.selection([('new', 'Pas encore commence'),
                                   ('skip', 'Partiellement acheve'),
                                   ('done', 'Termine')],
                                  'Statut',
                                  readonly=True),
        'test_entry': fields.boolean('Entree de test', readonly=1),
        'token': fields.char("Piece d'identite", readonly=1, required=1, copy=False),
        # Optional Identification data
        'partner_id': fields.many2one('res.partner', 'Partenaire', readonly=1),
        'email': fields.char("E-mail", readonly=1),
        # Displaying data
        'last_displayed_page_id': fields.many2one('questionnaire.page',
                                              'Derniere page affichee'),
        # The answers !
        'user_input_line_ids': fields.one2many('questionnaire.user_input_line',
                                               'user_input_id', 'Reponses', copy=True),
        # URLs used to display the answers
        'result_url': fields.related('survey_id', 'result_url', type='char',
                                     string="Lien public aux resultats du sondage"),
        'print_url': fields.related('survey_id', 'print_url', type='char',
                                    string="Lien public au sondage vide"),
        'quizz_score': fields.function(_quizz_get_score, type="float", string="Score pour le quiz", store=True)
    }
    _defaults = {
        'date_create': fields.datetime.now,
        'type': 'manually',
        'state': 'new',
        'token': lambda s, cr, uid, c: uuid.uuid4().__str__(),
        'quizz_score': 0.0,
    } 

** questionnaire.py (survey.py) : class survey_user_input_line

     _name = 'questionnaire.user_input_line'
    _description = 'Survey User Input Line'
    _rec_name = 'date_create'
    _columns = {
        'user_input_id': fields.many2one('questionnaire.user_input', 'Entree de l\'utilisateur',
                                         ondelete='cascade', required=1),
        'question_id': fields.many2one('questionnaire.question', 'Question',
                                       ondelete='restrict', required=1),
        'page_id': fields.related('question_id', 'page_id', type='many2one',
                                  relation='questionnaire.page', string="Page"),
        'survey_id': fields.related('user_input_id', 'survey_id',
                                    type="many2one", relation="questionnaire.questionnaire",
                                    string='Questionnaire', store=True),
        'date_create': fields.datetime('Date de creation', required=1),
        'skipped': fields.boolean('Ignore'),
        'answer_type': fields.selection([('text', 'Texte'),
                                         ('number', 'Nombre'),
                                         ('date', 'Date'),
                                         ('free_text', 'Texte Libre'),
                                         ('suggestion', 'Suggestion')],
                                        'Type de reponse'),
        'value_text': fields.char("Reponse texte"),
        'value_number': fields.float("Reponse numerique"),
        'value_date': fields.datetime("Reponse date"),
        'value_free_text': fields.text("Reponse texte libre"),
        'value_suggested': fields.many2one('questionnaire.label', "Reponse suggeree"),
        'value_suggested_row': fields.many2one('questionnaire.label', "Reponse en ligne"),
        'quizz_mark': fields.float("Score donne pour ce choix")
    }

** survey_templates.xml

    <!-- "Thank you" message when the survey is completed -->
    <template id="sfinished" name="Survey Finished">
        <t t-call="website.layout">
            <div class="wrap">
                <div class="container">
                    <t t-call="questionnaire.back" />
                    <div class="jumbotron mt32">
                        <h1>Thank you!</h1>
                        <div t-field="questionnaire.thank_you_message" class="oe_no_empty" />
                        <div> You scored <t t-esc="user_input.quizz_score" /> points.</div>
                        <div>If you want you can <a t-att-href="'/questionnaire/print/%s/%s' % (slug(questionnaire), token)">review your answers</a>.</div>
                    </div>
                </div>
            </div>
        </t>
    </template>
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
How can we Uninstall odoo module from terminal? Solved
module odoo
Avatar
Avatar
Avatar
Avatar
3
सित॰ 25
22362
Odoo survey user invitation and number answer per user problem?
survey odoo
Avatar
0
मार्च 15
5055
Odoo - Find module to show group by parent/child value in tree view
module python3 odoo
Avatar
0
अप्रैल 23
3937
Inherit form view in odoo 12
survey odoo odoo12
Avatar
Avatar
2
दिस॰ 19
6831
[Odoo 10.0] Show all survey's question result with bar_chart
survey odoo odoo10
Avatar
0
मई 19
3434
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة 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, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

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