Repository navigation
Conversation
SirPyTech
left a comment
There was a problem hiding this comment.
Thanks for working on this!
The parent_id should be populated in the new record because of the context default_parent_id.
The exact same mechanism is used in ir.ui.menu and works fine, so I think there is something in parent_id's compute or default or somewhere else that breaks it.
If this mechanism does not work here (it works fine in 18.0), then it should be fixed.
Have you investigated more deeply on why this isn't happening?
This said, the work-around works well and fixes the issue.
|
This PR has the |
victoralmau
left a comment
There was a problem hiding this comment.
IMO, this change is incorrect; it needs to be corrected so that default_parent_id is defined correctly in the form view of the new directory you want to create.
I need to analyze this more thoroughly to propose the appropriate solution.
Bug Description
When creating a new subdirectory from an existing directory's form view (
Subdirectoriestab ->Add a line), the web client (OWL) marks theParent Directoryfield as missing (Missing required fields), blocking the save.Although
contextprovidesdefault_parent_id(as seen incomplete_name), the user is forced to manually re-select the parent directory from the dropdown list.Solution
Allow
parent_idto be hidden and bypass strict client-side requirement whendefault_parent_idis present in context:invisible="is_root_directory or context.get('default_parent_id')"required="not is_root_directory and not context.get('default_parent_id')"