<?xml version="1.0"?>
<openerp>
	<data>
		<record model="board.note.type" id="note_crm_type">
			<field name="name">CRM Configuration</field>
		</record>	
		
		<record model="ir.ui.view" id="view_crm_case_user_graph1">
			<field name="name">crm.case.user.graph1</field>
			<field name="model">report.crm.case.user</field>
			<field name="type">graph</field>
			<field name="arch" type="xml">
				<graph string="Cases by User and Section" type="pie">
					<field name="state"/>
					<field name="nbr" operator="+"/>
				</graph>
			</field>
		</record>	

		<record model="ir.actions.act_window" id="act_my_leads">
			<field name="res_model">crm.case</field>
			<field name="view_type">form</field>
			<field name="view_mode">tree,form</field>
			<field name="view_id" ref="crm_configuration.crm_case_tree_view_leads"/>
			<field name="domain">[('section_id.name', '=', 'Leads'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
		</record>

		<record model="ir.actions.act_window" id="act_my_meetings">
			<field name="res_model">crm.case</field>
			<field name="view_type">form</field>
			<field name="view_mode">tree,form</field>
			<field name="view_id" ref="crm_configuration.crm_case_tree_view_meet"/>
			<field name="domain">[('section_id.name', '=', 'Meetings'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
		</record>
			
		<act_window name="My Cases"
				domain="[('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]"
				res_model="crm.case"
				view_type="form"
				view_mode="tree,form"
				id="act_my_cases"/>	
							
		<record model="ir.actions.act_window" id="act_my_leads_stage">
			<field name="res_model">report.crm.case.section.stage</field>
			<field name="view_type">form</field>
			<field name="view_mode">graph,tree,form</field>
			<field name="view_id" ref="view_crm_lead_stage_graph1"/>
			<field name="domain">[('section_id.name', '=', 'Leads'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
		</record>
					
		<record model="ir.actions.act_window" id="act_sales_pipeline">
			<field name="res_model">report.crm.case.user</field>
			<field name="view_type">form</field>
			<field name="view_mode">graph,tree,form</field>
			<field name="view_id" ref="view_crm_case_user_graph1"/>
			<field name="domain">[('section_id.name', '=', 'Opportunities'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
		</record>	
		
		<record model="ir.actions.act_window" id="act_jobs_requests">
			<field name="res_model">report.crm.case.user</field>
			<field name="view_type">form</field>
			<field name="view_mode">graph,tree,form</field>
			<field name="view_id" ref="view_crm_case_user_graph1"/>
			<field name="domain">[('section_id.name','=','Jobs'),('user_id','=',uid),('state','!=','pending'),('state','!=','cancel')]</field>
		</record>
					
		<record model="ir.ui.view" id="board_crm_form">
			<field name="name">CRM - Dashboard Form</field>
			<field name="model">board.board</field>
			<field name="type">form</field>
			<field name="arch" type="xml">
				<form string="Connecting Dashboard">
					<hpaned>

						<child1>

							<action
								string="My Leads"
								name="%(act_my_leads)d"
								colspan="4"
								height="150"
								width="510"/>

							<action
								string="My Meetings"
								name="%(act_my_meetings)d"
								height="150"
								colspan="4"/>

							<action
								string="My Cases"
								name="%(act_my_cases)d"
								colspan="4"
								height="200"/>

						</child1>

						<child2>
							<action
								string="My Leads By Stage"
								name="%(act_my_leads_stage)d"
								colspan="4"/>

							<action
								string="My Sales Pipeline"
								name="%(act_sales_pipeline)d"
								colspan="4"/>

						</child2>
					</hpaned>
				</form>
			</field>
		</record>
		<record model="ir.actions.act_window" id="open_board_crm">
			<field name="name">CRM Dashboard</field>
			<field name="res_model">board.board</field>
			<field name="view_type">form</field>
			<field name="view_mode">form</field>
			<field name="usage">menu</field>
			<field name="view_id" ref="board_crm_form"/>
		</record>

		<menuitem 
			name="Connecting Dashboard" parent="menu_board_crm_config"
			action="open_board_crm"
			sequence="1"
			id="menu_board_crm" icon="terp-graph"/>


	</data>
</openerp>
