Atik Agewan(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag into 
lp:openobject-addons.

Requested reviews:
  Atik Agewan(OpenERP) (aag-openerp)
  Harry (OpenERP) (hmo-tinyerp)
  Ujjvala Collins (OpenERP) (uco-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag/+merge/85486


  Hello,
  
   CRM: Improvements in ymls to increase Coverage.

  Thanks,
   Atik Agewan
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag/+merge/85486
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag.
=== modified file 'crm/__openerp__.py'
--- crm/__openerp__.py	2011-12-12 14:22:44 +0000
+++ crm/__openerp__.py	2011-12-16 06:59:24 +0000
@@ -123,6 +123,7 @@
             'test/process/lead2opportunity2win.yml',
             'test/process/merge_opportunity.yml',
             'test/process/cancel_lead.yml',
+            'test/process/action_rule.yml',
             'test/process/segmentation.yml',
             'test/ui/crm_demo.yml',
             'test/ui/duplicate_lead.yml',

=== modified file 'crm/crm_action_rule.py'
--- crm/crm_action_rule.py	2011-11-08 22:53:37 +0000
+++ crm/crm_action_rule.py	2011-12-16 06:59:24 +0000
@@ -125,7 +125,7 @@
         """Gets available states for crm"""
         res = super(base_action_rule, self).state_get(cr, uid, context=context)
         return res + crm.AVAILABLE_STATES
-
+    # Dead Code
     def priority_get(self, cr, uid, context=None):
         res = super(base_action_rule, self).priority_get(cr, uid, context=context)
         return res + crm.AVAILABLE_PRIORITIES

=== modified file 'crm/crm_phonecall.py'
--- crm/crm_phonecall.py	2011-11-23 06:28:13 +0000
+++ crm/crm_phonecall.py	2011-12-16 06:59:24 +0000
@@ -118,7 +118,7 @@
         """Resets case as Todo
         """
         res = super(crm_phonecall, self).case_reset(cr, uid, ids, args, 'crm.phonecall')
-        self.write(cr, uid, ids, {'duration': 0.0})
+        self.write(cr, uid, ids, {'duration': 0.0, 'state':'open'})
         return res
 
 

=== added file 'crm/test/process/action_rule.yml'
--- crm/test/process/action_rule.yml	1970-01-01 00:00:00 +0000
+++ crm/test/process/action_rule.yml	2011-12-16 06:59:24 +0000
@@ -0,0 +1,23 @@
+-
+  I create a record rule.
+-
+  !python {model: base.action.rule}: |
+    modle_id = self.pool.get("ir.model").search(cr, uid, [('name', '=', 'crm.lead')])
+    from datetime import datetime
+    new_id = self.create(cr, uid, {'name': 'New Rule', 'model_id': modle_id[0],  'trg_user_id': ref('base.user_root'), 'trg_partner_id': ref('base.res_partner_asus'), 'act_user_id': ref('base.user_demo') })
+    lead_obj = self.pool.get("crm.lead")
+    self._check(cr, uid)
+-
+  I create new lead to check record rule.
+-
+  !record {model: crm.lead, id: crm_lead_test_rules_id }:
+    name: 'test leads Ruels'
+    user_id: base.user_root
+    partner_id: base.res_partner_asus
+-
+  I check record rule is apply and responsible is changed.
+-
+  !python {model: crm.lead}: |
+    user = self.browse(cr, uid, ref('crm_lead_test_rules_id'))
+    demo_user = self.pool.get("res.users").browse(cr, uid, ref('base.user_demo'))
+    assert user.user_id.id == demo_user.id, "Responsible is Not changed." 

=== modified file 'crm/test/process/cancel_lead.yml'
--- crm/test/process/cancel_lead.yml	2011-11-02 06:53:28 +0000
+++ crm/test/process/cancel_lead.yml	2011-12-16 06:59:24 +0000
@@ -29,12 +29,12 @@
   !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in pending state}:
     - state == "pending"
 -
-  I Escalate the Lead to Parent Team.
+  I escalate the lead to parent team.
 -
   !python {model: crm.lead}: |
     self.case_escalate(cr, uid, [ref("crm_case_itisatelesalescampaign0")])
 -
-  I check lead escalate to Parent Team.
+  I check lead escalate to parent team.
 -
   !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Escalate lead to parent team}:
     - section_id.name == "Sales Department"

=== modified file 'crm/test/process/communication_with_customer.yml'
--- crm/test/process/communication_with_customer.yml	2011-11-23 11:44:59 +0000
+++ crm/test/process/communication_with_customer.yml	2011-12-16 06:59:24 +0000
@@ -1,5 +1,5 @@
 -
