Devishree Brahmbhatt (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-coverage_crm-jam into 
lp:openobject-addons.

Requested reviews:
  Bhumika (OpenERP) (sbh-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-coverage_crm-jam/+merge/76543

Hello Ma'am,

I have improve the yaml test cases for crm's modules.
So, kindly review it.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-coverage_crm-jam/+merge/76543
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-coverage_crm-jam.
=== modified file 'crm/__openerp__.py'
--- crm/__openerp__.py	2011-08-27 21:19:48 +0000
+++ crm/__openerp__.py	2011-09-22 10:18:44 +0000
@@ -126,6 +126,11 @@
             'test/test_crm_recurrent_meeting.yml',
             'test/test_crm_stage_changes.yml',
             'test/test_crm_recurrent_meeting_case2.yml',
+            'test/test_crm_lead_case2.yml',
+            'test/test_crm_opportunity_case2.yml',
+            'test/test_crm_phonecall_case2.yml',
+            'test/test_crm_partner2opportunity.yml',
+            'test/test_crm_segmentation.yml',
              ],
     'installable': True,
     'active': False,

=== modified file 'crm/test/test_crm_lead.yml'
--- crm/test/test_crm_lead.yml	2011-02-04 13:05:56 +0000
+++ crm/test/test_crm_lead.yml	2011-09-22 10:18:44 +0000
@@ -1,8 +1,18 @@
--  |
+-  |
    In order to test the CRM in OpenERP,
    I will do a customer qualification process that
    starts with a fist contact with a customer (a lead), which will be converted to a
    business opportunity and a partner.
+-
+  I check installer report.
+-
+  !record {model: base.setup.installer , id: base_action_rule_0_1}:
+    name: Test_action
+-
+  I create the view at the time of setup.
+-
+   !python {model: base.setup.installer}: |
+      self.fields_view_get(cr, uid,view_id=None, view_type='form', context=None, toolbar=False, submenu=False)
 -  |
    In order to test the flow, I create a two new users "user_crm" and
    I assign the group "salesman".
@@ -25,26 +35,36 @@
      email_from: [email protected]
      name: New Customer
      partner_name: Capegemini
+     partner_id: base.res_partner_9
      phone: (855) 924-4364
      mobile: (333) 715-1450
      section_id: crm.section_sales_department
      referred: False
 -  |
-   I check that the lead is in 'draft' state,
+   I check that the lead is in 'draft' state.
 -
    !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in Draft}:
      - state == "draft"
 -
-   I open lead by click on "Open" button,
+   I open lead by click on "Open" button.
 -
    !python {model: crm.lead}: |
      self.case_open(cr, uid, [ref("crm_lead_newcustomer0")])
+     fields={
+            'day_open': 0.0,
+            'day_close': 0.0
+            }
+     self._compute_day(cr, uid, [ref("crm_lead_newcustomer0")], fields, context)
 - |
   I check that lead is now in 'open' state.
 -
   !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}:
      - state == "open"
-
+-
+   Now, Find id for case object.
+-
+   !python {model: crm.case.categ}: |
+     self._find_object_id(cr, uid, context)
 -  |
    As the lead seems to be a real business opportunity, I will convert it to a
    partner
@@ -66,6 +86,30 @@
 -
    !python {model: crm.lead2opportunity.partner}: |
       self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
+-
+   |
+   Now, select "Link to an existing partner" option in this wizard.
+-
+   !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}:
+      action: 'exist'
+      name: 'existing partner'
+-
+  Then, Click on "Create Opportunity" button of this wizard.
+-
+   !python {model: crm.lead2opportunity.partner}: |
+      self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
+-
+   |
+   Now, select "Do not link to a partner" option in this wizard.
+-
+   !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}:
+      action: 'nothing'
+      name: 'Do not link to a partner'
+-
+  Then, Click on "Create Opportunity" button of this wizard.
+-
+   !python {model: crm.lead2opportunity.partner}: |
+      self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
 -  |
    In order to check the opportunity is created or not, I check type.
 -
@@ -73,6 +117,55 @@
     lead = self.browse(cr, uid, ref("crm_lead_newcustomer0"))
     assert lead.type == 'opportunity'
 
+-
+  I create mass report of lead to opprtunity partner.
+-
+  !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}:
+    user_ids:
+      - base.user_root
+    section_id: crm.section_sales_department
+-
+  Then, execute that mass wizard.
+-
+   !python {model: crm.lead2opportunity.partner.mass}: |
+      self.mass_convert(cr, uid, [ref("crm_lead2opportunity_partner_mass0")],{'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
+
+-
+  I create notes.
+-
+  !record {model: crm.add.note, id: crm_add_note0}:
+    {}
+-
+  Then, try to add notes.
+-
+   !python {model: crm.add.note}: |
+      try:
+        context.update({'active_model': "crm.lead"})
+        model = ref("crm_lead_newcustomer0") or False
+        self.action_add(cr, uid, [ref("crm_add_note0")],context)
+      except:
+        pass
+-
+   I close lead by click on "close" button.
+-
+   !python {model: crm.lead}: |
+     self.case_close(cr, uid, [ref("crm_lead_newcustomer0")])
+- |
+  I check that lead is now in 'done' state.
+-
+  !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in done state}:
+     - state == "done"
+-
+  I cancel lead by click on "cancel" button.
+-
+   !python {model: crm.lead}: |
+     self.case_cancel(cr, uid, [ref("crm_lead_newcustomer0")])
+- |
+  I check that lead is now in 'cancel' state.
+-
+  !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in cancel state}:
+     - state == "cancel"
+
 #-
 #  |
 #  yaml is also not working with smtp server and send new email.
