[FIX] base_partner_merge: deduplicate contacts in multi company
When deduplicating contacts, the function _process_query doesn't use the orm to fetch the partners to merge according to the criteria. So there were some access error in multi company when trying to merge contacts from a not allowed company. Now a check is made with the orm before merging the contacts. opw:708457
This commit is contained in:
parent
5d5bd2c404
commit
0ae30c5997
|
@ -553,7 +553,10 @@ class MergePartnerAutomatic(osv.TransientModel):
|
|||
'min_id': min_id,
|
||||
'aggr_ids': aggr_ids,
|
||||
}
|
||||
|
||||
# To ensure that the used partners are accessible by the user
|
||||
partner_ids = self.pool['res.partner'].search(cr, uid, [('id', 'in', aggr_ids)], context=context)
|
||||
if len(partner_ids) >= 2:
|
||||
values['aggr_ids'] = partner_ids
|
||||
proxy.create(cr, uid, values, context=context)
|
||||
counter += 1
|
||||
|
||||
|
|
Loading…
Reference in New Issue