[FIX]crm : delete with super user to avoid access rules because if there is any user (not have delete access of lead) than also merge opportunity

bzr revid: pna@tinyerp.com-20130531114716-5as9flbu2506reh0
This commit is contained in:
Pinakin Nayi (OpenERP) 2013-05-31 17:17:16 +05:30
parent 5b18695c45
commit b430036c7f
1 changed files with 2 additions and 1 deletions

View File

@ -674,7 +674,8 @@ class crm_lead(base_stage, format_address, osv.osv):
# 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
self.unlink(cr, SUPERUSER_ID, [x.id for x in tail_opportunities], context=context)
return highest.id