From: Quentin (OpenERP) Date: Fri, 31 May 2013 12:34:14 +0000 (+0200) Subject: [FIX] crm: after a merge of several leads/opportunities, delete the old records as... X-Git-Tag: InsPy_master01~464^2~735 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=fe7866ccecce659bcc4e04bf0da74a08ac628815;p=odoo%2Fodoo.git [FIX] crm: after a merge of several leads/opportunities, delete the old records as the SUPERUSER to avoid security issues. bzr revid: qdp-launchpad@openerp.com-20130531123414-ezx9ixg9ggame1g6 --- fe7866ccecce659bcc4e04bf0da74a08ac628815 diff --cc addons/crm/crm_lead.py index f8d7c2b,a974825..0cfc8cb --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@@ -673,8 -673,9 +673,9 @@@ class crm_lead(base_stage, format_addre merged_data['stage_id'] = section_stage_ids and section_stage_ids[0] or False # Write merged data into first opportunity self.write(cr, uid, [highest.id], merged_data, context=context) -- # Delete tail opportunities - self.unlink(cr, uid, [x.id for x in tail_opportunities], context=context) - # Delete with super user to avoid access rights issues ++ # Delete tail opportunities ++ # We use the SUPERUSER to avoid access rights issues because as the user had the rights to see the records it should be safe to do so + self.unlink(cr, SUPERUSER_ID, [x.id for x in tail_opportunities], context=context) return highest.id