summaryrefslogtreecommitdiff
path: root/addons/pad_project/views/project_views.xml
blob: 3539d850e5c55916d0695df5629f96a89879502e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_task_form2_inherit_pad_project" model="ir.ui.view">
        <field name="name">project.task.form.inherit</field>
        <field name="model">project.task</field>
        <field name="inherit_id" ref="project.view_task_form2"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='description']" position="attributes">
                <attribute name="attrs">{'invisible': [('use_pad', '=', True)], 'readonly': [('use_pad', '=', True)]}</attribute>
            </xpath>
            <field name="description" position="after">
                <field name="use_pad" invisible="1"/>
                <field name="description_pad" widget="pad" attrs="{'invisible': [('use_pad', '=', False)], 'readonly': [('use_pad', '=', False)]}"/>
            </field>
        </field>
    </record>

    <record id="project_project_view_form" model="ir.ui.view">
        <field name="name">project.project.view.form</field>
        <field name="model">project.project</field>
        <field name="inherit_id" ref="project.edit_project"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='description']" position="attributes">
                <attribute name="attrs">{'invisible': [('use_pads', '=', True)], 'readonly': [('use_pads', '=', True)]}</attribute>
            </xpath>
            <field name="description" position="after">
                <field name="use_pads" invisible="1"/>
                <field name="description_pad" widget="pad" nolabel="1"
                       attrs="{'invisible': [('use_pads', '=', False)], 'readonly': [('use_pads', '=', False)]}"/>
            </field>
            <xpath expr="//div[@id='rating_settings']" position="after">
                <div class="col-lg-6 o_setting_box" id="pad_settings">
                    <div class="o_setting_left_pane">
                        <field name="use_pads"/>
                    </div>
                    <div class="o_setting_right_pane">
                        <label for="use_pads" string="Collaborative Pads"/>
                        <div class="text-muted">
                            Edit tasks' description collaboratively in real time.<br/>
                            See each author's text in a distinct color.
                        </div>
                        <div class="content-group" attrs="{'invisible': ['|', ('use_pads', '=', False), ('privacy_visibility', '!=', 'portal')]}">
                            <div class="mt16 row">
                                <label for="pad_availability" string="Available to:" class="col-3 col-lg-3 o_light_label"/>
                                <field name="pad_availability" widget="radio"/>
                            </div>
                        </div>
                    </div>
                </div>
            </xpath>
        </field>
    </record>

</odoo>