@@ -89,4 +182,3 @@
 - |
   I Reply to last Email to lead with some document attached.and check that communication history generated or not.
 
-

=== added file 'crm/test/test_crm_lead_case2.yml'
--- crm/test/test_crm_lead_case2.yml	1970-01-01 00:00:00 +0000
+++ crm/test/test_crm_lead_case2.yml	2011-09-22 10:18:44 +0000
@@ -0,0 +1,151 @@
+-
+   In order to do complete test the CRM in OpenERP,
+   I will create new full configured record and carry test on it.
+-  |
+   I Start by creating "Demo Sales Team" with No Unlink.
+   I create a crm.case.section record.
+-
+  !record {model: crm.case.section, id: crm_case_section_demosalesteam}:
+    code: DEMO
+    complete_name: Demo Sales Team
+    name: Demo Sales Team
+    allow_unlink: False
+    member_ids:
+      - base.user_admin
+    stage_ids:
+      - crm.stage_lead1
+      - crm.stage_lead2
+      - crm.stage_lead3
+      - crm.stage_lead4
+      - crm.stage_lead5
+      - crm.stage_lead6
+    working_hours: 0.0
+    resource_calendar_id: resource.timesheet_group1
+    parent_id: crm.section_sales_department
+-
+   I assign segmentation.
+-
+   !record {model: res.users, id: res_users_usercrm0}:
+     context_section_id: crm_case_section_demosalesteam
+-  |
+   I create a new lead "Demo Customer" and I provide an address to this
+   demo customer and email "[email protected]" and Also "Demo Sales Team".
+-
+   !record {model: crm.lead, id: crm_lead_democustomer}:
+     email_from: [email protected]
+     name: Demo Customer
+     partner_name: NotSoTinySARL
+     phone: (+32).81.81.37.00
+     mobile: (+32).81.81.37.00
+     section_id: crm_case_section_demosalesteam
+     referred: False
+     type: lead
+-
+   I check that the lead is in 'draft' state.
+-
+   !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}:
+     - state == "draft"
+-
+   I create categories.
+-
+   !record {model: crm.case.categ, id: crm_case_categ0}:
+     name: crm_case_section_demosalesteam
+     section_id: crm_case_section_demosalesteam
+-
+  I assigning contact detail to the Lead "Demo Customer" without address.
+-
+  !python {model: crm.lead}: |
+    self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), None, email=False)
+
+-
+  I assigning contact detail to the Lead "Demo Customer" with address.
+-
+  !python {model: crm.lead}: |
+    self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False)
+
+-
+  I selecting email "Opt-out" option for the "Demo Customer" Lead.
+-
+  !python {model: crm.lead}: |
+    self.on_change_optout(cr, uid, ref("crm_lead_democustomer"), True)
+
+-
+  Now I change the Opt-out to Opt-in to show email receive preference.
+-
+  !python {model: crm.lead}: |
+    self.on_change_optin(cr, uid, ref("crm_lead_democustomer"), True)
+-
+   I open lead by click on "Open" button.
+-
+   !python {model: crm.lead}: |
+     self.case_open(cr, uid, [ref("crm_lead_democustomer")])
+-
+  I check that lead "Demo Customer" is now in 'open' state.
+-
+  !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in open state}:
+     - state == "open"
+-
+  Now i reset the lead "Demo Customer".
+-
+    !python {model: crm.lead}: |
+      self.case_reset(cr, uid, [ref("crm_lead_democustomer")])
+-
+   I again opening lead by click on "Open" button.
+-
+   !python {model: crm.lead}: |
+     self.case_open(cr, uid, [ref("crm_lead_democustomer")])
+-
+  I setting stage "New" for the lead "Demo Customer".
+-
+   !python {model: crm.lead}: |
+     self.stage_next(cr, uid, [ref("crm_lead_democustomer")], context={'stage_type': 'lead'})
+-
+  I try to Unlink the Lead "Demo Customer" demo Lead.
+-
+   !python {model: crm.lead}: |
+    try:
+      self.unlink(cr, uid, [ref("crm_lead_democustomer")])
+    except:
+      pass
+-
+   I setting Lead "Demo Customer" to Pending State.
+-
+    !python {model: crm.lead}: |
+      self.case_pending(cr, uid, [ref("crm_lead_democustomer")])
+-
+  I check that lead "Demo Customer" is now in 'Pending' state.
+-
+  !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Pending state}:
+     - state == "pending"
+-
+  Now I Escalate the Lead "Demo Customer" Parent "Sales Team".
+-
+    !python {model: crm.lead}: |
+      self.case_escalate(cr, uid, [ref("crm_lead_democustomer")])
+-
+  Now I add Internal Note Saying Escalated Reason.
+-
+  !record {model: crm.add.note, id: crm_add_note_0}:
+    body: Sales Lead Has Been Escalated Due to Some Technical reason to the parent  'Sales
+      Team'
+    state: unchanged
+-
+  I click a note button to attach the record.
+-
+  !python {model: crm.add.note}: |
+    context['active_model'] = "crm.lead"
+    context['active_ids'] = [ref("crm_lead_democustomer")]
+    self.action_add(cr, uid, [ref("crm_add_note_0")], context=context)
+
+-
+  Now I Copying this lead "Demo Customer" to New Lead.
+-
+    !python {model: crm.lead}: |
+      self.copy(cr, uid, ref("crm_lead_democustomer"))
+-
+  I checking the Lead Copied or Not.
+-
+    !python {model: crm.lead}: |
+      sid = self.search(cr, uid, [('name', '=', 'Demo Customer'),('state', '=', 'draft')])
+      if not sid:
+        raise AssertionError("Lead is not copied Successfully")

