allow unlinking related items if you can edit the parent item fix #210
deleting a relationship should require edit access to the parent object (the one they are related to) not delete access to the target object. (because you are not deleting it, just disassociating it which is an edit to the parent object)
Merge request reports
Activity
OK, so in that instance it should be a trashcan icon, and require delete access for the target object - this is very confusing! I am not entirely clear how to figure out what is going to happen when deleting from a related list, but yes, deleting invoices from an org certainly deletes them.
I spent some time tracing through what happens when you call deleteRelation, but I couldn't figure out why invoices get deleted it should call deleteRelation in modules/Vtiger/models/Relation.php which should in turn call DeleteEntity in include/utils/utils.php which should just unlink if there is a return_module, which I think there should be.
OK, found it in a bunch of modules the unlinkRelationship function is overridden, so modules/Invoice/Invoice.php has an unlinkRelationship function that trashes the invoice when deleted from the Accounts or Contacts module. In SalesOrder.php it trashes if deleted from Accounts for example.
Well doing it as override templates means that the weirdness is isolated into the module that is being weird. In general there shouldn't be hard coded exceptions for specific modules in the core code. It isn't just the icon change, it is the different permissions required too. I guess module checking is already in there as there is a {if $RELATED_MODULE_NAME eq 'Calendar'} but in general I think if a module overrides unlinkRelationship and thus requires a template difference then the template difference should be in the same module.
Quotes from Accounts is a hard delete
PurchaseOrder from Vendors is a hard delete
Potentials from Accounts is a hard delete
Potentials from Contacts might be a hard delete if the potential is directly linked to the contact and not through the account, or it might just clear the contactid on the Potential
mentioned in issue #210 (closed)
mentioned in commit f88cb71d