~julius-network-solutions/openobject-addons/trunk-bug-wiki-image

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" ?>
<openerp>
    <data>

    <!-- Audittrail Rule form -->

        <record model="ir.ui.view" id="view_audittrail_rule_form">
            <field name="name">audittrail.rule.form</field>
            <field name="model">audittrail.rule</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="AuditTrail Rule">
                    <field name="name" select="1" required="1"/>
                    <field name="object_id" select="1"/>
                    <field name="log_read"/>
                    <field name="log_write"/>
                    <field name="log_unlink"/>
                    <field name="log_create"/>
                    <field name="log_action"/>
                    <field name="log_workflow"/>
                    <separator string="Users (if User is not added then it will applicable for all users)"  colspan="4" />
                    <field name="user_id" select="1" colspan="4" nolabel="1" />
                    <field name="action_id" colspan="4" readonly="1" groups="base.group_extended"/>
                    <field name="state" select="1" readonly="1" />
                    <group colspan="2" col="2">
                        <button string="_Subscribe" name="subscribe" icon="gtk-ok"
                            type="object" states="draft" />
                        <button string="UnSubscribe" name="unsubscribe" icon="gtk-cancel"
                            type="object" states="subscribed" />
                    </group>
                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="view_audittrail_rule_tree">
            <field name="name">audittrail.rule.tree</field>
            <field name="model">audittrail.rule</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree colors="blue:state in ('draft');black:state in ('subscribed')" string="AuditTrail Rules">
                    <field name="name" />
                    <field name="object_id"/>
                    <field name="log_read" />
                    <field name="log_write" />
                    <field name="log_unlink" />
                    <field name="log_create" />
                    <field name="log_action"/>
                    <field name="log_workflow"/>
                    <field name="state" />
                </tree>
            </field>
        </record>
       <record id="view_audittrail_rule_search" model="ir.ui.view">
            <field name="name">audittrail.rule.search</field>
            <field name="model">audittrail.rule</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Search Audittrail Rule">
                   <group col="8" colspan="4">
                    <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft  Rule"/>
                    <filter icon="terp-camera_test" string="Subscribed" domain="[('state','=','subscribed')]" help="Subscribed Rule"/>
                    <separator orientation="vertical"/>
                    <field name="name"/>
                    <field name="object_id"/>
                </group>
                <newline/>
                  <group expand="0" string="Group By..." colspan="4" col="10" groups="base.group_extended">
                    <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
                </group>
                </search>
            </field>
        </record>
    <!-- Action for audittrail rule -->

        <record model="ir.actions.act_window" id="action_audittrail_rule_tree">
            <field name="name">Audit Rules</field>
            <field name="res_model">audittrail.rule</field>
            <field name="type">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="context">{'search_default_draft': 1}</field>
            <field name="search_view_id" ref="view_audittrail_rule_search"/>
        </record>

        <menuitem id="menu_action_audittrail_rule_tree"
            action="action_audittrail_rule_tree" parent="base.menu_audit" />
        <!-- AuditTrail Log form -->

        <record model="ir.ui.view" id="view_audittrail_log_form">
            <field name="name">audittrail.log.form</field>
            <field name="model">audittrail.log</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="AuditTrail Logs">
                    <field name="timestamp" select="1" required="1" readonly="1"/>
                    <field name="user_id" select="1" readonly="1"/>
                    <field name="method" select="1" readonly="1"/>
                    <field name="name" readonly="1" select="1"/>
                    <field name="res_id" readonly="1"/>
                    <field name="object_id" select="1" readonly="1"/>
                    <field name="line_ids" colspan="4" mode="tree,form"
                        widget="one2many_list" readonly="1" nolabel="1">
                        <form string="Log Lines">
                            <field name="field_id" colspan="4"
                                readonly="1" />
                            <newline />
                            <field name="field_description" colspan="4"
                                readonly="1" />
                            <newline />
                            <separator string="Old Value : "
                                colspan="2" />
                            <separator string="New Value : "
                                colspan="2" />
                            <newline />
                            <field name="old_value" nolabel="1"
                                colspan="2" readonly="1" />
                            <field name="new_value" nolabel="1"
                                colspan="2" readonly="1" />
                            <newline />
                            <separator string="Old Value Text : "
                                colspan="2" />
                            <separator string="New Value Text: "
                                colspan="2" />
                            <newline />
                            <field name="old_value_text" nolabel="1"
                                colspan="2" readonly="1" />
                            <field name="new_value_text" nolabel="1"
                                colspan="2" readonly="1" />
                        </form>
                        <tree string="Log Lines">
                            <field name="field_description" />
                            <field name="old_value_text" />
                            <field name="new_value_text" />
                        </tree>
                    </field>
                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="view_audittrail_log_tree">
            <field name="name">audittrail.log.tree</field>
            <field name="model">audittrail.log</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="AuditTrail Logs">
                    <field name="timestamp" />
                    <field name="name" />
                    <field name="object_id" />
                    <field name="method" />
                    <field name="user_id" />
                </tree>
            </field>
        </record>
        
       <record id="view_audittrail_log_search" model="ir.ui.view">
            <field name="name">audittrail.log.search</field>
            <field name="model">audittrail.log</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Search Audittrail Log">
                 <group col="8" colspan="4">
                    <field name="name"/>
                    <field name="object_id"/>
                    <field name="user_id"  widget="selection"/>
                </group>
                <newline/>
                  <group expand="0" string="Group By..." colspan="4" col="10" groups="base.group_extended">
                    <filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
   					<separator orientation="vertical"/>                    
                    <filter string="Object" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'object_id'}"/>
					<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'timestamp'}"/>
                </group>
                </search>
            </field>
        </record>
<!--  Action for Audittrail Log  -->

        <record model="ir.actions.act_window" id="action_audittrail_log_tree">
            <field name="name">Audit Logs</field>
            <field name="res_model">audittrail.log</field>
            <field name="view_type">form</field>
            <field name="search_view_id" ref="view_audittrail_log_search"/>
        </record>
        <menuitem name="Audit Logs" id="menu_action_audittrail_log_tree"
            action="action_audittrail_log_tree" parent="base.menu_audit" />

    </data>
</openerp>