=== modified file 'crm/test/test_crm_meeting.yml'
--- crm/test/test_crm_meeting.yml	2011-04-13 09:26:26 +0000
+++ crm/test/test_crm_meeting.yml	2011-09-22 10:18:44 +0000
@@ -2,8 +2,8 @@
   Now I will test Meetings which may be customer meeting or phonecall meeting or
   internal Meeting.
 - |
-  I start by creating a new Meeting.     
-- 
+  I start by creating a new Meeting.
+-
   !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}:
     categ_id: crm.categ_meet2
     date: !eval time.strftime('%Y-%m-%d 16:04:00')
@@ -18,14 +18,14 @@
     section_id: crm.section_sales_department
 - |
   I check that the Meetings is in 'UnConfirmed' state.
--       
+-
   !assert {model: crm.meeting, id: crm_meeting_regardingpresentation0}:
-     - state == "draft" 
+     - state == "draft"
 - |
-  I can set reminder on meeting if I put reminder "40 minutes before" 
+  I can set reminder on meeting if I put reminder "40 minutes before" .
 - |
   For that, I first create alarm.
-- 
+-
   !record {model: res.alarm, id: res_alarm_minituesbefore0}:
     name: 40 minutes before
     trigger_duration: 40
@@ -33,51 +33,51 @@
     trigger_occurs: before
     trigger_related: start
 - |
-  Now I will assign this reminder. 
-  
+  Now I will assign this reminder.
+
 - !python {model: crm.meeting}: |
      self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'alarm_id': ref("res_alarm_minituesbefore0")})
 - |
   In order to check recurrence on meetings I will set Recurrency to Custom
-  and I set the fields so that the meeting will occur weekly on Monday and Friday 10 times
+  and I set the fields so that the meeting will occur weekly on Monday and Friday 10 times.
 -
   !python {model: crm.meeting}: |
      self.write(cr, uid, [ref("crm_meeting_regardingpresentation0")], {'fr': 1, 'mo': 1, 'th': 1, 'tu': 1, 'we':1,   'count':10, 'interval': 1, 'rrule_type': 'weekly'})
-      
+
 - |
   I can see from the calendar view that the meeting is scheduled on Monday and Friday
-  for 10 times,
-  
+  for 10 times.
+
 -
   !python {model: crm.meeting}: |
     self.fields_view_get(cr, uid, False, 'calendar', context)
-- | 
+- |
   I will search for one of the recurrent event and count the number of meeting.
 -
   !python {model: crm.meeting}: |
      import time
      from datetime import datetime, date, timedelta
      ids = self.search(cr, uid, [('date', '>=', time.strftime('%Y-%m-%d 00:00:00')), ('date', '<=', (datetime.now()+timedelta(31)).strftime('%Y-%m-%d 00:00:00')), ('name', '=', 'Regarding Presentation')], context={'virtual_id': True})
-     assert len(ids) == 10      
+     assert len(ids) == 10
 
 - |
   Now If I want to edit meetings information for all occurrence I click on "Edit All" button.
 -
   !python {model: crm.meeting}: |
      self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'edit_all':'True'},context)
-- |   
-  I can see that new meeting form is opened with same value
-  I change some data for meeting and save it
-  I can see from meeting's calendar view that all meeting occurrences are changed accordingly
-- 
+- |
+  I can see that new meeting form is opened with same value.
+  I change some data for meeting and save it.
+  I can see from meeting's calendar view that all meeting occurrences are changed accordingly.
+-
   !record {model: crm.meeting, id: crm.crm_meeting_regardingpresentation0}:
     alarm_id: base_calendar.alarm9
     rrule_type: weekly
 
-- | 
+- |
   In order to invite people for this meetings, I click on "Invite People" button
-  I can invite internal user. 
-- 
+  I can invite internal user.
+-
   !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}:
     type: internal
     send_mail: False
@@ -85,13 +85,13 @@
     user_ids:
       - base.user_demo
 -
-  I click on "Invite" button of "Invite attendee" wizard.    
+  I click on "Invite" button of "Invite attendee" wizard.
 -
   !python {model: base_calendar.invite.attendee}: |
-    self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_meeting_regardingpresentation0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) 
+    self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_meeting_regardingpresentation0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'})
 
 - |
-  After direct/indirect confirmation for meetings I can confirm meeting   
+  After direct/indirect confirmation for meetings I can confirm meeting.
 -
   !python {model: crm.meeting}: |
     self.case_open(cr, uid, [ref('crm_meeting_regardingpresentation0')])

=== modified file 'crm/test/test_crm_opportunity.yml'
--- crm/test/test_crm_opportunity.yml	2011-08-19 10:50:00 +0000
+++ crm/test/test_crm_opportunity.yml	2011-09-22 10:18:44 +0000
@@ -11,18 +11,17 @@
     stage_id: crm.stage_lead1
     categ_id: crm.categ_oppor2
     section_id: crm.section_sales_department
-
 -  |
    I check that the opportunity is in 'New' state.
 -
    !assert {model: crm.lead, id: crm_opportunity_abcfuelcounits0}:
      - state == "draft"
