[Create] Always allow cloning self

Always allow cloning the newly-created object itself
when saving a newly-created domain object.
This commit is contained in:
Victor Woeltjen 2016-02-10 13:49:15 -08:00
parent 3146660833
commit 0bdf05e61c

View File

@ -106,12 +106,13 @@ define(
return fetchObject(object.getModel().location); return fetchObject(object.getModel().location);
} }
function isOriginal(domainObject) { function allowClone(objectToClone) {
return domainObject.getCapability('location').isOriginal(); return (objectToClone.getId() === domainObject.getId()) ||
objectToClone.getCapability('location').isOriginal();
} }
function cloneIntoParent(parent) { function cloneIntoParent(parent) {
return copyService.perform(domainObject, parent, isOriginal); return copyService.perform(domainObject, parent, allowClone);
} }
function cancelEditingAfterClone(clonedObject) { function cancelEditingAfterClone(clonedObject) {