<?xml version="1.0"?>
<terp>
<data>
	<menuitem name="Marketing Operations" groups="admin"/>

	<record model="ir.ui.view" id="campaign_campaign_tree">
		<field name="model">campaign.campaign</field>
		<field name="name">campaign.campaign.view</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="Campaigns">
				<field name="date_start"/>
				<field name="date_stop"/>
				<field name="name"/>
			</tree>
		</field>
	</record>
	<record model="ir.ui.view" id="campaign_campaign_form">
		<field name="model">campaign.campaign</field>
		<field name="name">campaign.campaign.view</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Campaign Definition">
				<field name="name" colspan="3" select="1"/>
				<field name="costs"/>
				<newline/>
				<field name="date_start"/>
				<field name="date_stop"/>
				<field name="planned_costs"/>
				<field name="planned_revenue"/>
				<field name="info" colspan="3"/>
				<field name="step_id" colspan="3" widget="one2many_list"/>
			</form>
		</field>
	</record>

	<record model="ir.actions.act_window" id="view_campaign_tree">
		<field name="name">campaign.campaign.tree</field>
		<field name="res_model">campaign.campaign</field>
		<field name="type">ir.actions.act_window</field>
		<field name="view_type">tree</field>
		<field name="view_id" ref="campaign_campaign_tree"/>
	</record>
	<menuitem name="Marketing Operations/Campaigns" action="view_campaign_tree" groups="admin"/>

	<record model="ir.actions.act_window" id="view_campaign_form">
		<field name="name">campaign.campaign.form</field>
		<field name="res_model">campaign.campaign</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="Marketing Operations/Definitions" groups="admin" sequence="1"/>
	<menuitem name="Marketing Operations/Definitions/Campaign Definition" action="view_campaign_form"/>

	<record model="ir.ui.view" id="view_campaign_step_tree">
		<field name="model">campaign.step</field>
		<field name="name">campaign.step.tree</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="Campaign Steps">
				<field name="priority" select="1"/>
				<field name="name"/>
				<field name="start_date"/>
				<field name="stop_date"/>
				<field name="procent"/>
				<field name="costs"/>
			</tree>
		</field>
	</record>

	<record model="ir.ui.view" id="view_campaign_step_form">
		<field name="model">campaign.step</field>
		<field name="name">campaign.step.form</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Marketing Steps">
				<field name="name" select="1" colspan="3"/>
				<field name="priority" select="1"/>
				<field name="active" select="1"/>
				<field name="start_date" select="1"/>
				<field name="stop_date"/>
				<field name="procent"/>
				<field name="costs"/>
				<field name="max_try"/>
				<newline/>
				<field name="info" colspan="3"/>
			</form>
		</field>
	</record>

	<record model="ir.ui.view" id="campaign_partner_tree">
		<field name="model">campaign.partner</field>
		<field name="name">campaign.partner.tree</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="Marketing Prospects">
				<field name="partner_id" colspan="3"/>
				<field name="contact"/>
				<field name="step" select="1"/>
				<field name="user_id" select="1"/>
				<field name="priority" select="1"/>
				<field name="state" select="1"/>
			</tree>
		</field>
	</record>

	<record model="ir.ui.view" id="campaign_partner_form">
		<field name="model">campaign.partner</field>
		<field name="name">campaign.partner.form</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="Marketing::Prospects">
				<notebook>
				<page string="Main Information">
					<separator string="Prospect Information" colspan="4"/>
					<field name="name" select="1" colspan="3"/>
					<field name="user_id" select="1"/>
					<field name="active" select="1"/>
					<field name="partner_id" select="1"/>
					<field name="campaign_id"/>
					<field name="part_adr_id"/>
					<field name="contact"/>
					<field name="notes" colspan="3"/>
					<separator string="Step Information" colspan="4"/>
					<field name="step" select="1" domain="[('campaign_id','=',campaign_id)]"/>
					<field name="priority" select="1"/>
					<field name="date_recall" colspan="2"/>
					<button name="recall" type="object" string="Call again Later" states="draft"/>
					<newline/>
					<field name="info" colspan="3"/>
					<field name="state" select="1"/>
					<group col="2" colspan="2">
						<button name="stop_camp" type="object" string="Stop Campaign" states="draft,wait"/>
						<button name="continue_camp" type="object" string="Continue Campaign" states="stop,draft,wait"/>
					</group>
				</page><page string="History">
					<field name="history_ids" colspan="4" nolabel="1" readonly="1"/>
				</page>
				</notebook>
			</form>
		</field>
	</record>

	<record model="ir.ui.view" id="view_campaign_partner_history_form">
		<field name="model">campaign.partner.history</field>
		<field name="name">campaign.partner.history.form</field>
		<field name="type">form</field>
		<field name="arch" type="xml">
			<form string="History">
<!--
				<field name="name" colspan="3"/>
-->				
				<field name="step_id"/>
				<field name="date"/>
				<separator string="Comments" colspan="4"/>
				<field name="info" colspan="4" nolabel="1"/>
			</form>
		</field>
	</record>
	<record model="ir.ui.view" id="view_campaign_partner_history">
		<field name="model">campaign.partner.history</field>
		<field name="name">campaign.partner.history.tree</field>
		<field name="type">tree</field>
		<field name="arch" type="xml">
			<tree string="History">
				<field name="step_id"/>
				<field name="date"/>
			</tree>
		</field>
	</record>

	<record model="ir.actions.act_window" id="action_campaign_open">
		<field name="name">campaign.partner.open</field>
		<field name="res_model">campaign.partner</field>
		<field name="type">ir.actions.act_window</field>
		<field name="domain">[('campaign_id','=',active_id)]</field>
		<field name="view_type">form</field>
		<field name="view_mode">tree,form</field>
	</record>

	<record model="ir.values" id="ir_campaign_open">
		<field name="key" eval="'action'"/>
		<field name="key2" eval="'tree_but_open'"/>
		<field name="model" eval="'campaign.campaign'"/>
		<field name="name">Open Campaign</field>
		<field name="value" eval="'ir.actions.act_window,%d'%action_campaign_open"/>
		<field name="object" eval="True"/>
	</record>

</data>
</terp>
