2018-01-16 06:58:15 +01:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2018-01-16 11:34:37 +01:00
|
|
|
<flectra>
|
2018-01-16 06:58:15 +01:00
|
|
|
<data>
|
|
|
|
|
|
|
|
<!-- USER INPUTS -->
|
|
|
|
<record id="survey_user_input_search" model="ir.ui.view">
|
|
|
|
<field name="name">survey_user_input_search</field>
|
|
|
|
<field name="model">survey.user_input</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<search string="Search Survey">
|
|
|
|
<field name="survey_id"/>
|
|
|
|
<field name="email"/>
|
|
|
|
<field name="partner_id"/>
|
|
|
|
<filter name="completed" string="Completed" domain="[('state', '=', 'done')]"/>
|
|
|
|
<filter string="Partially completed" domain="[('state', '=', 'skip')]"/>
|
|
|
|
<filter string="New" domain="[('state', '=', 'new')]"/>
|
|
|
|
<filter string="Test" domain="[('test_entry','=', True)]"/>
|
|
|
|
<group expand="0" string="Group By">
|
|
|
|
<filter name="group_by_survey" string="Survey" domain="[]" context="{'group_by': 'survey_id'}"/>
|
|
|
|
<filter string="Email" domain="[]" context="{'group_by': 'email'}"/>
|
|
|
|
<filter string="Partner" domain="[]" context="{'group_by': ['partner_id']}"/>
|
|
|
|
</group>
|
|
|
|
</search>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="survey_user_input_form">
|
|
|
|
<field name="name">survey_user_input_form</field>
|
|
|
|
<field name="model">survey.user_input</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<form string="Survey User inputs" create="false">
|
|
|
|
<header>
|
|
|
|
<button name="action_survey_resend" string="Send Invitation Again" type="object" class="oe_highlight" attrs="{'invisible': ['|', ('type','=','manually'), ('state', '=', 'done')]}"/>
|
|
|
|
<button name="action_view_answers" states="done" string="Print These Answers" type="object" class="oe_highlight" />
|
|
|
|
<button name="action_survey_results" string="View Results" type="object" />
|
|
|
|
<field name="state" widget="statusbar"/>
|
|
|
|
</header>
|
|
|
|
<sheet>
|
|
|
|
<div class="oe_button_box" name="button_box"/>
|
|
|
|
<group col="2">
|
|
|
|
<group>
|
|
|
|
<field name="survey_id"/>
|
|
|
|
<field name="date_create"/>
|
|
|
|
<field name="type"/>
|
|
|
|
<field name="token" groups="base.group_no_one"/>
|
|
|
|
</group>
|
|
|
|
<group>
|
|
|
|
<field name="deadline"/>
|
|
|
|
<field name="partner_id"/>
|
|
|
|
<field name="email" widget="email"/>
|
|
|
|
<field name="test_entry" groups="base.group_no_one"/>
|
|
|
|
<field name="quizz_score" groups="base.group_no_one"/>
|
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
<field name="user_input_line_ids" mode="tree" attrs="{'readonly': False}">
|
|
|
|
<tree>
|
|
|
|
<field name="page_id"/>
|
|
|
|
<field name="question_id"/>
|
|
|
|
<field name="answer_type"/>
|
|
|
|
<field name="skipped"/>
|
|
|
|
<field name="date_create"/>
|
|
|
|
<field name="quizz_mark" groups="base.group_no_one"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</sheet>
|
|
|
|
</form>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="survey_user_input_tree">
|
|
|
|
<field name="name">survey_user_input_tree</field>
|
|
|
|
<field name="model">survey.user_input</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<tree string="Survey User inputs" decoration-muted="test_entry == True" create="false">
|
|
|
|
<field name="survey_id"/>
|
|
|
|
<field name="date_create"/>
|
|
|
|
<field name="deadline"/>
|
|
|
|
<field name="partner_id"/>
|
|
|
|
<field name="email"/>
|
|
|
|
<field name="type"/>
|
|
|
|
<field name="state"/>
|
|
|
|
<field name="test_entry" invisible="True"/>
|
|
|
|
<field name="quizz_score" groups="base.group_no_one"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<record id="view_survey_user_input_kanban" model="ir.ui.view">
|
|
|
|
<field name="name">survey.user_input.kanban</field>
|
|
|
|
<field name="model">survey.user_input</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<kanban>
|
|
|
|
<field name="survey_id"/>
|
|
|
|
<field name="date_create"/>
|
|
|
|
<field name="partner_id"/>
|
|
|
|
<field name="email"/>
|
|
|
|
<field name="type"/>
|
|
|
|
<field name="state"/>
|
|
|
|
<templates>
|
|
|
|
<t t-name="kanban-box">
|
|
|
|
<div t-attf-class="oe_kanban_global_click">
|
|
|
|
<div class="o_kanban_record_top">
|
|
|
|
<div class="o_kanban_record_headings">
|
|
|
|
<strong class="o_kanban_record_title"><t t-esc="record.survey_id.value"/></strong>
|
|
|
|
</div>
|
|
|
|
<span class="badge"><t t-esc="record.type.value"/></span>
|
|
|
|
</div>
|
|
|
|
<div class="o_kanban_record_bottom">
|
|
|
|
<div class="oe_kanban_bottom_left">
|
|
|
|
<field name="date_create"/>
|
|
|
|
</div>
|
|
|
|
<div class="oe_kanban_bottom_right mr4">
|
|
|
|
<field name="state" widget="kanban_label_selection" options="{'classes': {'new': 'default', 'done': 'success', 'skip':'warning'}}"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</t>
|
|
|
|
</templates>
|
|
|
|
</kanban>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<record model="ir.actions.act_window" id="action_survey_user_input">
|
|
|
|
<field name="name">Answers</field>
|
|
|
|
<field name="res_model">survey.user_input</field>
|
|
|
|
<field name="view_mode">tree,kanban,form</field>
|
|
|
|
<field name="view_id" ref="survey_user_input_tree"></field>
|
|
|
|
<field name="search_view_id" ref="survey_user_input_search"/>
|
|
|
|
<field name="context">{'search_default_group_by_survey': True}</field>
|
|
|
|
<field name="help" type="html">
|
|
|
|
<p>Nobody has replied to your surveys yet.</p>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record id="action_selected_survey_user_input" model="ir.actions.act_window">
|
|
|
|
<field name="name">Survey User input</field>
|
|
|
|
<field name="res_model">survey.user_input</field>
|
|
|
|
<field name="view_mode">tree,form</field>
|
|
|
|
<field name="view_id" ref="survey_user_input_tree"></field>
|
|
|
|
<field name="search_view_id" ref="survey_user_input_search"/>
|
|
|
|
<field name="context">{'search_default_survey_id': active_id, 'default_survey_id': active_id}</field>
|
|
|
|
<field name="help" type="html">
|
|
|
|
<p>Nobody has replied to your survey yet.</p>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<!-- SURVEY -->
|
|
|
|
<record model="ir.ui.view" id="survey_form">
|
|
|
|
<field name="name">Form view for survey</field>
|
|
|
|
<field name="model">survey.survey</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<form string="Survey">
|
|
|
|
<field name="id" invisible="1"/>
|
|
|
|
<field name="tot_start_survey" invisible="1"/>
|
|
|
|
<field name="is_closed" invisible="1"/>
|
|
|
|
<header groups="survey.group_survey_manager">
|
|
|
|
<button name="action_test_survey" string="Design Survey" type="object" class="oe_highlight"/>
|
|
|
|
<button name="action_test_survey" string="Test Survey" type="object" attrs="{'invisible': [('id', '=', False)]}"/>
|
|
|
|
<button name="action_print_survey" string="Print Survey" type="object" attrs="{'invisible': [('id', '=', False)]}"/>
|
|
|
|
<button name="action_send_survey" string="Share and invite by email" type="object" class="oe_highlight" attrs="{'invisible': [('id', '=', False)]}"/>
|
|
|
|
<button name="action_result_survey" string="View results" type="object" attrs="{'invisible': ['|',('id', '=', False), ('tot_start_survey', '!=', 0)]}"/>
|
|
|
|
<button name="action_result_survey" string="View results" type="object" class="oe_highlight" attrs="{'invisible': [('tot_start_survey', '=', 0)]}"/>
|
|
|
|
<field name="stage_id" widget="statusbar" clickable="True" />
|
|
|
|
</header>
|
|
|
|
<sheet>
|
|
|
|
<div class="oe_button_box" name="button_box">
|
|
|
|
<button name="action_survey_user_input"
|
|
|
|
type="object"
|
|
|
|
class="oe_stat_button"
|
|
|
|
icon="fa-pencil-square-o">
|
|
|
|
<field string="Answers" name="tot_comp_survey" widget="statinfo"/>
|
|
|
|
</button>
|
|
|
|
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive" attrs="{'invisible': [('is_closed', '=', False)]}">
|
|
|
|
<field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="oe_title" style="width: 100%;">
|
|
|
|
<label for="title" class="oe_edit_only"/>
|
|
|
|
<h1><field name="title" placeholder="Survey Title"/></h1>
|
|
|
|
</div>
|
|
|
|
<notebook>
|
|
|
|
<page string="Edit Pages and Questions">
|
|
|
|
<field name="page_ids" mode="tree" context="{'default_survey_id': active_id}" nolabel="1">
|
|
|
|
<tree>
|
|
|
|
<field name="sequence" widget="handle"/>
|
|
|
|
<field name="title"/>
|
|
|
|
<field name="question_ids"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</page>
|
|
|
|
<page string="Options">
|
|
|
|
<group class="o_label_nowrap">
|
|
|
|
<field name="users_can_go_back" string="User can come back in the previous page"/>
|
|
|
|
<field name="auth_required"/>
|
|
|
|
<field name="quizz_mode" groups="base.group_no_one"/>
|
|
|
|
</group>
|
|
|
|
</page>
|
|
|
|
</notebook>
|
|
|
|
</sheet>
|
|
|
|
<div class="oe_chatter">
|
|
|
|
<field name="message_follower_ids" widget="mail_followers"/>
|
|
|
|
<field name="activity_ids" widget="mail_activity"/>
|
|
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id= "survey_tree">
|
|
|
|
<field name="name">Tree view for survey</field>
|
|
|
|
<field name="model">survey.survey</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<tree string="Survey">
|
|
|
|
<field name="active" invisible="1"/>
|
|
|
|
<field name="title" />
|
|
|
|
<field name="stage_id" />
|
|
|
|
<field name="tot_sent_survey" string="Invitations sent" />
|
|
|
|
<field name="tot_start_survey" string="Started" />
|
|
|
|
<field name="tot_comp_survey" string="Completed" />
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="survey_kanban">
|
|
|
|
<field name="name">Kanban view for survey</field>
|
|
|
|
<field name="model">survey.survey</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<kanban default_group_by="stage_id">
|
|
|
|
<field name="stage_id" />
|
|
|
|
<field name="designed" />
|
|
|
|
<field name="title" />
|
|
|
|
<field name="tot_sent_survey" />
|
|
|
|
<field name="tot_start_survey" />
|
|
|
|
<field name="tot_comp_survey" />
|
|
|
|
<field name="color" />
|
|
|
|
<field name="auth_required" />
|
|
|
|
<field name="public_url" />
|
|
|
|
<field name="activity_ids" />
|
|
|
|
<field name="activity_state" />
|
|
|
|
<templates>
|
|
|
|
<div t-name="kanban-box" t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
|
|
|
|
<div class="o_dropdown_kanban dropdown" t-if="widget.editable">
|
|
|
|
|
|
|
|
<a class="dropdown-toggle btn" data-toggle="dropdown" href="#" >
|
|
|
|
<span class="fa fa-ellipsis-v"/>
|
|
|
|
</a>
|
|
|
|
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
|
|
|
|
<li><a type="edit">Edit Survey</a></li>
|
|
|
|
<li t-if="widget.deletable"><a type="delete">Delete</a></li>
|
|
|
|
<li class="divider"/>
|
|
|
|
<li>Color</li>
|
|
|
|
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="o_kanban_record_top">
|
|
|
|
<h4 class="o_kanban_record_title mb4"><field name="title" /></h4>
|
|
|
|
</div>
|
|
|
|
<div class="o_kanban_record_bottom">
|
|
|
|
<ul class="list-unstyled">
|
|
|
|
<li>
|
|
|
|
<a name="action_test_survey" type="object">Design</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<t t-if="record.designed.raw_value"><a type="object" name="action_test_survey">Test</a></t>
|
|
|
|
<t t-if="! record.designed.raw_value"><a style="color: #aaaaaa;">Test</a></t>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<t t-if="record.designed.raw_value"><a type="object" name="action_send_survey">Share &amp; Invite</a></t>
|
|
|
|
<t t-if="! record.designed.raw_value"><a style="color: #aaaaaa;">Share &amp; Invite</a></t>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<t t-if="record.tot_start_survey.raw_value > 0"><a name="action_result_survey" type="object">Analyze Answers</a> <span t-if="record.tot_start_survey.raw_value > 0">(<field name="tot_start_survey" />)</span></t>
|
|
|
|
<t t-if="record.tot_start_survey.raw_value <= 0"><a style="color: #aaaaaa;">Analyze Answers</a></t>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="o_kanban_record_bottom">
|
|
|
|
<div class="oe_kanban_bottom_left"/>
|
|
|
|
<div class="oe_kanban_bottom_right">
|
|
|
|
<field name="activity_ids" widget="kanban_activity" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</templates>
|
|
|
|
</kanban>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record id="survey_survey_view_search" model="ir.ui.view">
|
|
|
|
<field name="name">survey.survey.search</field>
|
|
|
|
<field name="model">survey.survey</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<search string="Survey">
|
|
|
|
<field string="Title" name="title"/>
|
|
|
|
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
|
|
|
|
<separator/>
|
|
|
|
<filter string="My Activities" name="activities_my"
|
|
|
|
domain="[('activity_ids.user_id', '=', uid)]"/>
|
|
|
|
<separator/>
|
|
|
|
<filter string="Late Activities" name="activities_overdue"
|
|
|
|
domain="[('activity_ids.date_deadline', '<', context_today().strftime('%Y-%m-%d'))]"
|
|
|
|
help="Show all records which has next action date is before today"/>
|
|
|
|
<filter string="Today Activities" name="activities_today"
|
|
|
|
domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
|
|
|
|
<filter string="Upcoming Activities" name="activities_upcoming_all"
|
|
|
|
domain="[('activity_ids.date_deadline', '>', context_today().strftime('%Y-%m-%d'))
|
|
|
|
]"/>
|
|
|
|
</search>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<record model="ir.actions.act_window" id="action_survey_form">
|
|
|
|
<field name="name">Surveys</field>
|
|
|
|
<field name="res_model">survey.survey</field>
|
|
|
|
<field name="view_type">form</field>
|
|
|
|
<field name="view_mode">kanban,tree,form</field>
|
|
|
|
<field name="help" type="html">
|
|
|
|
<p class="oe_view_nocontent_create">Click to add a survey.</p>
|
|
|
|
<p>You can create surveys for different purposes: customer opinion, services feedback, recruitment interviews, employee's periodical evaluations, marketing campaigns, etc.</p>
|
|
|
|
<p>Design easily your survey, send invitations to answer by email and analyse answers.</p>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<act_window context="{'search_default_survey_id': [active_id], 'default_survey_id': active_id}" id="act_survey_pages" name="Pages" res_model="survey.page" src_model="survey.survey"/>
|
|
|
|
<act_window context="{'search_default_survey_id': [active_id], 'default_survey_id': active_id}" id="act_survey_question" name="Questions" res_model="survey.question" src_model="survey.survey"/>
|
|
|
|
|
|
|
|
<!-- PAGES -->
|
|
|
|
<record model="ir.ui.view" id="survey_page_form">
|
|
|
|
<field name="name">Form view for survey page</field>
|
|
|
|
<field name="model">survey.page</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<form string="Survey Page" create="false">
|
|
|
|
<sheet>
|
|
|
|
<div class="oe_title" style="width: 100%;">
|
|
|
|
<label for="title" class="oe_edit_only"/>
|
|
|
|
<h1><field name="title" placeholder="Page Title"/></h1>
|
|
|
|
</div>
|
|
|
|
<field name="question_ids" nolabel="1" mode="tree" context="{'default_page_id': active_id}">
|
|
|
|
<tree>
|
|
|
|
<field name="sequence" widget="handle"/>
|
|
|
|
<field name="question"/>
|
|
|
|
<field name="type"/>
|
|
|
|
<field name="constr_mandatory"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</sheet>
|
|
|
|
</form>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="survey_page_tree">
|
|
|
|
<field name="name">Tree view for survey page</field>
|
|
|
|
<field name="model">survey.page</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<tree string="Survey Page" create="false">
|
|
|
|
<field name="sequence" widget="handle"/>
|
|
|
|
<field name="title"/>
|
|
|
|
<field name="survey_id"/>
|
|
|
|
<field name="question_ids" string="#Questions"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="survey_page_search" >
|
|
|
|
<field name="name">Search view for survey page</field>
|
|
|
|
<field name="model">survey.page</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<search string="Search Page">
|
|
|
|
<field name="title" string="Page"/>
|
|
|
|
<field name="survey_id" string="Survey"/>
|
|
|
|
<group expand="0" string="Group By">
|
|
|
|
<filter name="group_by_survey" string="Survey" domain="[]" context="{'group_by':'survey_id'}"/>
|
|
|
|
</group>
|
|
|
|
</search>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<record model="ir.actions.act_window" id="action_survey_page_form">
|
|
|
|
<field name="name">Pages</field>
|
|
|
|
<field name="res_model">survey.page</field>
|
|
|
|
<field name="view_type">form</field>
|
|
|
|
<field name="view_mode">tree,form</field>
|
|
|
|
<field name="search_view_id" ref="survey_page_search"/>
|
|
|
|
<field name="context">{'search_default_group_by_survey': True}</field>
|
|
|
|
</record>
|
|
|
|
<act_window context="{'search_default_page_id': active_id, 'default_page_id': active_id}" id="act_survey_page_question" name="Questions" res_model="survey.question" src_model="survey.page"/>
|
|
|
|
|
|
|
|
<template id="assets_backend" name="survey assets" inherit_id="web.assets_backend">
|
|
|
|
<xpath expr="." position="inside">
|
|
|
|
<link rel="stylesheet" href="/survey/static/src/css/survey_result.css"/>
|
|
|
|
</xpath>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<!-- QUESTIONS -->
|
|
|
|
<record model="ir.ui.view" id="survey_question_form">
|
|
|
|
<field name="name">Form view for survey question</field>
|
|
|
|
<field name="model">survey.question</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<form string="Survey Question" create="false">
|
|
|
|
<sheet>
|
|
|
|
<div class="oe_title" style="width: 100%;">
|
|
|
|
<label for="question" string="Question name" class="oe_edit_only"/>
|
|
|
|
<h1><field name="question" colspan="4" placeholder="Question Name"/></h1>
|
|
|
|
<separator />
|
|
|
|
</div>
|
|
|
|
<group>
|
|
|
|
<group>
|
|
|
|
<field name="type" widget="radio" />
|
|
|
|
</group>
|
|
|
|
<group>
|
|
|
|
<div class="col-md-6 col-md-offset-3 o_preview_questions">
|
|
|
|
<!-- Multiple Lines Text Zone -->
|
|
|
|
<div attrs="{'invisible': [('type', '!=', 'free_text')]}">
|
|
|
|
<i class="fa fa-align-justify fa-4x"/>
|
|
|
|
</div>
|
|
|
|
<!-- Single Line Text Zone -->
|
|
|
|
<div attrs="{'invisible': [('type', '!=', 'textbox')]}">
|
|
|
|
<i class="fa fa-minus fa-4x"/>
|
|
|
|
</div>
|
|
|
|
<!-- Numerical Value -->
|
|
|
|
<div attrs="{'invisible': [('type', '!=', 'numerical_box')]}">
|
|
|
|
<i class="fa fa-2x">123..</i>
|
|
|
|
</div>
|
|
|
|
<!-- Date and Time -->
|
|
|
|
<div attrs="{'invisible': [('type', '!=', 'date')]}">
|
|
|
|
<p class="o_datetime">YYYY-MM-DD
|
|
|
|
<i class="fa fa-calendar fa-2x"/>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- Multiple choice: only one answer -->
|
|
|
|
<div attrs="{'invisible': [('type', '!=', 'simple_choice')]}">
|
|
|
|
<div class="row"><i class="fa fa-circle-o fa-lg"/> answer</div>
|
|
|
|
<div class="row"><i class="fa fa-dot-circle-o fa-lg"/> answer</div>
|
|
|
|
<div class="row"><i class="fa fa-circle-o fa-lg"/> answer</div>
|
|
|
|
</div>
|
|
|
|
<!-- Multiple choice: multiple answers allowed -->
|
|
|
|
<div attrs="{'invisible': [('type', '!=', 'multiple_choice')]}">
|
|
|
|
<div class="row"><i class="fa fa-square-o fa-lg"/> answer</div>
|
|
|
|
<div class="row"><i class="fa fa-check-square-o fa-lg"/> answer</div>
|
|
|
|
<div class="row"><i class="fa fa-square-o fa-lg"/> answer</div>
|
|
|
|
</div>
|
|
|
|
<!-- Matrix -->
|
|
|
|
<div attrs="{'invisible': [('type', '!=', 'matrix')]}">
|
|
|
|
<div class="row o_matrix_head">
|
|
|
|
<div class="col-md-3"></div>
|
|
|
|
<div class="col-md-3">ans</div>
|
|
|
|
<div class="col-md-3">ans</div>
|
|
|
|
<div class="col-md-3">ans</div>
|
|
|
|
</div>
|
|
|
|
<div class="row o_matrix_row">
|
|
|
|
<div class="col-md-3">Row1</div>
|
|
|
|
<div class="col-md-3"><i class="fa fa-circle-o fa-lg"/></div>
|
|
|
|
<div class="col-md-3"><i class="fa fa-dot-circle-o fa-lg"/></div>
|
|
|
|
<div class="col-md-3"><i class="fa fa-circle-o fa-lg"/></div>
|
|
|
|
</div>
|
|
|
|
<div class="row o_matrix_row">
|
|
|
|
<div class="col-md-3">Row2</div>
|
|
|
|
<div class="col-md-3"><i class="fa fa-circle-o fa-lg"/></div>
|
|
|
|
<div class="col-md-3"><i class="fa fa-circle-o fa-lg"/></div>
|
|
|
|
<div class="col-md-3"><i class="fa fa-dot-circle-o fa-lg"/></div>
|
|
|
|
</div>
|
|
|
|
<div class="row o_matrix_row">
|
|
|
|
<div class="col-md-3">Row3</div>
|
|
|
|
<div class="col-md-3"><i class="fa fa-dot-circle-o fa-lg"/></div>
|
|
|
|
<div class="col-md-3"><i class="fa fa-circle-o fa-lg"/></div>
|
|
|
|
<div class="col-md-3"><i class="fa fa-circle-o fa-lg"/></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
<notebook>
|
|
|
|
<page string="Answers">
|
|
|
|
<field name="validation_email" attrs="{'invisible': [('type', '!=', 'textbox')]}"/>
|
|
|
|
<label for="validation_email" attrs="{'invisible': [('type', '!=', 'textbox')]}"/>
|
|
|
|
<separator />
|
|
|
|
<field name="labels_ids" string="Type of answers" context="{'default_question_id': active_id}" attrs="{'invisible': [('type', 'not in', ['simple_choice', 'multiple_choice', 'matrix'])]}">
|
|
|
|
<tree editable="bottom">
|
|
|
|
<field name="sequence" widget="handle"/>
|
|
|
|
<field name="value" string="Choices"/>
|
|
|
|
<field name="quizz_mark" groups="base.group_no_one"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
<separator />
|
|
|
|
<label for="labels_ids_2" attrs="{'invisible': [('type', '!=', 'matrix')]}" />
|
|
|
|
<field name="labels_ids_2" context="{'default_question_id_2': active_id}" attrs="{'invisible': [('type', '!=', 'matrix')]}">
|
|
|
|
<tree editable="bottom">
|
|
|
|
<field name="sequence" widget="handle"/>
|
|
|
|
<field name="value" string="Rows"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</page>
|
|
|
|
<page string="Options">
|
|
|
|
<group string="Constraints">
|
|
|
|
<group colspan="2" col="4">
|
|
|
|
<field name="constr_mandatory" string="Mandatory Answer"/>
|
|
|
|
<field name="constr_error_msg" attrs="{'invisible': [('constr_mandatory', '=', False)]}"/>
|
|
|
|
</group>
|
|
|
|
<div colspan="2" attrs="{'invisible': [('type', 'not in', ['textbox', 'numerical_box', 'date'])]}">
|
|
|
|
<group>
|
|
|
|
<field name="validation_required" attrs="{'invisible': [('validation_email', '=', True), ('type', '=', 'textbox')]}"/>
|
|
|
|
</group>
|
|
|
|
<group col="4" attrs="{'invisible': [('validation_required', '=', False)]}">
|
|
|
|
<field name="validation_length_min" attrs="{'invisible': [('type', '!=', 'textbox')]}"/>
|
|
|
|
<field name="validation_length_max" attrs="{'invisible': [('type', '!=', 'textbox')]}"/>
|
|
|
|
<field name="validation_min_float_value" attrs="{'invisible': [('type', '!=', 'numerical_box')]}"/>
|
|
|
|
<field name="validation_max_float_value" attrs="{'invisible': [('type', '!=', 'numerical_box')]}"/>
|
|
|
|
<field name="validation_min_date" attrs="{'invisible': [('type', '!=', 'date')]}"/>
|
|
|
|
<field name="validation_max_date" attrs="{'invisible': [('type', '!=', 'date')]}"/>
|
|
|
|
<field name="validation_error_msg" colspan="4"/>
|
|
|
|
</group>
|
|
|
|
</div>
|
|
|
|
<group>
|
|
|
|
<field name="matrix_subtype" attrs="{'invisible':[('type','not in',['matrix'])]}"/>
|
|
|
|
</group>
|
|
|
|
</group>
|
|
|
|
<group string="Display mode" attrs="{'invisible':[('type','not in',['simple_choice', 'multiple_choice'])]}">
|
|
|
|
<field name="display_mode" string="Format" attrs="{'invisible':[('type','not in',['simple_choice'])],'required':[('type','=','simple_choice')]}"/>
|
|
|
|
<field name="column_nb" string="Number of columns" attrs="{'invisible':[('display_mode','=','dropdown'), ('type','=','simple_choice')]}"/>
|
|
|
|
</group>
|
|
|
|
<group string="Allow Comments" attrs="{'invisible':[('type','not in',['simple_choice','multiple_choice', 'matrix'])]}">
|
|
|
|
<field name='comments_allowed' />
|
|
|
|
<field name='comments_message' attrs="{'invisible': [('comments_allowed', '=', False)]}"/>
|
|
|
|
<field name='comment_count_as_answer' attrs="{'invisible': ['|', ('comments_allowed', '=', False), ('type', 'in', ['matrix'])]}" />
|
|
|
|
</group>
|
|
|
|
</page>
|
|
|
|
</notebook>
|
|
|
|
</sheet>
|
|
|
|
</form>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="survey_question_tree">
|
|
|
|
<field name="name">Tree view for survey question</field>
|
|
|
|
<field name="model">survey.question</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<tree string="Survey Question" create="false">
|
|
|
|
<field name="sequence" widget="handle"/>
|
|
|
|
<field name="question"/>
|
|
|
|
<field name="page_id"/>
|
|
|
|
<field name="survey_id"/>
|
|
|
|
<field name="type"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="survey_question_search">
|
|
|
|
<field name="name">Search view for survey question</field>
|
|
|
|
<field name="model">survey.question</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<search string="Search Question">
|
|
|
|
<field name="question" string="Question"/>
|
|
|
|
<field name="survey_id" string="Survey"/>
|
|
|
|
<field name="page_id" string="Page"/>
|
|
|
|
<field name="type" string="Type"/>
|
|
|
|
<group expand="1" string="Group By">
|
|
|
|
<filter name="group_by_page" string="Page" domain="[]" context="{'group_by':'page_id'}"/>
|
|
|
|
<filter name="group_by_type" string="Type" domain="[]" context="{'group_by':'type'}"/>
|
|
|
|
</group>
|
|
|
|
</search>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<record model="ir.actions.act_window" id="action_survey_question_form">
|
|
|
|
<field name="name">Questions</field>
|
|
|
|
<field name="res_model">survey.question</field>
|
|
|
|
<field name="view_type">form</field>
|
|
|
|
<field name="view_mode">tree,form</field>
|
|
|
|
<field name="search_view_id" ref="survey_question_search"/>
|
|
|
|
<field name="context">{'search_default_group_by_page': True}</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<!-- LABELS -->
|
|
|
|
<record model="ir.ui.view" id="survey_label_tree">
|
|
|
|
<field name="name">survey_label_tree</field>
|
|
|
|
<field name="model">survey.label</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<tree string="Survey Label" create="false">
|
|
|
|
<field name="sequence" widget="handle"/>
|
|
|
|
<field name="question_id"/>
|
|
|
|
<field name="question_id_2"/>
|
|
|
|
<field name="value"/>
|
|
|
|
<field name="quizz_mark" groups="base.group_no_one"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record id="survey_label_search" model="ir.ui.view">
|
|
|
|
<field name="name">survey_label_search</field>
|
|
|
|
<field name="model">survey.label</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<search string="Search Label">
|
|
|
|
<field name="question_id" string="Question"/>
|
|
|
|
<filter name="group_by_question" string="Question" domain="[]" context="{'group_by':'question_id'}"/>
|
|
|
|
</search>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<record model="ir.actions.act_window" id="action_survey_label_form">
|
|
|
|
<field name="name">Labels</field>
|
|
|
|
<field name="res_model">survey.label</field>
|
|
|
|
<field name="view_type">form</field>
|
|
|
|
<field name="view_mode">tree,form</field>
|
|
|
|
<field name="search_view_id" ref="survey_label_search"/>
|
|
|
|
<field name="context">{'search_default_group_by_question': True}</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<!-- USER INPUT LINES
|
|
|
|
.. note:: these views are useful mainly for technical users/administrators -->
|
|
|
|
<record model="ir.ui.view" id="survey_user_input_line_form">
|
|
|
|
<field name="name">survey_user_input_line_form</field>
|
|
|
|
<field name="model">survey.user_input_line</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<form string="User input line details" create="false">
|
|
|
|
<sheet>
|
|
|
|
<group col="4">
|
|
|
|
<field name="question_id"/>
|
|
|
|
<field name="date_create"/>
|
|
|
|
<field name="answer_type"/>
|
|
|
|
<field name="skipped" />
|
|
|
|
<field name="quizz_mark" groups="base.group_no_one"/>
|
|
|
|
</group>
|
|
|
|
<group>
|
|
|
|
<field name="value_text" colspan='2' attrs="{'invisible': [('answer_type','!=','text')]}"/>
|
|
|
|
<field name="value_number" colspan='2' attrs="{'invisible': [('answer_type','!=','number')]}"/>
|
|
|
|
<field name="value_date" colspan='2' attrs="{'invisible': [('answer_type','!=','date')]}"/>
|
|
|
|
<field name="value_free_text" colspan='2' attrs="{'invisible': [('answer_type','!=','free_text')]}"/>
|
|
|
|
<field name="value_suggested_row" colspan='2' />
|
|
|
|
<field name="value_suggested" colspan='2' attrs="{'invisible': [('answer_type','!=','suggestion')]}"/>
|
|
|
|
</group>
|
|
|
|
</sheet>
|
|
|
|
</form>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="survey_response_line_tree">
|
|
|
|
<field name="name">survey_response_line_tree</field>
|
|
|
|
<field name="model">survey.user_input_line</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<tree string="Survey Answer Line" create="false">
|
|
|
|
<field name="survey_id"/>
|
|
|
|
<field name="user_input_id"/>
|
|
|
|
<field name="page_id"/>
|
|
|
|
<field name="question_id"/>
|
|
|
|
<field name="date_create"/>
|
|
|
|
<field name="answer_type"/>
|
|
|
|
<field name="skipped"/>
|
|
|
|
<field name="quizz_mark" groups="base.group_no_one"/>
|
|
|
|
</tree>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
<record id="survey_response_line_search" model="ir.ui.view">
|
|
|
|
<field name="name">survey_response_line_search</field>
|
|
|
|
<field name="model">survey.user_input_line</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<search string="Search User input lines">
|
|
|
|
<field name="user_input_id"/>
|
|
|
|
<field name="survey_id"/>
|
|
|
|
<group expand="1" string="Group By">
|
|
|
|
<filter name="group_by_survey" string="Survey" domain="[]" context="{'group_by':'survey_id'}"/>
|
|
|
|
<filter name="group_by_user_input" string="User Input" domain="[]" context="{'group_by':'user_input_id'}"/>
|
|
|
|
</group>
|
|
|
|
</search>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<record model="ir.actions.act_window" id="action_survey_user_input_line">
|
|
|
|
<field name="name">Survey User Input lines</field>
|
|
|
|
<field name="res_model">survey.user_input_line</field>
|
|
|
|
<field name="view_mode">tree,form</field>
|
|
|
|
<field name="search_view_id" ref="survey_response_line_search"/>
|
|
|
|
<field name="context">{'search_default_group_by_survey': True, 'search_default_group_by_user_input': True}</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
|
|
|
|
<record model="ir.ui.view" id="survey_stage_form">
|
|
|
|
<field name="name">Form view for survey stage</field>
|
|
|
|
<field name="model">survey.stage</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<form string="Stage">
|
|
|
|
<group col='4' colspan='4'>
|
|
|
|
<field name="name" />
|
|
|
|
<field name="closed" />
|
|
|
|
<field name="sequence" />
|
|
|
|
<field name="fold" />
|
|
|
|
</group>
|
|
|
|
</form>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<record id="survey_action_server_clean_test_answers" model="ir.actions.server">
|
|
|
|
<field name="name">Survey: Clean test answers</field>
|
|
|
|
<field name="type">ir.actions.server</field>
|
|
|
|
<field name="model_id" ref="model_survey_survey" />
|
|
|
|
<field name="binding_model_id" ref="model_survey_survey" />
|
|
|
|
<field name="state">code</field>
|
|
|
|
<field name="code">
|
|
|
|
if records:
|
|
|
|
env['survey.user_input'].search([('survey_id', 'in', records.ids), ('test_entry', '=', 'True')]).unlink()
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<!-- MENU ELEMENTS -->
|
|
|
|
|
|
|
|
<!-- Left menu categories-->
|
|
|
|
<menuitem name="Surveys" id="menu_surveys" sequence="70" groups="group_survey_user" web_icon="survey,static/description/icon.png"/>
|
|
|
|
|
|
|
|
<!-- Left menu elements: Survey -->
|
|
|
|
<menuitem name="Surveys" id="menu_survey_form" action="action_survey_form" parent="menu_surveys" sequence="1"/>
|
|
|
|
<menuitem name="Answers" id="menu_survey_type_form1" action="action_survey_user_input" parent="menu_surveys" sequence="1"/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Left menu elements: Technical Configuration -->
|
|
|
|
<menuitem name="Configuration" id="menu_surveys_configuration" parent="menu_surveys" groups="base.group_no_one" sequence="100" />
|
|
|
|
<menuitem name="Pages" id="menu_survey_page_form1" action="action_survey_page_form" parent="menu_surveys_configuration" sequence="1"/>
|
|
|
|
<menuitem name="Questions" id="menu_survey_question_form1" action="action_survey_question_form" parent="menu_surveys_configuration" sequence="2"/>
|
|
|
|
<menuitem name="Labels" id="menu_survey_label_form1" action="action_survey_label_form" parent="menu_surveys_configuration" sequence="3"/>
|
|
|
|
<menuitem name="User Input Lines" id="menu_survey_response_line_form" action="action_survey_user_input_line" parent="menu_surveys_configuration" sequence="4"/>
|
|
|
|
</data>
|
2018-01-16 11:34:37 +01:00
|
|
|
</flectra>
|