3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
259 stars 143 forks source link

Related tables: insert a child only from a parent's form #2613

Open sigsdis30 opened 2 years ago

sigsdis30 commented 2 years ago

QGIS 3.16 Client Lizmap 3.4 Lizmap server 3.4.7

Hello, From a parent/children 1:M relationship, we need to allow users to add, modify or delete children (non-geographic table) from a parent's form (geographic table, unmodifiable). A new child must also inherit characteristics from the parent. When we go through the parent's form to create a new child object, it works. On the other hand, we can also create a new child directly with the Edit menu and the Data menu: this is a problem, because in these cases, the new record doesn't retrieve any attribute from the parent and the user shouldn't have to choose them. Is there a way to handle this case. We should be able to force the user to go through a parent's form to create a child.

mdouchin commented 2 years ago

There is indeed an option Hide layer in the list (last checkbox) to prevent to display the table in the attribute table panel, to force to open the parent table and click on the parent table line to display the filtered child table. See https://docs.lizmap.com/current/en/publish/lizmap_plugin/attribute_table.html#at-the-layer-level

We could detect this option, and say if it is checked, we must prevent the user from opening the form for the child layer too.

We should probably change the label of this option, and also the tooltip

sigsdis30 commented 2 years ago

Thank you! We have just tested: it works well. But this button does only the half the job: if we could hide the table in the same way in the Edit menu, that would be perfect.

mdouchin commented 2 years ago

Exactly, we must extend the behaviour to the Edit menu !

Gustry commented 4 months ago

This has been improved in Lizmap Web Client 3.7. Is this ticket still relevant ?