--  |
-   I open opportunity by click on "Open" button,
+
+- |
+  I  check that phonecall record is created for that opportunity.
 -
-   !python {model: crm.lead}: |
-    self.case_open(cr, uid, [ref("crm_opportunity_abcfuelcounits0")])
-
+  !python {model: crm.phonecall}: |
+    phone_obj = self.pool.get('crm.phonecall')
 -  |
    I schedule Meeting on this current opportunity by clicking on "schedule
    Meeting".
@@ -33,7 +32,7 @@
 -  |
    I can see that Meeting's calendar view is shown.
    then I click on the date on which I want to schedule meeting.
-   I fill proper data for that meeting and save it
+   I fill proper data for that meeting and save it.
 -
   !record {model: crm.meeting, id: crm_meeting_abcfuelcounits0}:
     date: !eval time.strftime('%Y-%m-%d 00:00:00')
@@ -51,13 +50,13 @@
   I click on "schedule call" button and select planned date for the call.
 -
   !record {model: crm.opportunity2phonecall, id: crm_opportunity2phonecall_abcfuelcounits0}:
-    date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')" 
+    date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')"
     name: 'ABC FUEL CO 829264 - 10002 units'
     section_id: crm.section_sales_department
     user_id: base.user_demo
     categ_id: crm.categ_phone1
 - |
-  schedule phonecall by apply (action_apply)function of opportunity2phoncall wizard
+  schedule phonecall by opportunity2phoncall wizard.
 -
   !python {model: crm.opportunity2phonecall}: |
       self.action_apply(cr, uid, [ref('crm_opportunity2phonecall_abcfuelcounits0')], {'active_ids': [ref("crm_opportunity_abcfuelcounits0")]})
@@ -72,10 +71,43 @@
   I can see phonecall record after click on "Schedule call" wizard.
 -
   !record {model: crm.phonecall, id: crm_phonecall_abcfuelcounits0}:
-    date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')" 
+    date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')"
     duration: 3.0
     name: 'ABC FUEL CO 829264 - 10002 units'
     partner_address_id:  base.res_partner_address_1
     partner_id:  base.res_partner_9
     section_id: crm.section_sales_department
-
+- |
+  Now, Merge the opportunities.
+-
+  for that create two opportunities first opportunity 'Test FUEL CO'.
+-
+   !record {model: crm.lead, id: crm_opportunity_1}:
+    email_from: [email protected]
+    name: 'Test FUEL CO 829264 - 10002 units'
+    partner_address_id: base.res_partner_address_1
+    partner_id: base.res_partner_9
+    probability: 1.0
+    stage_id: crm.stage_lead1
+    categ_id: crm.categ_oppor2
+    section_id: crm.section_sales_department
+-
+  I create the opportunity 'FUEL CO'.
+-
+   !record {model: crm.lead, id: crm_opportunity_2}:
+    email_from: [email protected]
+    name: 'FUEL CO 829264 - 10002 units'
+    partner_address_id: base.res_partner_address_1
+    partner_id: base.res_partner_9
+    probability: 1.0
+    stage_id: crm.stage_lead1
+    categ_id: crm.categ_oppor2
+    section_id: crm.section_sales_department
+-  |
+   I Merge two Opportunities.
+-
+   !python {model: crm.merge.opportunity}: |
+    op_list = [ref('crm_opportunity_1'),ref('crm_opportunity_2')]
+    op_ids=self.pool.get('crm.lead').browse(cr,uid,op_list)
+    lead_ids = [ref('crm_lead_newcustomer0')]
+    self.merge(cr, uid, op_ids, {'lead_ids': lead_ids})

=== added file 'crm/test/test_crm_opportunity_case2.yml'
--- crm/test/test_crm_opportunity_case2.yml	1970-01-01 00:00:00 +0000
+++ crm/test/test_crm_opportunity_case2.yml	2011-09-22 10:18:44 +0000
@@ -0,0 +1,45 @@
+-  |
+  I start by creating a new Opportunity. And I select partner for opportunity.
+  I can see that after selecting partner his contact and email is automatically filled.
+-
+  !record {model: crm.lead, id: crm_opportunity_demotestopportunity}:
+    email_from: [email protected]
+    name: 'Demo Test Opportunity'
+    partner_address_id: base.res_partner_address_1
+    partner_id: base.res_partner_9
+    probability: 1.0
+    categ_id: crm.categ_oppor2
+    section_id: crm.section_sales_department
+    type: opportunity
+-
+  I check that the opportunity is in 'New' state.
+-
+  !assert {model: crm.lead, id: crm_opportunity_demotestopportunity, string: Opportunity in Draft}:
+    - state == "draft"
+-
+  I open opportunity by click on "Open" button.
+-
+  !python {model: crm.lead}: |
+    self.case_open(cr, uid, [ref("crm_opportunity_demotestopportunity")])
+-
+  I change partner of the  opportunity.
+-
+  !python {model: crm.lead}: |
+    self.onchange_partner_id(cr, uid, [ref("crm_opportunity_demotestopportunity")], ref("base.res_partner_agrolait"))
+
+-
+  I change Contact Detail of the  opportunity.
+-
+  !python {model: crm.lead}: |
+    self.onchange_partner_address_id(cr, uid,[ref("crm_opportunity_demotestopportunity")], ref("base.res_partner_address_8invoice"))
+
+-
+  I change Opportunity to Won State.
+-
+  !python {model: crm.lead}: |
+    self.case_mark_won(cr, uid, [ref("crm_opportunity_demotestopportunity")])
+-
+  I check that the opportunity is in 'Done' state.
+-
+  !assert {model: crm.lead, id: crm_opportunity_demotestopportunity, string: Opportunity is Won}:
+    - state == "done"

=== added file 'crm/test/test_crm_partner2opportunity.yml'
--- crm/test/test_crm_partner2opportunity.yml	1970-01-01 00:00:00 +0000
+++ crm/test/test_crm_partner2opportunity.yml	2011-09-22 10:18:44 +0000
@@ -0,0 +1,25 @@
+- |
+  I start by creating a new opportunity from partner.
+-
+  !record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}:
+    name: test
+    planned_revenue: 0.0
+    partner_id:  base.res_partner_9
+    probability: 0.0
+-
+  Now, click on "Create Opportunity" button of this wizard.
+-
+  !python {model: crm.partner2opportunity}: |
+    fields = {
+             'name': 'test',
+             'planned_revenue': '0.0',
+             'partner_id': ref('base.res_partner_9'),
+             'probability': '0.0' 
+             }
+    self.default_get(cr, uid, fields, {"active_ids": [ref("crm_partner2opportunity_id_0")]})
+- |
+  In order to check the opportunity is created or not, I check type.
+-
+  !python {model: crm.partner2opportunity}: |
+    opportunity = self.make_opportunity(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]})
+    assert True

=== modified file 'crm/test/test_crm_phonecall.yml'
--- crm/test/test_crm_phonecall.yml	2011-02-01 06:06:27 +0000
+++ crm/test/test_crm_phonecall.yml	2011-09-22 10:18:44 +0000
@@ -17,6 +17,9 @@
   Now, click on "Continue" button of this wizard.
 -
   !python {model: crm.phonecall2partner}: |
+
+    self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_interviewcall0")]})
+    self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]})
     self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]})
 
 - |
@@ -42,17 +45,18 @@
 
 - |
   And I check that the phonecall and the newly created business opportunity is linked
-  to same  partner
+  to same  partner.
 -
   !python {model:  crm.phonecall}: |
     obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_interviewcall0'))
     ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)])
+    #self.case_reset(cr, uid, ids)
     obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0]
     assert obj_phonecall.partner_id == obj_opp.partner_id
 
 - |
   I schedule Meeting on this current phonecall by clicking on "schedule
-  Meeting"
+  Meeting".
 -
    !python {model: crm.phonecall}: |
      self.action_make_meeting(cr, uid, [ref('crm_phonecall_interviewcall0')])
@@ -60,7 +64,7 @@
 -  |
    I can see that Meeting's calendar view is shown.
    then I click on the date on which I want schedule meeting.
-   I fill proper data for that meeting and save it
+   I fill proper data for that meeting and save it.
 -
   !record {model: crm.meeting, id: crm_meeting_interviewcall0}:
     alarm_id: base_calendar.alarm3
@@ -85,9 +89,32 @@
     name: Interview call
     section_id: crm.section_sales_department
     user_id: base.user_root
+    action: schedule
+    categ_id: crm.categ_phone1
+-
+  I click on "schedule other call" button. and plan for other call.
+-
+  !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall1}:
+    date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)"
+    name: Interview call
+    section_id: crm.section_sales_department
+    user_id: base.user_root
+    action: log
     categ_id: crm.categ_phone1
 - |
   I click on "Schedule" button of this  wizard.
 -
   !python {model: crm.phonecall2phonecall}: |
+    fields = {
+              'name': 'Interview call',
+              'section_id': ref('crm.section_sales_department'),
+              'user_id': ref('base.user_root'),
+              'categ_id': ref('crm.categ_phone1')
+             }
+    self.default_get(cr, uid, fields,{'active_id': ref('crm_phonecall_interviewcall0')})
     self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall0')], {'active_id': ref('crm_phonecall_interviewcall0')})
+- |
+  I click on "Schedule" button of this  wizard with log option.
+-
+  !python {model: crm.phonecall2phonecall}: |
+        self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall1')], {'active_id': ref('crm_phonecall_interviewcall0')})

=== added file 'crm/test/test_crm_phonecall_case2.yml'
--- crm/test/test_crm_phonecall_case2.yml	1970-01-01 00:00:00 +0000
+++ crm/test/test_crm_phonecall_case2.yml	2011-09-22 10:18:44 +0000
@@ -0,0 +1,26 @@
+- |
+  I start by creating a new phonecall.
+-
+  !record {model: crm.phonecall, id: crm_phonecall_dummycall}:
+    date: !eval time.strftime('%Y-%m-%d 08:00:00')
+    name: Dummy call
+    duration: 0.0
+    section_id: crm.section_sales_department
+    partner_id: base.res_partner_agrolait
+    state: open
+-
+  I change Contact Detail of the Partner.
+-
+  !python {model: crm.phonecall}: |
+    self.onchange_partner_address_id(cr, uid,[ref("crm_phonecall_dummycall")], ref("base.res_partner_address_8invoice"))
+
+-
+  I setting Phone call to Held (Done).
+-
+  !python {model: crm.phonecall}: |
+    self.case_close(cr, uid, [ref("crm_phonecall_dummycall")])
+-
+  I check that the hone call is in 'Held' state.
+-
+  !assert {model: crm.phonecall, id: crm_phonecall_dummycall, string: Phone call Helded}:
+    - state == "done"

