auditlog_view.xml 8.98 KB
Newer Older
François C. committed
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 189 190 191 192 193 194 195 196 197 198 199 200 201
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <menuitem id="menu_audit" name="Audit"
            parent="base.menu_reporting" sequence="50"
            groups="base.group_system"/>


        <!-- auditlog.rule -->

        <record model="ir.ui.view" id="view_auditlog_rule_form">
            <field name="name">auditlog.rule.form</field>
            <field name="model">auditlog.rule</field>
            <field name="arch" type="xml">
                <form string="Rule">
                    <header>
                        <button string="Subscribe" name="subscribe"
                            type="object" states="draft" class="oe_highlight"/>
                        <button string="Unsubscribe" name="unsubscribe"
                            type="object" states="subscribed"/>
                        <field name="state" widget="statusbar"/>
                    </header>
                    <sheet>
                        <group string="Rule">
                            <group colspan="1">
                                <field name="name" required="1"/>
                                <field name="model_id"/>
                                <field name="action_id" readonly="1" groups="base.group_no_one"/>
                            </group>
                            <group colspan="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"/>-->
                            </group>
                        </group>
                        <!--
                        <group string="Users">
                            <field name="user_ids" nolabel="1"/>
                        </group>
                        -->
                    </sheet>
                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="view_auditlog_rule_tree">
            <field name="name">auditlog.rule.tree</field>
            <field name="model">auditlog.rule</field>
            <field name="arch" type="xml">
                <tree colors="blue:state == 'draft';black:state == 'subscribed'" string="Rules">
                    <field name="name"/>
                    <field name="model_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_auditlog_rule_search" model="ir.ui.view">
            <field name="name">auditlog.rule.search</field>
            <field name="model">auditlog.rule</field>
            <field name="arch" type="xml">
                <search string="Rules">
                    <field name="name"/>
                    <filter name="state_draft"
                        domain="[('state','=','draft')]" string="Draft"/>
                    <filter name="state_subscribed"
                        domain="[('state','=','subscribed')]" string="Subscribed"/>
                    <field name="model_id"/>
                    <group expand="0" string="Group By...">
                        <filter name="group_by_state" string="State"
                            domain="[]" context="{'group_by':'state'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_auditlog_rule_tree">
            <field name="name">Rules</field>
            <field name="res_model">auditlog.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">{}</field>
            <field name="search_view_id" ref="view_auditlog_rule_search"/>
        </record>

        <menuitem id="menu_action_auditlog_rule_tree" parent="menu_audit" action="action_auditlog_rule_tree"/>


        <!-- auditlog.log -->

        <record model="ir.ui.view" id="view_auditlog_log_form">
            <field name="name">auditlog.log.form</field>
            <field name="model">auditlog.log</field>
            <field name="arch" type="xml">
                <form string="Log">
                    <sheet>
                        <group string="Log">
                            <group colspan="1">
                                <field name="create_date" readonly="1"/>
                                <field name="user_id" readonly="1"/>
                                <field name="method" readonly="1"/>
                            </group>
                            <group colspan="1">
                                <field name="model_id" readonly="1"/>
                                <field name="res_id" readonly="1"/>
                                <field name="name" readonly="1"/>
                            </group>
                        </group>
                        <group string="Fields updated">
                            <field name="line_ids" readonly="1" nolabel="1">
                                <form string="Log - Field updated">
                                    <group>
                                        <field name="field_id" readonly="1"/>
                                    </group>
                                    <group string="Values" col="4">
                                        <field name="old_value" readonly="1"/>
                                        <field name="new_value" readonly="1"/>
                                        <field name="old_value_text" readonly="1"/>
                                        <field name="new_value_text" readonly="1"/>
                                    </group>
                                </form>
                                <tree>
                                    <field name="field_description"/>
                                    <field name="field_name"/>
                                    <!--<field name="old_value"/>-->
                                    <field name="old_value_text"/>
                                    <!--<field name="new_value"/>-->
                                    <field name="new_value_text"/>
                                </tree>
                            </field>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="view_auditlog_log_tree">
            <field name="name">auditlog.log.tree</field>
            <field name="model">auditlog.log</field>
            <field name="arch" type="xml">
                <tree string="Logs" create="false">
                    <field name="create_date"/>
                    <field name="name"/>
                    <field name="model_id"/>
                    <field name="res_id"/>
                    <field name="method"/>
                    <field name="user_id"/>
                </tree>
            </field>
        </record>

       <record id="view_auditlog_log_search" model="ir.ui.view">
            <field name="name">auditlog.log.search</field>
            <field name="model">auditlog.log</field>
            <field name="arch" type="xml">
                <search string="Logs">
                    <field name="name"/>
                    <field name="model_id"/>
                    <field name="res_id"/>
                    <field name="user_id"/>
                    <group expand="0" string="Group By...">
                        <filter name="group_by_user_id"
                            string="User"
                            domain="[]" context="{'group_by':'user_id'}"/>
                        <filter name="group_by_model_id"
                            string="Model"
                            domain="[]" context="{'group_by':'model_id'}"/>
                        <filter name="group_by_res_id"
                            string="Resource ID"
                            domain="[]" context="{'group_by':'res_id'}"/>
                        <filter name="group_by_create_date"
                            string="Date"
                            domain="[]" context="{'group_by':'create_date'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_auditlog_log_tree">
            <field name="name">Logs</field>
            <field name="res_model">auditlog.log</field>
            <field name="view_type">form</field>
            <field name="search_view_id" ref="view_auditlog_log_search"/>
        </record>

        <menuitem id="menu_audit_logs" name="Logs"
            parent="menu_audit" action="action_auditlog_log_tree"/>

    </data>
</openerp>