parentInventory cannot be a SYSTEM inventory
Add a liquibase SQL changelog that sets inventory.parentInventory = null
when inventory.parentInventory.formTypeCode = '**'
.
Add a throw new DataIntegrityViolationException("Parent inventory cannot be a SYSTEM inventory")
to Inventory#prePersist()
for the same condition.