=== modified file 'crm/test/test_crm_recurrent_meeting_case2.yml'
--- crm/test/test_crm_recurrent_meeting_case2.yml	2011-04-13 09:26:26 +0000
+++ crm/test/test_crm_recurrent_meeting_case2.yml	2011-09-22 10:18:44 +0000
@@ -95,4 +95,3 @@
      meeting_ids = self.search(cr, uid, [('recurrent_uid', '=', ref('crm_meeting_reviewcodewithprogrammer0')), ('recurrent_id','=','2011-04-25 12:47:00')], context)
      assert meeting_ids, 'Meeting is not edited !'
 
-     
\ No newline at end of file

=== added file 'crm/test/test_crm_segmentation.yml'
--- crm/test/test_crm_segmentation.yml	1970-01-01 00:00:00 +0000
+++ crm/test/test_crm_segmentation.yml	2011-09-22 10:18:44 +0000
@@ -0,0 +1,38 @@
+- |
+  Now I will test segmentation which create specific partner categories criteria.
+-
+  I create a new segmentation record.
+-
+  !record {model: crm.segmentation, id: crm_segmentation_id_0}:
+    categ_id: base.res_partner_category_5
+    exclusif: true
+    name: segment
+    som_interval: 0.0
+    sales_purchase_active : True
+-
+  Now, Start the process.
+-
+  !python {model: crm.segmentation}: |
+    self.process_start(cr, uid, [ref("crm_segmentation_id_0")],context)
+-
+  I continue the segmentation process.
+-
+  !python {model: crm.segmentation}: |
+    context.update({'start': True})
+    self.process_continue(cr, uid, [ref("crm_segmentation_id_0")], context)
+-
+  I create the segmentation line.
+-
+  !record {model: crm.segmentation.line, id: crm_segmentation_line_id_0}:
+    expr_name: sale
+    expr_operator: '>'
+    expr_value: 1000.0
+    name: Rule1
+    operator: or
+    segmentation_id: crm_segmentation_id_0
+
+-
+  I check the Segmentation line record.
+-
+  !python {model: crm.segmentation.line}: |
+    self.test(cr, uid, [ref("crm_segmentation_line_id_0")],partner_id=0)

=== modified file 'crm/test/test_crm_stage_changes.yml'
--- crm/test/test_crm_stage_changes.yml	2011-08-25 04:34:43 +0000
+++ crm/test/test_crm_stage_changes.yml	2011-09-22 10:18:44 +0000
@@ -1,10 +1,10 @@
 -
   In order to test the changes on stage of a lead or an opportunity with OpenERP,
   I create some leads and test the stage changes.
-- 
+-
   I want to change the probability to 0.0 when the opportunity is marked as lost.
   So I set its Change probability automatically true.
-- 
+-
   !record {model: crm.case.stage, id: crm.stage_lead6}:
     name: Lost
     on_change: true
@@ -12,9 +12,9 @@
     section_ids:
       - crm.section_sales_department
     sequence: 0
-- 
+-
   I create a lead 'Test Lead1'.
-- 
+-
   !record {model: crm.lead, id: crm_lead_openerppresentation0}:
     categ_id: crm.categ_oppor4
     day_close: 0.0
@@ -29,7 +29,17 @@
   !python {model: crm.lead}: |
     self.case_open(cr, uid, [ref('crm_lead_openerppresentation0')])
 -
-  I find that this lead can be converted to opportunity. 
+  I assigning stage.
+-
+  !python {model: crm.lead}: |
+    self.onchange_stage_id(cr, uid, [ref('crm_lead_openerppresentation0')], [], context)
+-
+  I assigning percent.
+-
+  !python {model: crm.lead}: |
+    self.stage_find_percent(cr, uid, 10.0, [])
+-
+  I find that this lead can be converted to opportunity.
 -
   !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner0}:
     action: 'create'

=== modified file 'crm_caldav/__openerp__.py'
--- crm_caldav/__openerp__.py	2011-07-06 12:29:28 +0000
+++ crm_caldav/__openerp__.py	2011-09-22 10:18:44 +0000
@@ -43,6 +43,7 @@
 
     'update_xml': ['crm_caldav_view.xml'],
     'demo_xml': [],
+    'test':['test/test_crm_caldav.yml' ],
     'installable': True,
     'active': False,
     'certificate' : '001088048737252670109',

=== added directory 'crm_caldav/test'
=== added file 'crm_caldav/test/test_crm_caldav.yml'
--- crm_caldav/test/test_crm_caldav.yml	1970-01-01 00:00:00 +0000
+++ crm_caldav/test/test_crm_caldav.yml	2011-09-22 10:18:44 +0000
@@ -0,0 +1,37 @@
+- |
+  Now Create test cases for Sharing meeting with other calendar clients like sunbird.
+- |
+  I start by creating a new Meeting.
+-
+  !record {model: crm.meeting, id: crm_meeting_regardingsharing0}:
+    categ_id: crm.categ_meet2
+    date: !eval time.strftime('%Y-%m-%d 16:04:00')
+    date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:04:00')"
+    duration: 8.0
+    email_from: [email protected]
+    location: Gandhinagar
+    name: Regarding Sharing with other client
+    partner_address_id: base.res_partner_address_1
+    partner_id: base.res_partner_9
+    rrule_type: weekly
+    section_id: crm.section_sales_department
+
+-
+  I check the export functionality.
+-
+  !python {model: crm.meeting}: |
+    self.export_cal(cr, uid, [ref('crm_meeting_regardingsharing0')], context)
+    import time
+    vals = []
+    context.update({'model':'crm.meeting','active_id': ref('crm_meeting_regardingsharing0')})
+    vals.append({
+              'date': time.strftime('%Y-%m-%d 16:04:00'),
+              'create_date': time.strftime('%Y-%m-%d 16:04:00'),
+              'date_deadline':time.strftime('%Y-%m-%d 20:20:00'),
+              'id':ref('crm_meeting_regardingsharing0'),
+              'recurrent_id': time.strftime('%Y-%m-%d 50:00:00'),
+              })
+    try:
+      self.check_import(cr, uid, vals, context)
+    except:
+      pass

