From 1e407d5f2d7c2c9ba938e60d7fa2b13b440ff03e Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Thu, 6 May 2010 15:57:00 +0530 Subject: [PATCH] [FIX,IMP]: crm: Fixes and improvement in yml tests + security csv bzr revid: rpa@tinyerp.com-20100506102700-9ksfm283t33q8m05 --- addons/crm/__openerp__.py | 116 +++++++++++------------ addons/crm/crm_phonecall.py | 9 +- addons/crm/security/ir.model.access.csv | 3 - addons/crm/test/test_crm_lead.yml | 3 +- addons/crm/test/test_crm_opportunity.yml | 8 +- 5 files changed, 69 insertions(+), 70 deletions(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index e2ea825c63c..e3c3fd8f8c8 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -21,9 +21,9 @@ { - 'name': 'Customer & Supplier Relationship Management', - 'version': '1.0', - 'category': 'Generic Modules/CRM & SRM', + 'name': 'Customer & Supplier Relationship Management', + 'version': '1.0', + 'category': 'Generic Modules/CRM & SRM', 'description': """The generic Open ERP Customer Relationship Management system enables a group of people to intelligently and efficiently manage leads, opportunities, meeting, phonecall etc. @@ -41,79 +41,79 @@ appropriate staff, and making sure all future correspondence gets to the right place. The CRM module has a email gateway for the synchronisation interface -between mails and Open ERP.""", - 'author': 'Tiny', - 'website': 'http://www.openerp.com', +between mails and Open ERP.""", + 'author': 'Tiny', + 'website': 'http://www.openerp.com', 'depends': [ 'base', - 'base_action_rule', - 'process', - 'mail_gateway', - 'base_calendar', - 'resource', - ], + 'base_action_rule', + 'process', + 'mail_gateway', + 'base_calendar', + 'resource', + ], 'init_xml': [ - 'crm_data.xml', - 'crm_meeting_data.xml', - 'crm_lead_data.xml', - 'crm_meeting_data.xml', - 'crm_opportunity_data.xml', - 'crm_phonecall_data.xml', - ], + 'crm_data.xml', + 'crm_meeting_data.xml', + 'crm_lead_data.xml', + 'crm_meeting_data.xml', + 'crm_opportunity_data.xml', + 'crm_phonecall_data.xml', + ], 'update_xml': [ - 'wizard/crm_lead_to_partner_view.xml', - 'wizard/crm_lead_to_opportunity_view.xml', + 'wizard/crm_lead_to_partner_view.xml', + 'wizard/crm_lead_to_opportunity_view.xml', - 'wizard/crm_phonecall_to_phonecall_view.xml', - 'wizard/crm_phonecall_to_partner_view.xml', - 'wizard/crm_phonecall_to_opportunity_view.xml', + 'wizard/crm_phonecall_to_phonecall_view.xml', + 'wizard/crm_phonecall_to_partner_view.xml', + 'wizard/crm_phonecall_to_opportunity_view.xml', - 'wizard/crm_opportunity_to_phonecall_view.xml', - 'wizard/crm_partner_to_opportunity_view.xml', + 'wizard/crm_opportunity_to_phonecall_view.xml', + 'wizard/crm_partner_to_opportunity_view.xml', - 'wizard/crm_forward_to_partner_view.xml', - 'wizard/crm_send_email_view.xml', - 'wizard/crm_email_add_cc_view.xml', - 'crm_view.xml', + 'wizard/crm_forward_to_partner_view.xml', + 'wizard/crm_send_email_view.xml', + 'wizard/crm_email_add_cc_view.xml', + 'crm_view.xml', - 'crm_action_rule_view.xml', - 'crm_lead_view.xml', - 'crm_lead_menu.xml', + 'crm_action_rule_view.xml', + 'crm_lead_view.xml', + 'crm_lead_menu.xml', - 'crm_meeting_view.xml', - 'crm_meeting_menu.xml', + 'crm_meeting_view.xml', + 'crm_meeting_menu.xml', - 'crm_phonecall_view.xml', - 'crm_phonecall_menu.xml', + 'crm_phonecall_view.xml', + 'crm_phonecall_menu.xml', - 'crm_opportunity_view.xml', - 'crm_opportunity_menu.xml', + 'crm_opportunity_view.xml', + 'crm_opportunity_menu.xml', - 'security/crm_security.xml', -# 'security/ir.model.access.csv', + 'security/crm_security.xml', + 'security/ir.model.access.csv', - 'report/crm_lead_report_view.xml', - 'report/crm_phonecall_report_view.xml', + 'report/crm_lead_report_view.xml', + 'report/crm_phonecall_report_view.xml', - 'process/crm_configuration_process.xml', + 'process/crm_configuration_process.xml', 'crm_installer_view.xml' - ], + ], 'demo_xml': [ - 'crm_demo.xml', - 'crm_lead_demo.xml', - 'crm_meeting_demo.xml', - 'crm_opportunity_demo.xml', + 'crm_demo.xml', + 'crm_lead_demo.xml', + 'crm_meeting_demo.xml', + 'crm_opportunity_demo.xml', 'crm_phonecall_demo.xml' - ], + ], 'test': [ -# 'test/test_crm_lead.yml', -# 'test/test_crm_meeting.yml', -# 'test/test_crm_opportunity.yml', -# 'test/test_crm_phonecall.yml', - ], - 'installable': True, - 'active': False, - 'certificate': '0079056041421', + 'test/test_crm_lead.yml', + 'test/test_crm_meeting.yml', + 'test/test_crm_opportunity.yml', + 'test/test_crm_phonecall.yml', + ], + 'installable': True, + 'active': False, + 'certificate': '0079056041421', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 49a5e366ede..bb8e60d1fb1 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -43,14 +43,17 @@ class crm_phonecall(osv.osv, crm_case): 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \ domain="[('partner_id','=',partner_id)]"), 'company_id': fields.many2one('res.company', 'Company'), - 'description': fields.text('Description'), + 'description': fields.text('Description'), 'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True, help='The state is set to \'Draft\', when a case is created.\ \nIf the case is in progress the state is set to \'Open\'.\ \nWhen the case is over, the state is set to \'Done\'.\ \nIf the case needs to be reviewed then the state is set to \'Pending\'.'), - 'email_from': fields.char('Email', size=128, help="These people will receive email."), - + 'email_from': fields.char('Email', size=128, help="These people will receive email."), + 'stage_id': fields.many2one('crm.case.stage', 'Stage', \ + domain="[('section_id','=',section_id),\ + ('object_id.model', '=', 'crm.phonecall')]"), + 'date_open': fields.datetime('Opened', readonly=True), # phonecall fields 'duration': fields.float('Duration'), 'categ_id': fields.many2one('crm.case.categ', 'Category', \ diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 62d069c3004..a4650b1b866 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -18,11 +18,8 @@ "access_crm_case_stage_manager","crm.case.stage","model_crm_case_stage","crm.group_crm_manager",1,1,1,1 "access_crm_case_resource_type_user","crm_case_resource_type user","model_crm_case_resource_type","crm.group_crm_user",1,0,0,0 "access_crm_case_resource_type_manager","crm_case_resource_type manager","model_crm_case_resource_type","crm.group_crm_manager",1,1,1,1 -"access_crm_case_report_user","crm.case.report","model_crm_case_report","crm.group_crm_user",1,0,0,0 -"access_crm_case_report_manager","crm.case.report manager","model_crm_case_report","crm.group_crm_manager",1,1,1,1 "access_crm_lead_report_user","crm.lead.report","model_crm_lead_report","crm.group_crm_user",1,0,0,0 "access_crm_phonecall_report_user","crm.phonecall.report","model_crm_phonecall_report","crm.group_crm_user",1,0,0,0 -"access_report_crm_case_service_dashboard","report.crm.case.service.dashboard","model_report_crm_case_service_dashboard","crm.group_crm_user",1,0,0,0 "access_crm_lead2partner","crm.lead2partner","model_crm_lead2partner","crm.group_crm_user",1,1,1,1 "access_crm_lead2opportunity","crm.lead2opportunity","model_crm_lead2opportunity","crm.group_crm_user",1,1,1,1 "access_crm_opportunity2phonecall","crm.opportunity2phonecall","model_crm_opportunity2phonecall","crm.group_crm_user",1,1,1,1 diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 22fdfffca1b..0a051d2310d 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -88,8 +88,7 @@ - !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') + obj_opportunity = self.pool.get('crm.lead') ids = obj_opportunity.search(cr, uid, [('name', '=', lead.partner_name)]) opportunity = obj_opportunity.browse(cr, uid, ids)[0] assert lead.partner_name == opportunity.partner_id.name diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index d7118dd0c90..e3a4f28cb5e 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -2,7 +2,7 @@ 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.opportunity, id: crm_opportunity_abcfuelcounits0}: + !record {model: crm.lead, id: crm_opportunity_abcfuelcounits0}: email_from: info@balmerinc.be name: 'ABC FUEL CO 829264 - 10002 units ' partner_address_id: base.res_partner_address_1 @@ -15,19 +15,19 @@ - | I check that the opportunity is in 'New' state. - - !assert {model: crm.opportunity, id: crm_opportunity_abcfuelcounits0}: + !assert {model: crm.lead, id: crm_opportunity_abcfuelcounits0}: - state == "draft" - | I open opportunity by click on "Open" button, - - !python {model: crm.opportunity}: | + !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_opportunity_abcfuelcounits0")]) - | I schedule Meeting on this current opportunity by clicking on "schedule Meeting". - - !python {model: crm.opportunity}: | + !python {model: crm.lead}: | self.action_makeMeeting(cr, uid, [ref("crm_opportunity_abcfuelcounits0")]) - |