Friday, September 1, 2023
2 changes · master
Resolved issues and error corrections
Forms now update client-side visibility and requirement rules immediately when users add related records that have not yet been saved. Server-facing filters and defaults continue to ignore those temporary records, reducing the risk of errors while keeping the interface responsive.
Knowledge macros are now more reliable when interacting with form views, chatter, attachments, and rich-text fields. This reduces stalled or incorrect automation and makes Knowledge actions work across more business records that include editable note or description fields.
Original PR description
Keep only one form controller patch in Knowledge. Refine the way the chatter and html form fields are detected for Knowledge macros: - Instead of updating the `commandsRecordInfo` at every patch if…
Keep only one form controller patch in Knowledge. Refine the way the chatter and html form fields are detected for Knowledge macros: - Instead of updating the `commandsRecordInfo` at every patch if the record's id changed, it can be done as an `onWillUnMount` hook, since we only care about the last visited record of the form view. - Use a `CallbackRecorder` to accurately ask the `Chatter` whether the current user is able to send messages or attach files, instead of relying only on the presence of the chatter in the `xmlDoc`. - Add/Move some functions related to registering/discarding/validating a `commandsRecordInfo` in the `KnowledgeCommandsService` to limit the amount of functions added in the `FormController`. Use action service to restore the form view instead of clicking on the breadcrumbs in the DOM. Breadcrumbs are only checked to ensure that the current view has a breadcrumbs history. This is more robust against future designs of the breadcrumbs (where not every element of the breadcrumbs list is displayed directly as a link (some of them can be hidden in a popper). Add comments to better explain the macro processes and the `KnowledgeCommandsService`. Remove usage of `interval` macro property as it is obsolete since [1]. Add a timeout of 10 seconds for macros, to give back control to the user if a macro is stalled. Knowledge macros rely on the name attribute of a notebook page to switch between tabs in a Form notebook. That attribute is not mandatory, so some views with a valid html_field did not have one. This commit add the name attribute so those fields can now be manipulated by Knowledge macros. [1]: https://github.com/odoo/odoo/commit/3a798039d6f200f8e28448ddb6a2d3c46654a203 task-3410128