<openerp>
<data>

	#
	# Packings by invoice type
	#

	<record model="ir.ui.view" id="view_picking_invoice_type_stats_form">
		<field name="name">sale_journal.invoice.type.stats.form</field>
		<field name="model">sale_journal.invoice.type.stats</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Packing by invoice method">
				<field name="name" select="1"/>
				<field name="invoice_state" select="1"/>
				<field name="state" select="1"/>
				<field name="invoice_type_id" select="1"/>
				<field name="quantity"/>
				<field name="count"/>
				<field name="price_total"/>
				<field name="price_average"/>
			</form>
		</field>
	</record>
	<record model="ir.ui.view" id="view_picking_invoice_type_stats_tree">
		<field name="name">sale_journal.invoice.type.stats.tree</field>
		<field name="model">sale_journal.invoice.type.stats</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="Packing by invoice method">
				<field name="name"/>
				<field name="invoice_state"/>
				<field name="state"/>
				<field name="invoice_type_id"/>
				<field name="quantity"/>
				<field name="count"/>
				<field name="price_total"/>
				<field name="price_average"/>
			</tree>
		</field>
	</record>
	<record model="ir.actions.act_window" id="action_invoice_type_picking_stats_open">
		<field name="name">Statistics on packing to invoice</field>
		<field name="res_model">sale_journal.invoice.type.stats</field>
		<field name="type">ir.actions.act_window</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]</field>
	</record>

	<record model="ir.actions.act_window" id="action_invoice_type_picking_stats_open_menu_month">
		<field name="name">Packing by invoice method</field>
		<field name="res_model">sale_journal.invoice.type.stats</field>
		<field name="type">ir.actions.act_window</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('name','=',time.strftime('%Y-%m-01'))]</field>
	</record>
	
	<menuitem name="Packing Journal" id="menu_definition_journal_reporting" parent="stock.next_id_61"/>
	<menuitem name="This Month" id="menu_definition_journal_reporting_this" parent="menu_definition_journal_reporting"/>
	<menuitem name="Packing by Invoice Method" id="menu_invoice_type_picking_stats_open_menu" parent="menu_definition_journal_reporting_this" action="action_invoice_type_picking_stats_open_menu_month"/>

	<record model="ir.actions.act_window" id="action_invoice_type_picking_stats_open_menu_all">
		<field name="name">Packing by invoice method</field>
		<field name="res_model">sale_journal.invoice.type.stats</field>
		<field name="type">ir.actions.act_window</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
	</record>
	
	<menuitem name="All Months" id="menu_definition_journal_reporting_all" parent="menu_definition_journal_reporting"/>
	<menuitem name="Packing by Invoice Method" id="menu_invoice_type_picking_stats_open_all" parent="menu_definition_journal_reporting_all" action="action_invoice_type_picking_stats_open_menu_all"/>

	#
	# Packing by journal
	#

	<record model="ir.ui.view" id="view_picking_journal_stats_form">
		<field name="name">sale_journal.picking.stats.form</field>
		<field name="model">sale_journal.picking.stats</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Packing by journals">
				<field name="name" select="1"/>
				<field name="state" select="1"/>
				<field name="journal_id" select="1"/>
				<field name="quantity"/>
				<field name="count"/>
				<field name="price_total"/>
				<field name="price_average"/>
			</form>
		</field>
	</record>
	<record model="ir.ui.view" id="view_picking_journal_stats_tree">
		<field name="name">sale_journal.picking.stats.tree</field>
		<field name="model">sale_journal.picking.stats</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="Packing by journals">
				<field name="name"/>
				<field name="state"/>
				<field name="journal_id"/>
				<field name="quantity"/>
				<field name="count"/>
				<field name="price_total"/>
				<field name="price_average"/>
			</tree>
		</field>
	</record>

	<record model="ir.actions.act_window" id="action_picking_picking_stats_open_menu_month">
		<field name="name">Packing by journal</field>
		<field name="res_model">sale_journal.picking.stats</field>
		<field name="type">ir.actions.act_window</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
		<field name="domain">[('name','=',time.strftime('%Y-%m-01'))]</field>
	</record>
	
	<menuitem name="Packing by Journal" id="menu_picking_picking_stats_open_menu" parent="menu_definition_journal_reporting_this" action="action_picking_picking_stats_open_menu_month"/>
	
	<record model="ir.actions.act_window" id="action_picking_picking_stats_open_menu_all">
		<field name="name">Packing by journal</field>
		<field name="res_model">sale_journal.picking.stats</field>
		<field name="type">ir.actions.act_window</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
	</record>
	
	<menuitem name="Packing by Journal" id="menu_picking_picking_stats_open_all" parent="menu_definition_journal_reporting_all" action="action_picking_picking_stats_open_menu_all"/>

</data>
</openerp>