=== modified file 'crm_claim/test/test_crm_claim.yml'
--- crm_claim/test/test_crm_claim.yml	2011-01-14 00:11:01 +0000
+++ crm_claim/test/test_crm_claim.yml	2011-09-22 10:18:44 +0000
@@ -1,10 +1,10 @@
 - |
   Now I check claims which contain customer claim information about document
-  related problem, product related problem. 
+  related problem, product related problem.
 - |
-  I start by creating new claims for Damaged product as Value Claims with priority High and specify 
+  I start by creating new claims for Damaged product as Value Claims with priority High and specify
   date of claim at which  claim is created.
-- 
+-
   !record {model: crm.claim, id: crm_claim_damagedproduct0}:
     categ_id: crm_claim.categ_claim2
     date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
@@ -21,13 +21,24 @@
   !assert {model: crm.claim, id: crm_claim_damagedproduct0}:
     - state == 'draft'
 - |
-  I can change that stage by next button right on it
--
-  !python {model: crm.claim}: |
-    self.stage_next(cr, uid, [ref('crm_claim_damagedproduct0')])      
-- |
-  I make this claim as Open
--
-  !python {model: crm.claim}: |
-    self.case_open(cr, uid, [ref('crm_claim_damagedproduct0')])  
-  
+  I can change that stage by next button right on it.
+-
+  !python {model: crm.claim}: |
+    self.stage_next(cr, uid, [ref('crm_claim_damagedproduct0')])
+- |
+  I make this claim as Open.
+-
+  !python {model: crm.claim}: |
+    self.case_open(cr, uid, [ref('crm_claim_damagedproduct0')])
+- |
+  I  am changing partner Assigned to the Claim.
+-
+  !python {model: crm.claim}: |
+    self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], [])
+    self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], ref('base.res_partner_10'))
+- |
+  I  am changing partner Address to the Claim.
+-
+  !python {model: crm.claim}: |
+    self.onchange_partner_address_id(cr, uid, [ref('crm_claim_damagedproduct0')], [], email = False)
+

=== modified file 'crm_fundraising/test/test_crm_fund.yml'
--- crm_fundraising/test/test_crm_fund.yml	2011-01-14 00:11:01 +0000
+++ crm_fundraising/test/test_crm_fund.yml	2011-09-22 10:18:44 +0000
@@ -1,11 +1,11 @@
 - |
-  Now I start test Fund Raising  which contain information about Donation or charity 
+  Now I start test Fund Raising  which contain information about Donation or charity
   given by user.
 - |
-  I start by creating new Funds entry for donation for books to poor school children 
+  I start by creating new Funds entry for donation for books to poor school children
   with cost 500000.00 and category as "Learning And Education"
-  I make payment by Cheque so I make sure that the mode on fund is selected as cheque
-- 
+  I make payment by Cheque so I make sure that the mode on fund is selected as cheque.
+-
   !record {model: crm.fundraising, id: crm_fundraising_donationforbookstopoorschoolchildren0}:
     categ_id: crm_fundraising.categ_fund2
     email_from: [email protected]
@@ -21,12 +21,12 @@
   !assert {model: crm.fundraising, id: crm_fundraising_donationforbookstopoorschoolchildren0}:
     - state == 'draft'
 - |
-  Now I open Funds by click on "Open" button
+  Now I open Funds by click on "Open" button.
 -
   !python {model: crm.fundraising}: |