-  Customer interested in our product. so He send request by email to get more details.
+  Customer interested in our product. so he send request by email to get more details.
 -
   Mail script will be fetched him request from mail server. so I process that mail after read EML file 
 -
@@ -41,10 +41,12 @@
     partner_ids = self.message_partner_by_email(cr, uid, 'Mr. John Right <[email protected]>')
     assert partner_ids.get('partner_id'), "Customer is not found in regular customer list."
 -
-  I convert one phonecall request as a customer and put into regular customer list.
+  I convert one phonecall request as a customer and put into regular customer list. 
 -
-  !python {model: crm.phonecall}: |
-    self.convert_partner(cr, uid, [ref('crm.crm_case_phone06')], context=context)
+  !python {model: crm.phonecall2partner}: |
+    context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")], 'active_id': ref("crm.crm_case_phone06")})
+    new_id = self.create(cr, uid, {}, context=context)
+    self.make_partner(cr, uid, [new_id],  context=context)
 -
   I check converted phonecall to partner.
 -

=== modified file 'crm/test/process/lead2opportunity2win.yml'
--- crm/test/process/lead2opportunity2win.yml	2011-11-23 11:44:59 +0000
+++ crm/test/process/lead2opportunity2win.yml	2011-12-16 06:59:24 +0000
@@ -6,11 +6,19 @@
    !python {model: crm.lead}: |
      self.case_open(cr, uid, [ref("crm_case_qrecorp0")])
 - 
-  I check lead state is "Open".
+  I check lead state is "Open". 
 -
   !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}:
      - state == "open"
 -
+  I create partner from lead. 
+-
+  !record {model: crm.lead2partner, id: crm_lead2partner_id1, context: '{"active_model": "crm.lead", "active_ids": [ref("crm_case_qrecorp0")]}'}:
+-
+   !python {model: crm.lead2partner}: |
+     context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_qrecorp0')], 'active_id': ref('crm_case_qrecorp0')})
+     self.make_partner(cr, uid ,[ref("crm_lead2partner_id1")], context=context)
+-
   I convert lead into opportunity for exiting customer.
 -
   !python {model: crm.lead}: |
@@ -39,13 +47,13 @@
     ids = self.search(cr, uid, [('opportunity_id', '=', ref('crm_case_qrecorp0'))])
     assert len(ids), 'phonecall is not scheduled'
 -
-  Now I schedule Meeting with Customer.
+  Now I schedule meeting with customer.
 -
   !python {model: crm.lead}: |
     self.action_makeMeeting(cr, uid, [ref('crm_case_qrecorp0')])
 
 -
-  After communicated  with customer, I put some notes with Contract details.
+  After communicated  with customer, I put some notes with contract details.
 -
   !python {model: crm.add.note}: |
     context.update({'active_model': 'crm.lead', 'active_id': ref('crm_case_qrecorp0')})
@@ -57,7 +65,7 @@
   !python {model: crm.lead}: |
     self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")])
 -
-  I check details of the opportunity After won the opportunity.
+  I check details of the opportunity after won the opportunity.
 -
   !python {model: crm.lead}: |
     lead = self.browse(cr, uid, ref('crm_case_qrecorp0'))
@@ -72,7 +80,7 @@
     id = self.create(cr, uid, {'user_ids': [ref('base.user_root')], 'section_id': ref('crm.section_sales_department')}, context=context)
     self.mass_convert(cr, uid, [id], context=context)
 -
-  Now I check First lead converted on opportunity.
+  Now I check first lead converted on opportunity.
 -
   !python {model: crm.lead}: |
     opp = self.browse(cr, uid, ref('crm_case_employee0'))
@@ -81,10 +89,22 @@
     assert opp.partner_id.name == "Agrolait", 'Partner missmatch!'
     assert opp.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!'
 -
-  Then check for Second lead converted on opportunity.
+  Then check for second lead converted on opportunity.
 -
   !python {model: crm.lead}: |
     opp = self.browse(cr, uid, ref('crm_case_electonicgoodsdealer0'))
     assert opp.name == "Interest in Your New Product", "Opportunity name not correct"
     assert opp.type == 'opportunity', 'Lead is not converted to opportunity!'
-    assert opp.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!'
\ No newline at end of file
+    assert opp.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!'
+-
+  I confirm review needs meeting.
+-
+  !python {model: crm.meeting}: |
+    context.update({'active_model': 'crm.meeting'}) 
+    self.case_open(cr, uid, [ref('crm.crm_case_reviewneeds0')])
+-
+  I invite a user for meeting.
+-
+  !python {model: calendar.attendee}: |
+    meeting_id = self.create(cr, uid, {'user_id': ref('base.user_root'), 'email': '[email protected]' })
+    self.do_accept(cr, uid, [meeting_id])

