<?xml version="1.0" ?>
<openerp>
	<data>
		<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="action_id" colspan="4" readonly="1"/>
					<field name="user_id" select="1" colspan="4"/>
					<field name="state" select="1" readonly="1" />
					<group colspan="2" col="2">
						<button string="Subscribe" name="subscribe" type="object" states="draft"/>
						<button string="UnSubscribe" name="unsubscribe" 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 string="AuditTrail Rules">
					<field name="name" />
					<field name="object_id"/>
					<field name="user_id" />
					<field name="log_read" />
					<field name="log_write" />
					<field name="log_unlink" />
					<field name="log_create" />
					<field name="state" />
				</tree>
			</field>
		</record>
		<record model="ir.actions.act_window" id="action_audittrail_rule_tree">
			<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="view_id" ref="view_audittrail_rule_form" />-->
		</record>
		<menuitem name="Audittrails" id="menu_action_audittrail" parent="base.menu_administration"/>
		<menuitem name="Rules" id="menu_action_audittrail_rule_tree" action="action_audittrail_rule_tree" parent="menu_action_audittrail"/>


		<record model="ir.actions.act_window" id="action_audittrail_rule_tree_sub">
			<field name="res_model">audittrail.rule</field>
			<field name="view_type">form</field>
			<field name="view_mode">tree,form</field>
			<field name="domain">[('state','=','subscribed')]</field>
		</record>
		<menuitem name="Subscribed Rules" id="menu_action_audittrail_rule_tree_sub" action="action_audittrail_rule_tree_sub" parent="menu_action_audittrail_rule_tree"/>

		<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="object_id" select="1" readonly="1"/>
					<field name="method" select="1" readonly="1"/>
					<field name="user_id" select="1" readonly="1"/>
					<field name="res_id" readonly="1" colspan="4"/>
					<field name="line_ids"  colspan="4" mode="tree,form" widget="one2many_list" readonly="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="object_id" />
					<field name="method" />
					<field name="user_id" />
				</tree>
			</field>
		</record>

		<record model="ir.actions.act_window" id="action_audittrail_log_tree">
			<field name="res_model">audittrail.log</field>
			<field name="view_type">form</field>
		</record>
		<menuitem name="Logs" id="menu_action_audittrail_log_tree" action="action_audittrail_log_tree" parent="menu_action_audittrail"/>

		<wizard string="View log" menu="False" model="audittrail.log" name="audittrail.view.log" id="wizard_audittrail_log"/>
		<menuitem name="View Logs" id="menu_action_log_tree2" action="wizard_audittrail_log" type="wizard" parent="menu_action_audittrail"/>

</data>
</openerp>