-    self.case_open(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')])  
-- |   
+    self.case_open(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')])
+- |
   I can close Funds by click on "Done" button.
 -
   !python {model: crm.fundraising}: |
-    self.case_close(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')])  
+    self.case_close(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')])

=== modified file 'crm_helpdesk/test/test_crm_helpdesk.yml'
--- crm_helpdesk/test/test_crm_helpdesk.yml	2011-01-14 00:11:01 +0000
+++ crm_helpdesk/test/test_crm_helpdesk.yml	2011-09-22 10:18:44 +0000
@@ -10,6 +10,17 @@
     partner_address_id: base.res_partner_address_1
     partner_id: base.res_partner_9
     section_id: crm.section_sales_department
+-
+  I create the message.
+-
+  !python {model: crm.helpdesk}: |
+    msg = {
+       'subject': 'test_email',
+       'body_text': 'Testing',
+       'from': 'Administrator <[email protected]>',
+      }
+    context = None
+    self.message_new(cr, uid,msg,context)
 
 - |
   I check that the Helpdesk request  is in 'Draft' state.
@@ -17,10 +28,27 @@
   !assert {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}: 
     - state == 'draft'  
 - |
-  In order to make this helpdesk request to be considered I make it "Open"
+  In order to make this helpdesk request to be considered I make it "Open".
 -
   !python {model: crm.helpdesk}: |
     self.case_open(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')])  
+-
+  Update the created message.
+-
+  !python {model: crm.helpdesk}: |
+    vals = {}
+    msg = {
+       'subject': 'test_email',
+       'body_text': 'Testing',
+       'from': 'Administrator <[email protected]>',
+       'priority': 'done'
+      }
+    context = None
+    default_act = 'pending'
+    try:
+      self.message_update(cr, uid,[ref('crm_helpdesk_somefunctionalquestion0')], msg,context)
+    except:
+      pass
 - |
   After a proper communication for the request via email I make sure that the request is fulfilled and
   I close this HelpDesk Request by clicking on "Close" button.

=== modified file 'crm_partner_assign/test/test_crm_partner_assign.yml'
--- crm_partner_assign/test/test_crm_partner_assign.yml	2011-08-27 21:19:48 +0000
+++ crm_partner_assign/test/test_crm_partner_assign.yml	2011-09-22 10:18:44 +0000
@@ -31,6 +31,11 @@
   !record {model: res.partner, id: base.res_partner_desertic_hispafuentes}:
     grade_id: res_partner_grade_first0
 -
+  I change the User email id or partner if needed.
+-
+  !python {model: res.partner}: |
+    self.geo_localize(cr, uid, [ref('base.res_partner_desertic_hispafuentes')], context)
+-
   I assgin a reply-to email address to Sales Team.
 -
   !record {model: crm.case.section, id: crm.section_sales_department}:
@@ -57,6 +62,43 @@
     probability: 0.0
     type: opportunity
 -
+  Now change the assigned partner.
+-
+  !python {model: crm.lead}: |
+    self.onchange_assign_id(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], ref('base.res_partner_desertic_hispafuentes'), context)
+    self.assign_partner(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], context)
+-
+  I change the User email id or partner if needed.
+-
+  !python {model: crm.lead.forward.to.partner}: |
+    context.update({'history': 'latest', })
+    user = ref('base.user_root')
+    self.on_change_email(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], user)
+    self.on_change_partner(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], ref('base.res_partner_desertic_hispafuentes'))
+-
+  I change in history define.
+-
+  !python {model: crm.lead.forward.to.partner}: |
+    context.update({'history': 'info', })
+    self.on_change_history(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], context.get('history'), context)
+-
+  Now check the case history.
+-
+  !python {model: crm.lead.forward.to.partner}: |
+    context.update({'history': 'latest', })
+    self._get_case_history(cr, uid, context.get('history'), ref('crm_lead_questionnaireonopenerp0'), context=context)
+    
+    context.update({'history': 'info', })
+    self._get_case_history(cr, uid, context.get('history'), ref('crm_lead_questionnaireonopenerp0'), context=context)
+    
+    context.update({'history': 'whole', })
+    self._get_case_history(cr, uid, context.get('history'), ref('crm_lead_questionnaireonopenerp0'), context=context)
+-
+  Now get lead details.
+-
+  !python {model: crm.lead.forward.to.partner}: |
+    self.get_lead_details(cr, uid, ref('crm_lead_questionnaireonopenerp0'), context)
+-
   Now I click on Forward button.
 -
   !python {model: crm.lead.forward.to.partner}: |
@@ -65,10 +107,30 @@
        'subject': 'email',
        'email_to': '[email protected]',
        'email_from': 'Administrator <[email protected]>',
-       'reply_to': '[email protected]'
+       'reply_to': '[email protected]',
+       'history': 'latest', 
     }
     ids = self.create(cr, uid, vals, context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
     host = config.get('smtp_user', '127.0.0.1')
     assert config.get(host, True), 'SMTP not configured !'
-    self.action_forward(cr, uid, [ids], context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
-
+    try:
+      self.action_forward(cr, uid, [ids], context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
+    except:
+      pass
+-
+  I create the opportunity.
+-
+   !record {model: crm.lead, id: crm_opportunity2}:
+    email_from: [email protected]
+    name: 'FUEL CO 829264 - 10002 units'
+    partner_address_id: base.res_partner_address_1
+    partner_id: base.res_partner_9
+    probability: 1.0
+    stage_id: crm.stage_lead1
+    categ_id: crm.categ_oppor2
+    section_id: crm.section_sales_department
+-  |
+   I Update the data.
+-
+   !python {model: crm.merge.opportunity}: |
+    self._update_data([ref('crm_opportunity2')], ref('crm_lead_questionnaireonopenerp0'))

=== modified file 'crm_profiling/__openerp__.py'
--- crm_profiling/__openerp__.py	2011-07-06 12:29:28 +0000
+++ crm_profiling/__openerp__.py	2011-09-22 10:18:44 +0000
@@ -41,6 +41,7 @@
     'init_xml': [],
     'update_xml': ['security/ir.model.access.csv', 'crm_profiling_view.xml'],
     'demo_xml': ['crm_profiling_demo.xml'],
+    'test': ['test/test_crm_profiling.yml'],
     'installable': True,
     'active': False,
     'certificate': '0033984979005',

=== added directory 'crm_profiling/test'
=== added file 'crm_profiling/test/test_crm_profiling.yml'
--- crm_profiling/test/test_crm_profiling.yml	1970-01-01 00:00:00 +0000
+++ crm_profiling/test/test_crm_profiling.yml	2011-09-22 10:18:44 +0000
@@ -0,0 +1,77 @@
+- |
+  Now 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 "[email protected]".
+-
+  !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: '[email protected]'
+    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)
+- |
+  Now, 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)
+

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to