[FIX] crm: merge partner
It is not allowed to merge a partner with one of his parent. opw:673104
This commit is contained in:
parent
6e07ae5a5c
commit
bbb317c547
|
@ -300,6 +300,12 @@ class MergePartnerAutomatic(osv.TransientModel):
|
||||||
if len(partner_ids) > 3:
|
if len(partner_ids) > 3:
|
||||||
raise osv.except_osv(_('Error'), _("For safety reasons, you cannot merge more than 3 contacts together. You can re-open the wizard several times if needed."))
|
raise osv.except_osv(_('Error'), _("For safety reasons, you cannot merge more than 3 contacts together. You can re-open the wizard several times if needed."))
|
||||||
|
|
||||||
|
child_ids = set()
|
||||||
|
for partner_id in partner_ids:
|
||||||
|
child_ids = child_ids.union(set(proxy.search(cr, uid, [('id', 'child_of', [partner_id])])) - set([partner_id]))
|
||||||
|
if set(partner_ids).intersection(child_ids):
|
||||||
|
raise osv.except_osv(_('Error'), _("You cannot merge a contact with one of his parent."))
|
||||||
|
|
||||||
if openerp.SUPERUSER_ID != uid and len(set(partner.email for partner in proxy.browse(cr, uid, partner_ids, context=context))) > 1:
|
if openerp.SUPERUSER_ID != uid and len(set(partner.email for partner in proxy.browse(cr, uid, partner_ids, context=context))) > 1:
|
||||||
raise osv.except_osv(_('Error'), _("All contacts must have the same email. Only the Administrator can merge contacts with different emails."))
|
raise osv.except_osv(_('Error'), _("All contacts must have the same email. Only the Administrator can merge contacts with different emails."))
|
||||||
|
|
||||||
|
|
|
@ -3056,6 +3056,12 @@ msgid "You are already at the top level of your sales-team category.\n"
|
||||||
"Therefore you cannot escalate furthermore."
|
"Therefore you cannot escalate furthermore."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: crm
|
||||||
|
#: code:addons/crm/base_partner_merge.py:310
|
||||||
|
#, python-format
|
||||||
|
msgid "You cannot merge a contact with one of his parent."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: crm
|
#. module: crm
|
||||||
#: code:addons/crm/base_partner_merge.py:446
|
#: code:addons/crm/base_partner_merge.py:446
|
||||||
#, python-format
|
#, python-format
|
||||||
|
|
Loading…
Reference in New Issue