"Disable Node" option for categories
Since a89afa43 (Formulator: Support disabled items in all ItemWidget subclasses., 2014-04-02) we can include disabled items in listfields. This was used for example in erp5_crm to show the services with their hierarchy as disabled items and was useful to display the hierarchy.
In some fields, we don't want user to select "nodes" categories, but only select "leaves" categories (ie. select the most precise category). This always had a problem when using "Indented title" as display method for categories, because the user can not see the actual hierarchy. This is about making it possible to display hierarchy of categories in this case where we select only leaves, so that it displays like this:
This required to:
- introduce a new category API,
disable_node
, which is semantically very close tofilter_node
except that instead of filtering out node categories that are kept withNone
as related URL. Symmetrically, we also introducedisable_leave
- make
ParallelListField
support disabled items. Even if this was properly supported in underlying fields, some parts inParallelListField
did not differentiate betweenNone
and''
. - modify several forms to use
disable_node
instead offilter_node