diff --git a/addons/crm/__init__.py b/addons/crm/__init__.py index e4b80da6ff2..e68c350296c 100644 --- a/addons/crm/__init__.py +++ b/addons/crm/__init__.py @@ -24,8 +24,6 @@ import crm_mailgate import crm_action_rule import crm_segmentation import crm_meeting -import crm_opportunity -import crm_lead import crm_phonecall import crm_fundraising import crm_helpdesk diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index f60483f6f59..9c3eb9610d5 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -70,16 +70,8 @@ between mails and Open ERP.""", 'process/crm_configuration_process.xml', ], 'demo_xml': [ - 'test/test_crm_meeting.yml', 'crm_demo.xml', ], - 'test': ['test/test_crm_lead.yml', - 'test/test_crm_opportunity.yml', - 'test/test_crm_phonecall.yml', - 'test/test_crm_fund.yml', - 'test/test_crm_claim.yml', - 'test/test_crm_helpdesk.yml', - ], 'installable': True, 'active': False, 'certificate': '0079056041421', diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 0207e6cb39c..f7bb4a22231 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -30,4 +30,3 @@ "access_crm_opportunity2phonecall","crm.opportunity2phonecall","model_crm_opportunity2phonecall","crm.group_crm_user",1,1,1,1 "access_crm_send_mail","crm.send.mail","model_crm_send_mail","crm.group_crm_user",1,1,1,1 "access_crm_partner2opportunity","crm.partner2opportunity","model_crm_partner2opportunity","crm.group_crm_user",1,1,1,1 -"access_crm_lead2opportunity_partner","crm.lead2opportunity.partner","model_crm_lead2opportunity_partner","crm.group_crm_user",1,1,1,1 diff --git a/addons/crm/wizard/__init__.py b/addons/crm/wizard/__init__.py index 75c6a21caa3..0083eb8644a 100644 --- a/addons/crm/wizard/__init__.py +++ b/addons/crm/wizard/__init__.py @@ -25,6 +25,7 @@ import crm_email_add_cc import crm_lead_to_partner import crm_lead_to_opportunity import crm_opportunity_to_phonecall + import crm_partner_to_opportunity # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_sale/__init__.py b/addons/crm_sale/__init__.py new file mode 100644 index 00000000000..9e87d6f4cc5 --- /dev/null +++ b/addons/crm_sale/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import crm_lead +import crm_opportunity +import wizard +import report + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/crm_sale/__openerp__.py b/addons/crm_sale/__openerp__.py new file mode 100644 index 00000000000..bdcfbcc4c2d --- /dev/null +++ b/addons/crm_sale/__openerp__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'Customer & Supplier Relationship Management', + 'version': '1.0', + 'category': 'Generic Modules/CRM & SRM', + 'description': """Lead and business Opportunity """, + + 'author': 'Tiny', + 'website': 'http://www.openerp.com', + 'depends': ['crm'], + 'init_xml': [ + 'crm_lead_data.xml', + 'crm_opportunity_data.xml', + ], + 'update_xml': [ + 'wizard/crm_lead_to_partner_view.xml', + 'wizard/crm_lead_to_opportunity_view.xml', + 'wizard/crm_opportunity_to_phonecall_view.xml', + 'crm_lead_view.xml', + 'crm_lead_menu.xml', + 'crm_opportunity_view.xml', + 'crm_opportunity_menu.xml', + ], + 'demo_xml': [ + 'crm_lead_demo.xml', + 'crm_opportunity_demo.xml', + ], + 'test': ['test/test_crm_lead.yml', + #'test/test_crm_opportunity.yml', + ], + 'installable': True, + 'active': False, + 'certificate': '0079056041421', +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/crm_lead.py b/addons/crm_sale/crm_lead.py similarity index 92% rename from addons/crm/crm_lead.py rename to addons/crm_sale/crm_lead.py index 9c4c38875c5..55da349250b 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm_sale/crm_lead.py @@ -27,6 +27,15 @@ import time import mx.DateTime from tools.translate import _ + +AVAILABLE_PRIORITIES = [ + ('5', 'Lowest'), + ('4', 'Low'), + ('3', 'Normal'), + ('2', 'High'), + ('1', 'Highest') +] + class crm_lead(osv.osv): """ CRM Lead Case """ @@ -115,7 +124,11 @@ class crm_lead(osv.osv): ('object_id.model', '=', 'crm.lead')]"), 'partner_name': fields.char("Contact Name", size=64), - 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), + 'priority': fields.selection([('5', 'Lowest'), + ('4', 'Low'), + ('3', 'Normal'), + ('2', 'High'), + ('1', 'Highest')], 'Priority'), 'date_closed': fields.datetime('Closed', readonly=True), 'stage_id': fields.many2one('crm.case.stage', 'Stage', \ domain="[('section_id','=',section_id),\ @@ -134,10 +147,9 @@ class crm_lead(osv.osv): _defaults = { 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c), - 'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0], + # 'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0], } - def convert_opportunity(self, cr, uid, ids, context=None): """ Precomputation for converting lead to opportunity @param cr: the current row, from the database cursor, @@ -151,7 +163,7 @@ class crm_lead(osv.osv): context.update({'active_ids': ids}) data_obj = self.pool.get('ir.model.data') - data_id = data_obj._get_id(cr, uid, 'crm', 'view_crm_lead2opportunity_create') + data_id = data_obj._get_id(cr, uid, 'crm_sale', 'view_crm_lead2opportunity_create') value = {} view_id = False @@ -161,7 +173,7 @@ class crm_lead(osv.osv): context.update({'opportunity_id': case.id}) context.update({'active_id': case.id}) if not case.partner_id: - data_id = data_obj._get_id(cr, uid, 'crm', 'view_crm_lead2opportunity_partner') + data_id = data_obj._get_id(cr, uid, 'crm_sale', 'view_crm_lead2opportunity_partner') view_id1 = False if data_id: view_id1 = data_obj.browse(cr, uid, data_id, context=context).res_id diff --git a/addons/crm/crm_lead_data.xml b/addons/crm_sale/crm_lead_data.xml similarity index 75% rename from addons/crm/crm_lead_data.xml rename to addons/crm_sale/crm_lead_data.xml index 17211a9ef66..cf0a2671dc0 100644 --- a/addons/crm/crm_lead_data.xml +++ b/addons/crm_sale/crm_lead_data.xml @@ -6,74 +6,74 @@ New - + Assigned - + In Process - + Converted - + Recycled - + Dead - + Telesales - + Mail - + Email - + Print - + Web - + Radio - + Television - + Newsletter - + diff --git a/addons/crm/crm_lead_demo.xml b/addons/crm_sale/crm_lead_demo.xml similarity index 77% rename from addons/crm/crm_lead_demo.xml rename to addons/crm_sale/crm_lead_demo.xml index bc6638601c2..af9d5bbfedb 100644 --- a/addons/crm/crm_lead_demo.xml +++ b/addons/crm_sale/crm_lead_demo.xml @@ -7,7 +7,7 @@ - + @@ -15,13 +15,13 @@ - - + + - + @@ -29,13 +29,13 @@ - - + + - + @@ -43,14 +43,14 @@ - - + + - + @@ -58,13 +58,13 @@ - - + + - + @@ -72,15 +72,15 @@ - - + + - + @@ -88,23 +88,23 @@ - - + + - + - - + + diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm_sale/crm_lead_menu.xml similarity index 94% rename from addons/crm/crm_lead_menu.xml rename to addons/crm_sale/crm_lead_menu.xml index 4d752ca8a9b..93faef7dc6e 100644 --- a/addons/crm/crm_lead_menu.xml +++ b/addons/crm_sale/crm_lead_menu.xml @@ -7,7 +7,7 @@ crm.lead tree,form - + diff --git a/addons/crm/crm_lead_view.xml b/addons/crm_sale/crm_lead_view.xml similarity index 99% rename from addons/crm/crm_lead_view.xml rename to addons/crm_sale/crm_lead_view.xml index 03318270e9b..c30694ede30 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm_sale/crm_lead_view.xml @@ -169,7 +169,7 @@