<?xml version="1.0" ?>
<openerp>
    <data>
        <!-- Email tempalte -->
        <record id="email_template_1" model="email.template">
            <field name="name">welcome new partner</field>
            <field name="email_from">info@openerp.com</field>
            <field name="subject">Welcome to the OpenERP Partner Channel!</field>
            <field name="email_to">${(object.email or '')|safe}</field>
            <field name="model_id" ref="base.model_res_partner"/>
            <field name="body_html">Hello, you will receive your welcome pack via email shortly.</field>
        </record>
        <record id="email_template_2" model="email.template">
            <field name="name">congrats silver partner</field>
            <field name="email_from">info@openerp.com</field>
            <field name="subject">Congratulations! You are now a Silver Partner!</field>
            <field name="email_to">${(object.email or '')|safe}</field>
            <field name="model_id" ref="base.model_res_partner"/>
            <field name="body_html">Hi, we are delighted to welcome you among our Silver Partners as of today!</field>
        </record>

        <record id="email_template_3" model="email.template">
            <field name="name">congrats gold partner</field>
            <field name="email_from">info@openerp.com</field>
            <field name="subject">Congratulations! You are now one of our Gold Partners!</field>
            <field name="email_to">${(object.email or '')|safe}</field>
            <field name="model_id" ref="base.model_res_partner"/>
            <field name="body_html">Hi, we are delighted to let you know that you have entered the select circle of our Gold Partners</field>
        </record>



    <!-- Campaign -->
        <record id="marketing_campaign_openerppartnerchannel" model="marketing.campaign">
            <field name="name">OpenERP Partner Channel</field>
            <field name="object_id" ref="base.model_res_partner"/>
            <field name="mode">active</field>
        </record>

            <!-- Activity -->

        <record id="marketing_campaign_activity_0" model="marketing.campaign.activity">
            <field name="name">New Partner</field>
            <field name="campaign_id" ref="marketing_campaign_openerppartnerchannel"/>
            <field name="email_template_id" ref="email_template_1"/>
            <field name="condition">object.credit_limit &lt; 10000</field>
            <field name="keep_if_condition_not_met">True</field>
            <field eval="1" name="start"/>
        </record>
        <record id="marketing_campaign_activity_1" model="marketing.campaign.activity">
            <field name="name">Silver Partner</field>
            <field name="campaign_id" ref="marketing_campaign_openerppartnerchannel"/>
            <field name="condition">object.credit_limit &gt;= 10000 and object.credit_limit &lt; 50000</field>
            <field name="keep_if_condition_not_met">True</field>
            <field name="email_template_id" ref="email_template_2"/>
        </record>

        <record id="marketing_campaign_activity_2" model="marketing.campaign.activity">
            <field name="name">Gold Partner</field>
            <field name="condition">object.credit_limit &gt;= 100000</field>
            <field name="campaign_id" ref="marketing_campaign_openerppartnerchannel"/>
            <field name="keep_if_condition_not_met">True</field>
            <field name="email_template_id" ref="email_template_3"/>
        </record>


    <!-- Transition -->
        <record id="marketing_campaign_transition_0" model="marketing.campaign.transition">
            <field model="marketing.campaign.activity" name="activity_from_id" ref = "marketing_campaign_activity_0"/>
            <field model="marketing.campaign.activity" name="activity_to_id" ref = "marketing_campaign_activity_1"/>
        </record>

        <record id="marketing_campaign_transition_1" model="marketing.campaign.transition">
            <field model="marketing.campaign.activity" name="activity_from_id" ref = "marketing_campaign_activity_1"/>
            <field model="marketing.campaign.activity" name="activity_to_id" ref = "marketing_campaign_activity_2"/>
        </record>

    <!-- Segment -->
        <record id="filter0" model="ir.filters">
            <field name="name">Partners</field>
            <field name="domain">[('name','like','Agrolait')]</field>
            <field name="model_id">res.partner</field>
        </record>
        <record id="marketing_campaign_segment0" model="marketing.campaign.segment">
            <field eval="time.strftime('%Y-%m-%d %H:%M:%S')" name="date_run"/>
            <field name="name">OpenERP Partner</field>
            <field name="sync_mode">create_date</field>
            <field name="ir_filter_id" ref="filter0"></field>
            <field name="campaign_id" ref="marketing_campaign_openerppartnerchannel"/>
        </record>

    </data>
</openerp>
