Monday, September 30, 2024
3 changes
2 changes
Enhancements to existing features
Knowledge pages now use the newer HTML editor components, making it easier to add and manage items like tables of contents, embedded videos, Excalidraw boards, and files. The update also improves stability for collaborative editing and reduces unnecessary page refreshes or flickering while editing.
Original PR description
Since Knowledge is being refactored to use the new editor features, notably embedded components, which are the successor of knowledge "Behaviors", it is the perfect opportunity to move some of them…
Since Knowledge is being refactored to use the new editor features, notably embedded components, which are the successor of knowledge "Behaviors", it is the perfect opportunity to move some of them in the html_editor module, so that any HtmlField can make use of them. ### Table of Content This embedded component dynamically aggregates headers in a HtmlField value and displays an anchor tree redirecting to each header by clicking on it. ### Video (Iframe) This embedded component stores the URL of a trusted video provider (like youtube), and displays an iframe in the HtmlField when it is mounted. ### Excalidraw (Iframe) This embedded component stores the URL of an excalidraw drawing boad, and displays an iframe in the HtmlField when it is mounted. ### File This embedded component stores data related to an existing attachment and displays it in the HtmlField, with useful features like opening the FileViewer, and download the file. The file can be renamed (locally for the HtmlField, independently of the real attachment name). This PR also introduces fixes and improvements related embedded components and knowledge needs. See each commit for more details. Enterprise: https://github.com/odoo/enterprise/pull/67083 task-3672747 Co-authored-by: Damien Abeloos <abd@odoo.com> Co-authored-by: Adrien Schoffeniels <adsc@odoo.com> Co-authored-by: Julien Banken <jbn@odoo.com> Co-authored-by: Thomas Josse <thjo@odoo.com>
Code cleanup and technical improvements
Knowledge now uses Odoo's newer editor to make articles more interactive and consistent, including public article pages. Comments load more efficiently, large articles should open with less server load, and embedded content such as files, views, templates, and tables of contents is handled more reliably.
Original PR description
Refactor Knowledge to use the new features of the editor. Behaviors are converted to Embedded Components which are now natively supported in the html_editor module. (Embedded Components is a feature…
1 change
Resolved issues and error corrections
This fix corrects a typo in the Swiss payroll insurance threshold calculation that was causing payslip generation to fail. The fallback value was incorrectly formatted as a tuple instead of a decimal number, which broke the payroll processing. This resolves errors when generating payslips for Swiss employees.
Original PR description
Steps to reproduce: - Intall Payroll and Switzerland localization > Switch to CH company - Employees > New > Work Information tab > Set any Canton - Create a contract for that employee > Set it to 'Running' state - Payroll > Work Entries > Work Entries > Remove filters - Navigate to next month > Regenerate Work Entries - Generate Payslips > Error is raised This error is raised because the fallback value in _get_ac_threshold is 0, 0 instead of being a float (same as the otherwise returned line.amount). This was most likely just a typo using the wrong decimal separator which turned th fallback into a tuple, breaking on the following operations. opw-4204580
Refactor Knowledge to use the new features of the editor. Behaviors are converted to Embedded Components which are now natively supported in the html_editor module. (Embedded Components is a feature of the HtmlField allowing to mount Owl components inside an HtmlField value, based on metadata stored in the attributes of html nodes) ### website_knowledge is no longer forgotten Public version of an article is now using the HtmlViewer to render the Html value, and this allows to mount embedded components as they would be in the backend view. This results in a far better reading experience for public users. ### Comments Overhaul of the feature, in a concise way: anchoring a comment in the HtmlField value is way less expensive in terms of amount of characters since it uses 2 self closing `<a>` nodes instead of wrapping every text node in a `<span>` (which could be hundreds for a comment spanning over an entire document). This is also easier to manage during edition, since new nodes between the boundaries of a comment don't need to be processed so that they are marked as part of a comment anymore. Loading threads and messages is now centralized in a `comments_service` which batches rpc calls together, significantly reducing the load when opening an article. The comment panel now has a "load more" feature, meaning that it does not load every single existing thread and their messages at once when opening it. Floating "Comment boxes" are now perfectly aligned with their anchor in the HtmlField when they are focused (previously they were pushed by other Comments boxes above them when there was not enough space, even when active). ### Embedded Components All existing Behaviors are converted to embedded components, and some of them are moved in the html_editor module #### knowledge: - Article Link - Article Index - Clipboard - Embedded View - Embedded view Link #### html_editor: - Excalidraw - File - Table of Content - Video ### Migration Since metadata for Behaviors differ from those of Embedded Components, and upgrading an html value is expensive, this transition will be handled client-side for starts. A small JS upgrade feature for html values is introduced. The "upgrade" will be attempted once, and won't result in a crash if it fails. Instead, the previous value will be conserved, and the user will be able to adjust the content manually by using editor commands. Odoo Community: https://github.com/odoo/odoo/pull/173997 task-3672747 Co-authored-by: Damien Abeloos <abd@odoo.com> Co-authored-by: Adrien Schoffeniels <adsc@odoo.com> Co-authored-by: Julien Banken <jbn@odoo.com> Co-authored-by: Thomas Josse <thjo@odoo.com>