diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 3686537ad1d..5e7e481975c 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -67,7 +67,7 @@ class crm_case_section(osv.osv): 'resource_calendar_id': fields.many2one('resource.calendar', "Resource's Calendar"), 'server_id':fields.many2one('email.smtpclient', 'Server ID'), 'note': fields.text('Description'), - + 'working_hours': fields.float('Working Hours', digits=(16,2 )), } _defaults = { diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index 5c171236836..77d2347d3ec 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -13,31 +13,28 @@
- + + - + + + - - - - - - - + - - + - + - + + diff --git a/addons/crm/report/crm_report_view.xml b/addons/crm/report/crm_report_view.xml index 814b056dbf1..701c9e3c835 100644 --- a/addons/crm/report/crm_report_view.xml +++ b/addons/crm/report/crm_report_view.xml @@ -171,16 +171,6 @@ id="act_res_users_2_report_crm_case_user" name="Monthly cases" res_model="crm.case.report" src_model="res.users" /> - - - - diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 22fdfffca1b..437059f371c 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -16,7 +16,6 @@ login: user_crm name: user_crm password: user_crm - - | I start by creating a new lead "New Customer" and I provide an address to this @@ -25,7 +24,7 @@ !record {model: crm.lead, id: crm_lead_newcustomer0}: email_from: info@mycustomer.com name: New Customer - partner_name: Sandip zala + partner_name: Capegemini phone: (855) 924-4364 mobile: (333) 715-1450 section_id: crm.section_sales_department @@ -41,6 +40,11 @@ - !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_lead_newcustomer0")]) +- | + I check that lead is now in 'open' state. +- + !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}: + - state == "open" - | As the lead seems to be a real business opportunity, I will convert it to a @@ -49,8 +53,8 @@ - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm_lead_newcustomer0')) - if not lead.partner_id: - self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")], {'active_ids': [ref("crm_lead_newcustomer0")]}) + action = self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")], {'active_ids': [ref("crm_lead_newcustomer0")]}) + assert action['res_model'] == 'crm.lead2opportunity.partner' - | Now, select "create a new partner" option in this wizard. @@ -66,7 +70,7 @@ Now, I give value to this wizard field. - !record {model: crm.lead2opportunity, id: crm_lead2opportunity_stonage_0}: - name: Sandip zala + name: Capegemini planned_revenue: 0.00 probability: 0.00 - @@ -79,8 +83,8 @@ I can check that a lead and a business opportunity is now assigned to this lead. - - # !python {model: crm.lead, id: crm_lead_newcustomer0}: - # - opportunity_id.id != False + # !python {model: crm.lead, id: crm_lead_newcustomer0}: + # - opportunity_id == False - | I check that the partner associated to this lead as the same country, phone number @@ -88,7 +92,6 @@ - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref("crm_lead_newcustomer0")) - print "lead", lead.partner_name obj_opportunity = self.pool.get('crm.opportunity') ids = obj_opportunity.search(cr, uid, [('name', '=', lead.partner_name)]) opportunity = obj_opportunity.browse(cr, uid, ids)[0] diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml index feb87e0a879..47021843348 100644 --- a/addons/crm/test/test_crm_phonecall.yml +++ b/addons/crm/test/test_crm_phonecall.yml @@ -4,44 +4,55 @@ !record {model: crm.phonecall, id: crm_phonecall_interviewcall0}: date: '2010-04-21 18:59:00' name: Interview call - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - partner_mobile: (+32)2 211 34 83 section_id: crm.section_sales_department +- | + Now , I select partner by click on "Create a Partner" button. + +- + !record {model: crm.phonecall2partner, id: crm_phonecall2partner_1}: + action: exist + partner_id: base.res_partner_9 + +- + Now, click on "Continue" button of this wizard. +- + !python {model: crm.phonecall2partner}: | + self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]}) - | As the success of phonecall seems to be a real business opportunity, I will convert it to opportunity by clicking on the "Convert to Opportunity" button. +- + !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_interviewcall0}: + name: Interview call + partner_id: base.res_partner_9 + planned_revenue: 0.0 + probability: 0.0 +- + Now, I click on "Convert" button of this wizard. - -# !python {model: crm.phonecall2opportunity}: | -# self.action_apply(cr, uid, [1], {'active_id': ref('crm_phonecall_interviewcall0')}) - + !python {model: crm.phonecall2opportunity}: | + self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_interviewcall0")], {"active_id": ref("crm_phonecall_interviewcall0")}) - # This is not working, find a way to do that in YAML - + - | I can see that a business opportunity is now assigned to this phonecall -- | - I check that the partner associated to this as the same country, phone number - and name than the phonecall. -- | - In order to avoid the duplication of similar partner, OpenERP should be able to - detect if the partner exists or if it should be created from the phonecall during the - conversion. -- | - In order to test this, I log as the user "user_crm2" -- | - Then, I create the same phonecall than the preceeding one but I change the name - of the phonecall. But this customer keeps the same email. -- | - This time OpenERP should detect that this customer already exists in the - partner base and I check that in the wizard, proposes me to link to this existing - partner instead of creating another one. -- | - I confirm the conversion wizard. +- + !assert {model: crm.phonecall, id: crm_phonecall_interviewcall0}: + - opportunity_id == True + - | And I check that the phonecall and the newly created business opportunity is linked - to the partner + to same partner +- + !python {model: crm.phonecall}: | + xid= ref('crm_phonecall_interviewcall0') + obj_phonecall = self.browse(cr, uid, xid) + ids = self.pool.get('crm.opportunity').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) + obj_opp = self.pool.get('crm.opportunity').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"