Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 141
    • Merge requests 141
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !1199

Merged
Created Jul 13, 2020 by Jérome Perrin@jeromeOwner

"Disable Node" option for categories

  • Overview 1
  • Commits 11
  • Pipelines 1
  • Changes 28

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:

screenshot of a category with disabled items for hierarchy

This required to:

  • introduce a new category API, disable_node, which is semantically very close to filter_node except that instead of filtering out node categories that are kept with None as related URL. Symmetrically, we also introduce disable_leave
  • make ParallelListField support disabled items. Even if this was properly supported in underlying fields, some parts in ParallelListField did not differentiate between None and ''.
  • modify several forms to use disable_node instead of filter_node
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: feat/category_disable_node
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7