<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="1">

        <!-- After installation of the module, open the related menu -->
        <record id="action_client_crm_menu" model="ir.actions.client">
            <field name="name">Open Sale Menu</field>
            <field name="tag">reload</field>
            <field name="params" eval="{'menu_id': ref('base.menu_base_partner')}"/>
        </record>
        <record id="base.open_menu" model="ir.actions.todo">
            <field name="action_id" ref="action_client_crm_menu"/>
            <field name="state">open</field>
        </record>

        <record model="crm.case.channel" id="crm_case_channel_website">
            <field name="name">Website</field>
        </record>
        <record model="crm.case.channel" id="crm_case_channel_phone">
            <field name="name">Phone</field>
        </record>
        <record model="crm.case.channel" id="crm_case_channel_direct">
            <field name="name">Direct</field>
        </record>
        <record model="crm.case.channel" id="crm_case_channel_email">
            <field name="name">Email</field>
        </record>

        <record model="crm.case.section" id="section_sales_department">
            <field name="name">Sales Department</field>
            <field name="code">Sales</field>
        </record>

        <!-- Payment Mode -->

        <record model="crm.payment.mode" id="payment_mode_1">
            <field name="name">Cash</field>
            <field name="section_id" ref="crm.section_sales_department"/>
        </record>

        <record model="crm.payment.mode" id="payment_mode_2">
            <field name="name">Check</field>
            <field name="section_id" ref="crm.section_sales_department"/>
        </record>

        <record model="crm.payment.mode" id="payment_mode_3">
            <field name="name">Credit Card</field>
            <field name="section_id" ref="crm.section_sales_department"/>
        </record>

        <record model="crm.payment.mode" id="payment_mode_4">
            <field name="name">Demand Draft</field>
            <field name="section_id" ref="crm.section_sales_department"/>
        </record>

        <!-- notify all employees of module installation -->
        <record model="mail.message" id="module_install_notification">
            <field name="model">mail.group</field>
            <field name="res_id" ref="mail.group_all_employees"/>
            <field name="type">notification</field>
            <field name="subtype_id" ref="mail.mt_comment"/>
            <field name="subject">CRM application installed!</field>
            <field name="body"><![CDATA[<p>From the top Sales menu you can track leads and opportunities, get accurate forecast on your sales pipeline, plan meetings and phonecalls, get realtime statistics and efficiently organize the communication with your prospects.</p>
<p>To manage quotations and sale orders, install the "Sales Management" application.</p>]]></field>
        </record>

        <record model="mail.alias" id="default_sales_alias">
            <field name="alias_name">sales</field>
            <field name="alias_model_id" ref="model_crm_lead"/>
            <field name="alias_user_id" ref="base.user_root"/>
            <field name="alias_defaults">{'type':'lead'}</field>
        </record>
    </data>

    <!-- Mail template is done in a NOUPDATE block
         so users can freely customize/delete them -->
    <data noupdate="1">

        <!--Definition of an email template with an empty body that will be used in opportunity mailing. Used to give a
            basis for email recipients, name and to ease the definition of a further elaborated template. -->
        <record id="email_template_opportunity_mail" model="email.template">
            <field name="name">Opportunity - Send Emails</field>
            <field name="subject">${object.name}</field>
            <field name="model_id" ref="crm.model_crm_lead"/>
            <field name="auto_delete" eval="True"/>
            <field name="email_recipients">${object.partner_id.id}</field>
            <field name="body_html"></field> 
        </record>
    </data>
</openerp>