=== modified file 'crm/test/process/merge_opportunity.yml'
--- crm/test/process/merge_opportunity.yml	2011-11-23 10:50:06 +0000
+++ crm/test/process/merge_opportunity.yml	2011-12-16 06:59:24 +0000
@@ -1,5 +1,5 @@
 -
-  I make direct opportunity for Customer.
+  I make direct opportunity for customer.
 -
   !python {model: crm.partner2opportunity}: |
     context.update({'active_model': 'res.partner', 'active_ids': [ref("base.res_partner_9")]})
@@ -9,17 +9,22 @@
   I make another opportunity from phonecall for same customer.
 -
   !python {model: crm.phonecall2opportunity}: |
-    context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")]})
+    context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")], 'active_id': ref("crm.crm_case_phone06")})
     res_id = self.create(cr, uid, {'name': "Quoi de prix de votre autre service?", 'partner_id': ref("base.res_partner_9")}, context=context)
     self.make_opportunity(cr, uid, [res_id], context=context)
 -
- Now I merge all opportunities of customer.
+  Now I merge all opportunities of customer.
 -
   !python {model: crm.lead}: |
     opportunity_ids = self.search(cr, uid, [('partner_id','=', ref("base.res_partner_9"))])
-    self.merge_opportunity(cr, uid, opportunity_ids, context=context)
--
-  I check for merged opportunities for customer.
+    context.update({'active_model': 'crm.lead', 'active_ids': opportunity_ids, 'active_id': opportunity_ids[0]})
+-
+  !record {model: crm.merge.opportunity, id: opportunity_merge_id }:
+-
+  !python {model: crm.merge.opportunity}: |
+    self.action_merge(cr, uid, [ref("opportunity_merge_id")], context=context)
+-
+  I check for merged opportunities for customer. 
 -
   !python {model: crm.lead}: |
     merge_id = self.search(cr, uid, [('partner_id','=', ref("base.res_partner_9"))])
@@ -31,21 +36,51 @@
   Now I schedule another phonecall to customer after merged.
 -
   !python {model: crm.phonecall2phonecall}: |
-    context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")]})
+    context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")], 'active_id': ref("crm.crm_case_phone06")})
     res_id = self.create(cr, uid, {'name': "vos chances sont fusionnés en un seul"}, context=context)
     self.action_schedule(cr, uid, [res_id], context=context)
 - 
-  I schedule Meeting on this phonecall.
+  I schedule meeting on this phonecall.
 -
   !python {model: crm.phonecall}: |
     self.action_make_meeting(cr, uid, [ref("crm.crm_case_phone06")])
 -
-  I setting Phone call to Held (Done).
+  I set phone call to not held.
+-
+  !python {model: crm.phonecall}: |
+    self.case_pending(cr, uid, [ref("crm.crm_case_phone06")])
+-
+  I check that the phone call is in 'Not Held' state. 
+-
+  !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call held.}:
+    - state == "pending"
+-
+  I cancelled the phone call. 
+-
+  !python {model: crm.phonecall}: |
+    self.case_cancel(cr, uid, [ref("crm.crm_case_phone06")])
+-
+  I check that the phone call is in 'Cancelled' state.
+-
+  !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call held.}:
+    - state == "cancel"
+-
+  I reset the phone call. 
+-
+  !python {model: crm.phonecall}: |
+    self.case_reset(cr, uid, [ref("crm.crm_case_phone06")])
+-
+  I check that the phone call is reset or not  
+-
+  !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call held.}:
+    - state == "open"
+-
+  I setting phone call to held (done).
 -
   !python {model: crm.phonecall}: |
     self.case_close(cr, uid, [ref("crm.crm_case_phone06")])
 -
   I check that the phone call is in 'Held' state.
 -
-  !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call Helded}:
+  !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call held.}:
     - state == "done"

=== modified file 'crm/test/process/segmentation.yml'
--- crm/test/process/segmentation.yml	2011-11-03 13:09:51 +0000
+++ crm/test/process/segmentation.yml	2011-12-16 06:59:24 +0000
@@ -8,7 +8,7 @@
     #Todo: Need to check after segmentation started
 
 -
-  I create rule Segmentation line record for partner .
+  I create rule segmentation line record for partner .
 -
   !python {model: crm.segmentation.line}: |
     id = self.create(cr, uid, {'name': "OpenERP partners",'expr_value': 25})

_______________________________________________
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