diff --git a/addons/crm/__init__.py b/addons/crm/__init__.py index b3142be7c2f..1c0cc81dd38 100644 --- a/addons/crm/__init__.py +++ b/addons/crm/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -31,7 +31,6 @@ import crm_claim import crm_fundraising import crm_helpdesk - import report import wizard diff --git a/addons/crm/__terp__.py b/addons/crm/__terp__.py index 90d2a63e09a..a1e09f63df8 100644 --- a/addons/crm/__terp__.py +++ b/addons/crm/__terp__.py @@ -41,84 +41,82 @@ 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', - 'depends': ['base', 'base_action_rule', - 'process', - 'mail_gateway', +between mails and Open ERP.""", + 'author': 'Tiny', + 'website': 'http://www.openerp.com', + 'depends': ['base', 'base_action_rule', + 'process', + 'mail_gateway', 'base_calendar', - ], - 'init_xml': ['crm_data.xml', - 'crm_meeting_data.xml', - 'crm_claims_data.xml', - 'crm_fund_data.xml', - 'crm_helpdesk_data.xml', - 'crm_lead_data.xml', - 'crm_meeting_data.xml', - 'crm_opportunity_data.xml', - 'crm_phonecall_data.xml', - ], + ], + 'init_xml': ['crm_data.xml', + 'crm_meeting_data.xml', + 'crm_claims_data.xml', + 'crm_fund_data.xml', + 'crm_helpdesk_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_phonecall_to_phonecall_view.xml', - 'wizard/crm_phonecall_to_meeting_view.xml', 'wizard/crm_phonecall_to_partner_view.xml', 'wizard/crm_phonecall_to_opportunity_view.xml', - 'wizard/crm_opportunity_to_meeting_view.xml', 'wizard/crm_opportunity_to_phonecall_view.xml', 'wizard/crm_partner_to_opportunity_view.xml', - - 'wizard/crm_send_email_view.xml', - 'wizard/crm_email_add_cc_view.xml', - 'crm_wizard.xml', + + 'wizard/crm_send_email_view.xml', + 'wizard/crm_email_add_cc_view.xml', + 'crm_wizard.xml', 'crm_view.xml', - - 'crm_action_rule_view.xml', - 'crm_lead_view.xml', - 'crm_lead_menu.xml', - 'crm_meeting_view.xml', - 'crm_meeting_menu.xml', - 'crm_phonecall_view.xml', - 'crm_phonecall_menu.xml', - 'crm_opportunity_view.xml', - 'crm_opportunity_menu.xml', - 'crm_fund_view.xml', - 'crm_fund_menu.xml', - 'crm_claims_view.xml', - 'crm_claims_menu.xml', + + 'crm_action_rule_view.xml', + 'crm_lead_view.xml', + 'crm_lead_menu.xml', + 'crm_meeting_view.xml', + 'crm_meeting_menu.xml', + 'crm_phonecall_view.xml', + 'crm_phonecall_menu.xml', + 'crm_opportunity_view.xml', + 'crm_opportunity_menu.xml', + 'crm_fund_view.xml', + 'crm_fund_menu.xml', + 'crm_claims_view.xml', + 'crm_claims_menu.xml', 'crm_helpdesk_view.xml', - 'crm_helpdesk_menu.xml', - - 'security/crm_security.xml', - 'security/ir.model.access.csv', + 'crm_helpdesk_menu.xml', + + 'security/crm_security.xml', + 'security/ir.model.access.csv', 'report/crm_report_view.xml', 'report/crm_claim_report_view.xml', 'report/crm_lead_report_view.xml', 'report/crm_fundraising_report_view.xml', - 'report/crm_opportunity_report_view.xml' , + 'report/crm_opportunity_report_view.xml' , 'report/crm_phonecall_report_view.xml', - + 'process/crm_configuration_process.xml', - + ], 'demo_xml': [ - 'crm_demo.xml', - 'crm_claims_demo.xml', - 'crm_fund_demo.xml', - 'crm_helpdesk_demo.xml', - 'crm_lead_demo.xml', - 'crm_meeting_demo.xml', - 'crm_opportunity_demo.xml', - 'crm_phonecall_demo.xml'], - 'installable': True, - 'active': False, - 'certificate': '0079056041421', + 'crm_demo.xml', + 'crm_claims_demo.xml', + 'crm_fund_demo.xml', + 'crm_helpdesk_demo.xml', + 'crm_lead_demo.xml', + 'crm_meeting_demo.xml', + 'crm_opportunity_demo.xml', + 'crm_phonecall_demo.xml'], + 'installable': True, + 'active': False, + 'certificate': '0079056041421', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/crm_opportunity.py b/addons/crm/crm_opportunity.py index 58c3c551638..407df221340 100644 --- a/addons/crm/crm_opportunity.py +++ b/addons/crm/crm_opportunity.py @@ -21,6 +21,7 @@ from datetime import datetime from osv import fields,osv,orm +from tools.translate import _ import crm AVAILABLE_STATES = [ @@ -166,5 +167,57 @@ class crm_opportunity(osv.osv): 'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0], } + def action_makeMeeting(self, cr, uid, ids, context=None): + """ + This opens Meeting's calendar view to schedule meeting on current Opportunity + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of Opportunity to Meeting IDs + @param context: A standard dictionary for contextual values + + @return : Dictionary value for created Meeting view + """ + value = {} + for opp in self.browse(cr, uid, ids): + data_obj = self.pool.get('ir.model.data') + + # Get meeting views + result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_meetings_filter') + res = data_obj.read(cr, uid, result, ['res_id']) + id1 = data_obj._get_id(cr, uid, 'crm', 'crm_case_calendar_view_meet') + id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_meet') + id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_meet') + if id1: + id1 = data_obj.browse(cr, uid, id1, context=context).res_id + if id2: + id2 = data_obj.browse(cr, uid, id2, context=context).res_id + if id3: + id3 = data_obj.browse(cr, uid, id3, context=context).res_id + + context = { + 'default_opportunity_id': opp.id, + 'default_partner_id': opp.partner_id and opp.partner_id.id or False, + 'default_section_id': opp.section_id and opp.section_id.id or False, + 'default_email_from': opp.email_from, + 'default_state': 'open', + 'default_name': opp.name + } + value = { + 'name': _('Meetings'), + 'domain': "[('user_id','=',%s)]" % (uid), + 'context': context, + 'view_type': 'form', + 'view_mode': 'calendar,form,tree', + 'res_model': 'crm.meeting', + 'view_id': False, + 'views': [(id1, 'calendar'), (id2, 'form'), (id3, 'tree')], + 'type': 'ir.actions.act_window', + 'search_view_id': res['res_id'], + 'nodestroy': True + } + + return value + crm_opportunity() diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml index 2d2e249cd69..4e37620839d 100644 --- a/addons/crm/crm_opportunity_view.xml +++ b/addons/crm/crm_opportunity_view.xml @@ -71,8 +71,10 @@ type="object" icon="gtk-go-forward" string="" /> -