The message “Access denied” on opening an editor can be caused by the following:
- the user has no rights for editing the entity (obviously not your case)
- the entity has just been deleted (not your case too)
- the editor cannot load the entity for some reason
Your editor uses quite a complex view (empresas-edit-view) including two nested collections and lots of references. By default, the platform tries to generate an optimal SQL from the loading performance perspective, and sometimes it fails in complex cases. By analyzing the generated SQL, I saw that IMGESTION_CLIENTES table was joined incorrectly through INNER JOIN, which leads to no results if the reference is null. That’s why the editor could not load the entity.
The solution is the following: open the presupuestos-view (which is used in empresas-edit-view) and for the clientes reference set Fetch to UNDEFINED (this is explained here). This leads to loading clientes by a separate SQL and the whole entity graph is loaded successfully.
We will try to fix the issue with automatic SQL generation based on your use case, thanks for reporting it!