Files
odoo_source/addons/survey/views/res_partner_views.xml
T
Thibault Delavallée 755ac5f313 [REF] survey: on survey.user_input, rename some fields to ease understanding
PURPOSE

As new features are about to land in survey, notably live interactions [1]
and new survey building [2] performing a pre cleaning is necessary. In this
PR we clean survey models by: removing unnecessary fields, cleaning some code
and finally renaming models.

SPECIFICATIONS: RENAME QUIZ_SCORE ON SURVEY.USER_INPUT

On survey.user_input, quiz_score field to scoring_percentage

``quiz_score`` field name is related to the old "quiz" behavior of surveys
that is replaced by certifications and scoring mechanisms. Let us propagate
the renaming, beginning with a ``scoring_`` prefix.

SPECIFICATIONS: RENAME QUIZZ_PASSED ON SURVEY.USER_INPUT

on survey.user_input, rename quizz_passed field to scoring_success

``quizz_passed`` field name is related to the old "quiz" behavior of surveys
that is replaced by certifications and scoring mechanisms. Let us propagate
the renaming, beginning with a ``scoring_`` prefix.

SPECIFICATIONS: RENAME TOKEN ON SURVEY.USER_INPUT

on survey.user_input, rename token field to access_token

Survey user input model holds two token field. One is used to distinguish
a pool of attempts linked to a given invite: ``invite_token``. The other
one is used to control access to a specific user input. It means that
``invite_token`` indicates a set of user inputs and each of them is accessed
through its own ``token``. To be coherent with other naming in odoo this
latter field is renamed to ``access_token``.

LINKS

[0] Related to Task ID 2061901 (survey models cleaning and preparation)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)

PR #40765
2019-12-05 15:21:28 +00:00

41 lines
2.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo><data>
<record id="res_partner_action_certifications" model="ir.actions.act_window">
<field name="name">Certifications Succeeded</field>
<field name="res_model">survey.user_input</field>
<field name="view_mode">tree</field>
<field name="context">{'search_default_scoring_success': 1}</field>
</record>
<record id="res_partner_view_form" model="ir.ui.view">
<field name="name">res.partner.view.form.inherit.survey</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="groups_id" eval="[(4, ref('survey.group_survey_user'))]"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_stat_button" type="object"
icon="fa-trophy" name="action_view_certifications"
attrs="{'invisible': ['|', ('certifications_count', '=', 0), ('is_company', '=', True)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="certifications_count" /></span>
<span class="o_stat_text" attrs="{'invisible': [('certifications_count', '&lt;', 2)]}">Certifications</span>
<span class="o_stat_text" attrs="{'invisible': [('certifications_count', '&gt;', 1)]}">Certification</span>
</div>
</button>
<button class="oe_stat_button" type="object"
icon="fa-trophy" name="action_view_certifications"
attrs="{'invisible': ['|', ('certifications_company_count', '=', 0), ('is_company', '=', False)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="certifications_company_count" /></span>
<span class="o_stat_text" attrs="{'invisible': [('certifications_company_count', '&lt;', 2)]}">Certifications</span>
<span class="o_stat_text" attrs="{'invisible': [('certifications_company_count', '&gt;', 1)]}">Certification</span>
</div>
</button>
</xpath>
</field>
</record>
</data></odoo>