Commit b7735923 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_base: do not clone logins when cloning persons

parent 0829bca2
"""Hook called when a person object is closed.
We want to reset reference, which is the user login in ERP5Security.
We want to reset reference, which is the user login in the old ERP5Security.
We don't want neither to clone the Logins of the user.
One exception is when a person object is installed from business template.
"""
context.setUserId(None)
context.manage_delObjects(ids=[
document.getId() for document in context.objectValues(
portal_type=context.getPortalObject().getPortalLoginTypeList()
)
])
context.Person_initUserId()
if not context.REQUEST.get('is_business_template_installation', 0):
context.setReference(None)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment