~tkodev/tko-import-google/trunk

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
    
    <!-- action -->
    <record id="action_import_google" model="ir.actions.act_window">
        <field name="name">import_google</field>
        <field name="res_model">import_google</field>
        <field name="view_type">form</field>
        <field name="view_mode">kanban,tree,form,calendar</field>
        <field name="domain">[]</field>
    </record>
    
    <!-- menu -->
    <menuitem 
        id="menu_import_google" 
        name="import_google" 
        sequence="10" />
    
    <!-- submenus -->
    <menuitem 
        id="menu_import_google_sub" 
        name="Sub-menu" 
        parent="menu_import_google" />
        
    <menuitem 
        name="import_google" 
        id="menu_import_google_sub_sub" 
        parent="menu_import_google_sub" 
        action="action_import_google" />
    
    <!-- form -->
    <record id="import_google_form" model="ir.ui.view">
        <field name="name">import_google.form</field>
        <field name="model">import_google</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <field name="name" />
            <field name="image" widget="image" />
            <newline />
            <field name="priority" />
            <newline />
            <field name="partner_id" />
            <field name="date_start" />
            <field name="amount" />
            <field name="date_stop" />
            <field name="observations" />
            <newline />
            <field name="state" widget="statusbar" />
            <button name="sign_done" 
                    states="draft" 
                    string="Done" 
                    icon="gtk-apply" />
            <button name="sign_cancel" 
                    states="draft,done" 
                    string="Cancel" 
                    icon="gtk-cancel" />
        </field>
    </record>
    
    <!-- tree -->
    <record id="import_google_tree" model="ir.ui.view">
        <field name="name">import_google.tree</field>
        <field name="model">import_google</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <field name="name" />
            <field name="partner_id" />
            <field name="amount" />
            <field name="date_start" />
            <field name="date_stop" />
            <field name="state" />
            <field name="priority" />
            <button name="sign_done" 
                    states="draft" 
                    string="Done" 
                    icon="gtk-apply" />
            <button name="sign_cancel" 
                    states="draft,done" 
                    string="Cancel" 
                    icon="gtk-cancel" />
        </field>
    </record>
    
    <!-- calendar -->
    <record id="import_google_calendar" model="ir.ui.view">
        <field name="name">import_google.calendar</field>
        <field name="model">import_google</field>
        <field name="type">calendar</field>
        <field name="arch" type="xml">
            <calendar string="import_google" date_start="date_start" color="partner_id" date_stop="date_stop" >
                <field name="name" />
                <field name="partner_id" />
            </calendar>
        </field>
    </record>
    
    <!-- kanban -->
    <record model="ir.ui.view" id="kanban_view_import_google">
        <field name="name">import_google Kanban</field>
        <field name="model">import_google</field>
        <field name="type">kanban</field>
        <field name="arch" type="xml">
            <kanban default_group_by="priority">
                <field name="priority" />
                <field name="color" />
                <field name="date_start" />
                <field name="amount" sum="Total Amount"/>
                <templates>
                    <t t-name="kanban_details">
                        <ul class="oe_kanban_tooltip">
                            <li><b>State:</b> <field name="state"/>%%</li>xx
                        </ul>
                    </t>
                    <t t-name="kanban-box">
                        <div t-attf-class="#{kanban_color(record.color.raw_value)} #{border || ''}">
                            <div class="oe_kanban_box oe_kanban_color_border">
                                <table class="oe_kanban_table oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle">
                                <tr>
                                    <td align="left" valign="middle" class="oe_kanban_title" tooltip="lead_details">
                                        <field name="name"/>
                                    </td>
                                </tr>
                                </table>
                                
                                <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger">
                                    <div>
                                        <b>
                                            <field name="partner_id" />
                                        </b>
                                    </div>
                                    <div style="padding-left: 0.5em">
                                        <t t-if="record.observations.raw_value"><field name="observations" /><br /></t>
                                        <i><field name="date_start"/>
                                        <t t-if="record.date_stop.raw_value"> : </t><field name="date_stop"/></i>
                                    </div>
                                </div>
                                
                                <div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick">
                                    <div class="oe_kanban_left">
                                        <a string="Edit" icon="gtk-edit" type="edit"/>
                                        <a string="Change Color" icon="color-picker" type="color" name="color"/>
                                        <a string="Send New Email" name="%(mail.action_email_compose_message_wizard)d" icon="terp-mail-message-new" type="action"/>
                                    </div>
                                    <div class="oe_kanban_right">
                                        <a name="action_done" string="Done" type="object" states="draft" icon="kanban-apply" />
                                        <a name="action_cancel" string="Cancel" type="object" states="draft,done" icon="kanban-stop" />
                                    </div>
                                    <br class="oe_kanban_clear"/>
                                </div>
                            </div>
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record>
    
    <!-- Search -->
    <record id="import_google_search" model="ir.ui.view">
        <field name="name">import_google.search</field>
        <field name="model">import_google</field>
        <field name="type">search</field>
        <field name="arch" type="xml">
            <search string="import_google">
                <group>
                    <filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
                    <filter string="Opened" domain="[('state','=','done')]" icon="terp-camera_test"/>
                    <filter string="Canceled" domain="[('state','=','cancel')]" icon="terp-dialog-close"/>
                    <separator orientation="vertical"/>
                    <field name="priority"/>
                    <field name="name"/>
                </group>
                <newline/>
                <group expand="0" string="Group By...">
                    <filter string="Priority" context="{'group_by': 'priority'}" icon="terp-emblem-important"/>
                    <filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
                    <separator orientation="vertical"/>
                    <filter string="Partner" context="{'group_by': 'partner_id'}" icon="terp-partner"/>
                </group>
            </search>
        </field>
    </record>
    
    <!-- Dashboards -->
    
    </data>
</openerp>