<?xml version="1.0"?>
<openerp>
<data noupdate="1">


    <!--
    Questions
    -->

    <record model="crm_profiling.question" id="activity_sector">
        <field name="name">Activity sector?</field>
    </record>
    <record model="crm_profiling.question" id="nb_employees">
        <field name="name">Number of employees?</field>
    </record>
    <record model="crm_profiling.question" id="partner_level">
        <field name="name">Partner level?</field>
    </record>
    <record model="crm_profiling.question" id="partner_tiny">
        <field name="name">OpenERP partner?</field>
    </record>

    <!--
    Questionnaires
    -->

    <record model="crm_profiling.questionnaire" id="questionnaire1">
        <field name="name">Base questionnaire</field>
        <field name="description">First questionnaire.</field>
        <field name="questions_ids" eval="[(6,0,[activity_sector,nb_employees,partner_level])]"/>
    </record>

    <!--
    Answers
    -->

    <record model="crm_profiling.answer" id="sector1">
        <field name="name">Services</field>
        <field name="question_id" ref="activity_sector"/>
    </record>
    <record model="crm_profiling.answer" id="sector2">
        <field name="name">Telecom</field>
        <field name="question_id" ref="activity_sector"/>
    </record>
    <record model="crm_profiling.answer" id="sector3">
        <field name="name">IT</field>
        <field name="question_id" ref="activity_sector"/>
    </record>
    <record model="crm_profiling.answer" id="nb_employees1">
        <field name="name">1 to 50</field>
        <field name="question_id" ref="nb_employees"/>
    </record>
    <record model="crm_profiling.answer" id="nb_employees2">
        <field name="name">51 to 100</field>
        <field name="question_id" ref="nb_employees"/>
    </record>
    <record model="crm_profiling.answer" id="nb_employees3">
        <field name="name">more than 100</field>
        <field name="question_id" ref="nb_employees"/>
    </record>
    <record model="crm_profiling.answer" id="partner_quality1">
        <field name="name">ready</field>
        <field name="question_id" ref="partner_level"/>
    </record>
    <record model="crm_profiling.answer" id="partner_quality2">
        <field name="name">silver</field>
        <field name="question_id" ref="partner_level"/>
    </record>
    <record model="crm_profiling.answer" id="partner_quality3">
        <field name="name">gold</field>
        <field name="question_id" ref="partner_level"/>
    </record>
    <record model="crm_profiling.answer" id="partner_tiny1">
        <field name="name">yes</field>
        <field name="question_id" ref="partner_tiny"/>
    </record>
    <record model="crm_profiling.answer" id="partner_tiny2">
        <field name="name">no</field>
        <field name="question_id" ref="partner_tiny"/>
    </record>


    <!--
    Resource: res.partner.category
    -->

    <record id="base.res_partner_category_17" model="res.partner.category">
        <field name="name">Telecom sector</field>
        <field name="parent_id" ref="base.res_partner_category_0"/>
    </record>


    <!--
    Profiles / crm.segmentation
    -->

    <record model="crm.segmentation" id="crm.crm_segmentation0">
        <field name="name">OpenERP partners</field>
        <field name="answer_yes" eval="[(6,0,[partner_tiny1])]" />
        <field name="categ_id" ref="base.res_partner_category_2"/>
        <field name="profiling_active">True</field>
    </record>
    <record model="crm.segmentation" id="crm_segmentation1">
        <field name="name">Ready partners</field>
        <field name="answer_yes" eval="[(6,0,[partner_quality1])]" />
        <field name="parent_id" ref="crm.crm_segmentation0"/>
        <field name="categ_id" ref="base.res_partner_category_6"/>
        <field name="profiling_active">True</field>
    </record>
    <record model="crm.segmentation" id="crm_segmentation2">
        <field name="name">Silver partners</field>
        <field name="answer_yes" eval="[(6,0,[partner_quality2])]" />
        <field name="parent_id" ref="crm.crm_segmentation0"/>
        <field name="categ_id" ref="base.res_partner_category_5"/>
        <field name="profiling_active">True</field>
    </record>
    <record model="crm.segmentation" id="crm_segmentation3">
        <field name="name">Gold partners</field>
        <field name="answer_yes" eval="[(6,0,[partner_quality3])]" />
        <field name="parent_id" ref="crm.crm_segmentation0"/>
        <field name="categ_id" ref="base.res_partner_category_4"/>
        <field name="exclusif">True</field>
        <field name="profiling_active">True</field>
    </record>
    <record model="crm.segmentation" id="crm_segmentation4">
        <field name="name">Service partners</field>
        <field name="answer_yes" eval="[(6,0,[sector1])]" />
        <field name="categ_id" ref="base.res_partner_category_8"/>
        <field name="profiling_active">True</field>
    </record>
    <record model="crm.segmentation" id="crm_segmentation5">
        <field name="name">Telecom partners</field>
        <field name="answer_yes" eval="[(6,0,[sector2])]" />
        <field name="categ_id" ref="base.res_partner_category_17"/>
        <field name="profiling_active">True</field>
    </record>
    <record model="crm.segmentation" id="crm_segmentation6">
        <field name="name">IT partners</field>
        <field name="answer_yes" eval="[(6,0,[sector3])]" />
        <field name="categ_id" ref="base.res_partner_category_7"/>
        <field name="profiling_active">True</field>
    </record>

    <!--
    Partners
    -->

    <record model="res.partner" id="base.res_partner_2">
        <field name="answers_ids" eval="[(6,0,[ref('nb_employees1'), ref('sector3'), ref('partner_tiny2')])]" />
    </record>
    <record model="res.partner" id="base.res_partner_12">
        <field name="answers_ids" eval="[(6,0,[ref('partner_quality3'), ref('nb_employees3'), ref('sector1'), ref('partner_tiny2')])]" />
    </record>
    <record model="res.partner" id="base.res_partner_9">
        <field name="answers_ids" eval="[(6,0,[ref('partner_quality1'), ref('nb_employees1'), ref('sector3'), ref('partner_tiny2')])]" />
    </record>
    <record model="res.partner" id="base.res_partner_17">
        <field name="answers_ids" eval="[(6,0,[ref('partner_quality3'), ref('nb_employees3'), ref('partner_tiny2')])]" />
    </record>
    <record model="res.partner" id="base.res_partner_18">
        <field name="answers_ids" eval="[(6,0,[ref('partner_quality2'), ref('nb_employees2'), ref('sector1'), ref('partner_tiny2')])]" />
    </record>
    <record model="res.partner" id="base.res_partner_15">
        <field name="answers_ids" eval="[(6,0,[ref('nb_employees2'), ref('partner_tiny2')])]" />
    </record>
    <record model="res.partner" id="base.res_partner_4">
        <field name="answers_ids" eval="[(6,0,[ref('partner_quality3'), ref('nb_employees1'), ref('sector2'), ref('partner_tiny2')])]" />
    </record>
    <record model="res.partner" id="base.res_partner_10">
        <field name="answers_ids" eval="[(6,0,[ref('partner_quality3'), ref('nb_employees2'), ref('sector3'), ref('partner_tiny2')])]" />
    </record>

</data>
</openerp>

