174 lines
8.6 KiB
XML
174 lines
8.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- ============================================================ -->
|
|
<!-- Topic/Tour Views -->
|
|
<!-- ============================================================ -->
|
|
|
|
<!-- Topic Tree View -->
|
|
<record id="view_genius_topic_tree" model="ir.ui.view">
|
|
<field name="name">genius.topic.tree</field>
|
|
<field name="model">genius.topic</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Tours">
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="icon"/>
|
|
<field name="name"/>
|
|
<field name="module_id"/>
|
|
<field name="step_count"/>
|
|
<field name="consumed_count"/>
|
|
<field name="state" decoration-info="state == 'draft'" decoration-success="state == 'published'"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Embedded Step Tree View (for Smart Button) -->
|
|
<record id="view_genius_topic_step_tree_embedded" model="ir.ui.view">
|
|
<field name="name">genius.topic.step.tree.embedded</field>
|
|
<field name="model">genius.topic.step</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Steps" editable="bottom">
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="title"/>
|
|
<field name="step_type"/>
|
|
<field name="css_selector" string="Trigger (Selector)"/>
|
|
<field name="position"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Topic Form View -->
|
|
<record id="view_genius_topic_form" model="ir.ui.view">
|
|
<field name="name">genius.topic.form</field>
|
|
<field name="model">genius.topic</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Tour">
|
|
<header>
|
|
<!-- Main Actions -->
|
|
<button name="action_publish" type="object"
|
|
string="Publish" class="btn btn-primary"
|
|
attrs="{'invisible': [('state', '=', 'published')]}"
|
|
groups="tour_genius.group_genius_instructor"/>
|
|
<button name="action_start_recording" type="object"
|
|
string="Record Steps" class="btn btn-primary" icon="fa-video-camera"
|
|
groups="tour_genius.group_genius_admin"/>
|
|
|
|
<!-- Secondary Actions -->
|
|
<button name="action_test_tour" type="object"
|
|
string="Test Tour" class="btn btn-secondary" icon="fa-flask"
|
|
groups="tour_genius.group_genius_instructor"/>
|
|
<button name="action_open_topic" type="object"
|
|
string="Run Tour" class="btn btn-secondary" icon="fa-play"
|
|
attrs="{'invisible': [('state', '!=', 'published')]}"/>
|
|
<button name="action_set_draft" type="object"
|
|
string="Set to Draft" class="btn btn-secondary"
|
|
attrs="{'invisible': [('state', '=', 'draft')]}"
|
|
groups="tour_genius.group_genius_instructor"/>
|
|
|
|
<field name="state" widget="statusbar" statusbar_visible="draft,published"/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_button_box" name="button_box">
|
|
<button name="action_view_steps" type="object"
|
|
class="oe_stat_button" icon="fa-list-ol">
|
|
<field name="step_count" widget="statinfo" string="Steps"/>
|
|
</button>
|
|
<button class="oe_stat_button" icon="fa-users" type="object" name="action_view_completions">
|
|
<field name="consumed_count" widget="statinfo" string="Completions"/>
|
|
</button>
|
|
</div>
|
|
<field name="image" widget="image" class="oe_avatar"/>
|
|
<div class="oe_title">
|
|
<label for="name"/>
|
|
<h1>
|
|
<field name="name" placeholder="Tour Title"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<field name="module_xml_id" invisible="1"/>
|
|
<group string="Target">
|
|
<field name="plan_id"/>
|
|
<field name="module_id" options="{'no_create': True}"/>
|
|
<field name="starting_url" widget="url" placeholder="/web#action=..."/>
|
|
</group>
|
|
<group string="Classification">
|
|
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
|
|
<field name="quiz_id" context="{'default_name': name + ' Quiz'}"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Tour Steps" name="steps">
|
|
<div class="alert alert-info genius-tip-box" role="alert">
|
|
<i class="fa fa-lightbulb-o mr-2"/> <strong>Tip:</strong> Use the <em>"Record Steps"</em> button above to visually capture steps.
|
|
</div>
|
|
<field name="step_ids">
|
|
<tree editable="bottom">
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="title"/>
|
|
<field name="instruction"/>
|
|
<field name="css_selector"/>
|
|
<field name="step_type"/>
|
|
<field name="input_value" optional="hide" attrs="{'invisible': [('step_type', '!=', 'input')]}"/>
|
|
<field name="position"/>
|
|
<field name="extra_trigger" optional="hide"/>
|
|
</tree>
|
|
</field>
|
|
</page>
|
|
<page string="Resources" name="resources">
|
|
<group>
|
|
<field name="video_url" widget="url" placeholder="https://www.youtube.com/..."/>
|
|
<field name="document"/>
|
|
</group>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Topic Search View -->
|
|
<record id="view_genius_topic_search" model="ir.ui.view">
|
|
<field name="name">genius.topic.search</field>
|
|
<field name="model">genius.topic</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Search Tours">
|
|
<field name="name"/>
|
|
<field name="module_id"/>
|
|
<filter name="my_completed" string="Completed"
|
|
domain="[('consumed_user_ids', 'in', [uid])]"/>
|
|
<filter name="has_steps" string="With Steps"
|
|
domain="[('step_count', '>', 0)]"/>
|
|
<separator/>
|
|
<filter name="filter_draft" string="Draft" domain="[('state', '=', 'draft')]"/>
|
|
<filter name="filter_published" string="Published" domain="[('state', '=', 'published')]"/>
|
|
<separator/>
|
|
<filter name="archived" string="Archived" domain="[('active', '=', False)]"/>
|
|
<group expand="0" string="Group By">
|
|
<filter string="Module" name="group_by_module" context="{'group_by': 'module_id'}"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Topic Action -->
|
|
<record id="action_genius_topic" model="ir.actions.act_window">
|
|
<field name="name">Tours</field>
|
|
<field name="res_model">genius.topic</field>
|
|
<field name="view_mode">tree,form</field>
|
|
<field name="search_view_id" ref="view_genius_topic_search"/>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create your first tour!
|
|
</p>
|
|
<p>Tours guide users through Odoo screens step by step.</p>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Menu Item -->
|
|
<menuitem id="menu_training_topics"
|
|
name="Tours"
|
|
parent="menu_training"
|
|
action="action_genius_topic"
|
|
sequence="20"
|
|
groups="tour_genius.group_genius_instructor"/>
|
|
</odoo>
|