ajay javiya (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-crm-mass-mailing-aja into lp:openobject-addons.
Requested reviews: OpenERP Core Team (openerp) For more details, see: https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-crm-mass-mailing-aja/+merge/141204 Hello, Add Mass mailing feature in crm lead/opportunities. Thank You. -- https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-crm-mass-mailing-aja/+merge/141204 Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-crm-mass-mailing-aja.
=== modified file 'crm/__openerp__.py' --- crm/__openerp__.py 2012-12-21 10:21:51 +0000 +++ crm/__openerp__.py 2012-12-24 06:38:22 +0000 @@ -94,6 +94,7 @@ 'board_crm_view.xml', 'res_config_view.xml', + 'wizard/crm_mass_mail.xml', ], 'demo': [ 'crm_demo.xml', === modified file 'crm/wizard/__init__.py' --- crm/wizard/__init__.py 2012-12-05 13:03:21 +0000 +++ crm/wizard/__init__.py 2012-12-24 06:38:22 +0000 @@ -24,5 +24,6 @@ import crm_opportunity_to_phonecall import crm_lead_to_opportunity import crm_merge_opportunities +import crm_mass_mail # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: === added file 'crm/wizard/crm_mass_mail.py' --- crm/wizard/crm_mass_mail.py 1970-01-01 00:00:00 +0000 +++ crm/wizard/crm_mass_mail.py 2012-12-24 06:38:22 +0000 @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Business Applications +# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). +# +# 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 <http://www.gnu.org/licenses/>. +# +############################################################################## + +from openerp.osv import osv + + +class crm_lead_mass_mail(osv.osv_memory): + + _inherit = "mail.compose.message" + + def default_get(self, cr, uid, fields, context=None): + if context is None: + context = {} + res_ids = [] + res = super(crm_lead_mass_mail, self).default_get(cr, uid, fields, context=context) + partner_ids = self.pool.get('crm.lead').read(cr, uid, context.get('default_partner_ids'), ['partner_id']) + partner_obj = self.pool.get('res.partner') + partner_ids = set([partner_id['partner_id'][0] for partner_id in partner_ids if partner_id['partner_id']]) + for partner_id in partner_ids: + partner = partner_obj.browse(cr, uid, partner_id) + if partner.email: + res_ids.append(partner.id) + res['partner_ids'] = res_ids + return res + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: === added file 'crm/wizard/crm_mass_mail.xml' --- crm/wizard/crm_mass_mail.xml 1970-01-01 00:00:00 +0000 +++ crm/wizard/crm_mass_mail.xml 2012-12-24 06:38:22 +0000 @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<openerp> + <data> + <act_window id="action_crm_send_mass_mail" + multi="True" + key2="client_action_multi" + name="Mass Mailing" + res_model="mail.compose.message" + src_model="crm.lead" + view_mode="form" + target="new" + context="{'default_composition_mode':'mass_mail','default_partner_ids': active_ids}" + view_id="mail.email_compose_message_wizard_form" + /> + </data> +</openerp>
_______________________________________________ Mailing list: https://launchpad.net/~openerp-dev-gtk Post to : openerp-dev-gtk@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-dev-gtk More help : https://help.launchpad.net/ListHelp