bzr revid: hmo@tinyerp.com-20111020094728-cggyscrr4hjq5bvm
This commit is contained in:
Harry (OpenERP)
2011-10-20 15:17:28 +05:30
3 changed files with 11 additions and 78 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ It also has been merged with the earlier CRM & SRM segmentation tool because the
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'wizard/open_questionnaire_view.xml', 'crm_profiling_view.xml'],
'demo_xml': ['crm_profiling_demo.xml'],
'test': ['test/test_crm_profiling.yml',
'test': ['test/process/profiling.yml',
'test/test_crm_segmentation.yml',],
'installable': True,
'active': False,
@@ -0,0 +1,10 @@
-
I check segmentation which allows users to perform segmentation within partners
and set the category according to question, so first compute questions(answers)
scenario with parther and check that category set according to questions.
-
!python {model: res.partner}: |
data ={'form': {'quest_form3': ref("partner_quality3"), 'quest_form2': ref("nb_employees2"),'quest_form1': ref("sector1"),'questionnaire_name': ref('questionnaire1')}, 'ids': [ref('base.res_partner_ericdubois0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('base.res_partner_ericdubois0')}
data = self._questionnaire_compute(cr, uid, data, context)
partner = self.browse(cr, uid, ref('base.res_partner_ericdubois0'))
assert partner.category_id[0].id == ref("base.res_partner_category_17"), "Category not assign properly"
@@ -1,77 +0,0 @@
- |
I check segmentation which allows users to perform segmentation within partners.
-
I create a crm profiling question record.
-
!record {model: crm_profiling.question, id: crm_profiling_question_openerppartner0}:
answers_ids:
- name: 'no'
name: OpenERP partner?
-
I create a crm profiling answer record.
-
!record {model: crm_profiling.answer, id: crm_profiling_answer_openerppartner0}:
name: 'yes'
question_id: crm_profiling_question_openerppartner0
-
I create Partner category Customers.
-
!record {model: res.partner.category, id: res_partner_category_customers0}:
name: Customers
- |
I'm creating new partner "John" with his email "info@mycustomer.com".
-
!record {model: res.partner, id: res_partner_john0}:
address:
- city: Bruxelles
country_id: base.be
street: Rue des Palais 51, bte 33
type: default
zip: '1000'
email: 'info@mycustomer.com'
name: John
category_id:
- res_partner_category_customers0
answers_ids:
- crm_profiling_answer_openerppartner0
-
Define the answers and category to partner.
-
!python {model: res.partner}: |
data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')}
self._questionnaire_compute(cr, uid, data, context)
- |
I start by creating new Questionnaire.
-
!record {model: crm_profiling.questionnaire, id: crm_profiling_questionnaire_basequestionnaire0}:
description: First questionnaire.
name: Base questionnaire
questions_ids:
- crm_profiling.activity_sector
- crm_profiling.nb_employees
- crm_profiling.partner_level
- |
I create the form for the "Base questionnaire".
-
!python {model: crm_profiling.questionnaire}: |
context.update({'active_id':ref('res_partner_john0')})
data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')}
self.build_form(cr, uid, data, context)
-
I create a segmentation record.
-
!record {model: crm.segmentation, id: crm_segmentation_test1}:
answer_yes:
- crm_profiling_answer_openerppartner0
categ_id: res_partner_category_customers0
name: test
parent_id: crm_profiling.crm_segmentation0
profiling_active: true
som_interval: 0.0
- |
I continue the process of segmentation.
-
!python {model: crm.segmentation}: |
self.process_continue(cr, uid, [ref('crm_segmentation_test1')], start=False)