Daily updates from Odoo
Thursday, June 8, 2023
4 changes · master
Code cleanup and technical improvements
This update reorganizes JavaScript files across several Odoo Enterprise apps to align their structure with related community code changes. It is an internal cleanup intended to make future maintenance easier without changing day-to-day user workflows.
Original PR description
[REF] mail_enterprise, *: reorganize JS files See community counter-part for more details. Part of task-3265211 https://github.com/odoo/odoo/pull/124168
The Knowledge sidebar has been redesigned to load much faster and update without reloading the whole page, especially for workspaces with many articles. Users also get smoother article moving, clearer drag-and-drop feedback, easier trash access, and fewer sidebar-related errors.
Original PR description
Purpose: -------- Previously, the sidebar was rendered server side. The generated html fragment was sent to the client which appended it into the DOM. This was meant to be temporary since the…
Purpose: -------- Previously, the sidebar was rendered server side. The generated html fragment was sent to the client which appended it into the DOM. This was meant to be temporary since the owlification of the application, and had several flaws (slow, lots of DOM manipulations, no reactivity). This commit introduces a sidebar component that is fully autonomous (other components do not have to force a full reload of the page to update the sidebar). It improves the performances (~0.7s vs >3s to load the home page with +1500 articles in the sidebar), reduces the number of RPCs, remove the need of DOM manipulations and allows for more customization. This commit also introduces a "SortableList" hook, that removes the need of the external Jquery library "NestedSortable", and allows for more freedom concerning the drag&drop behaviour. The revamped sidebar also comes with a few new features and fixes: - The MoveArticleDialog (dialog shown when clicking on the "Move To" button) does not ask for confirmation anymore when moving the article to another category. We consider that the user knows what he is doing when using this button, and he has a visual feedback of what happened since the article which has been moved is the active one, and is therefore highlighted in the sidebar. Moreover, clicking on the "move to" button, clicking on the selection input, clicking on a category, clicking on the "move article" button and clicking on "ok" on the confirmation dialog was a long process to just move the current article. Moving an article using drag&drop in the sidebar still asks for confirmation. - When dragging an article in the sidebar, if the current drop position is not allowed, the position hint is shown in red (for example if one only has read access for the parent under which one tries to place the article). This way, one does not need to drop it and receive an access error to know that the position was not allowed. - Articles in the sidebar can be sent to the trash by dragging them onto the trash manager at the bottom of the sidebar. This makes it easier to delete articles from the form view. - The current article is now always shown when it is present in the sidebar (previously, it was not always the case (when using the "MoveArticleDialog" and moving the article under a folded parent). - Resequencing favorites does not crash anymore if you lost access to one of your favorite articles but did not reload the page to show the change in the sidebar yet. Previously, if you did so, you tried to change the sequence of a restricted article (which raised an access error). Now, restricted articles are filtered out when resequencing favorites. - One cannot change from the sidebar the emoji of an article one just locked (and inversely, one can change the emoji if one just unlocked the article). Previously, you could (not) do it until the sidebar was reloaded. - The "Open the trash" button is now always visible. Previously, if you had a lot of articles, you had to scroll to the bottom of the tree to be able to open the trash. These improvements are not available for the public view (from website_knowledge), which still appends into the DOM the sidebar fragment generated server side. Task-3074123
Point-of-sale template names were standardized across several localization and hardware-related modules. This makes the codebase more consistent and easier to maintain, with no expected change to day-to-day user workflows.
Original PR description
pos*: l10n_de_pos_cert, l10n_mx_edi_pos, pos_iot, pos_l10n_se, pos_preparation_display, pos_settle_due Previously, none of the templates of the pos were namespaced, this means that depending on context, you have to access them differently: in xpath the module prefix is necessary even if the template name itself isn't namespace, but in owl components you cannot use the namespaced version because owl doesn't have the notion of modules. This commit namespaces the component templates of all the pos modules so that it's consistent with the rest of the code base. It also removes some extraneous calls to super.setup() that were leftover and are not necessary for components extending directly owl's base Component. Linked-to: odoo/odoo#124069
This change simplifies how German POS certification data is prepared when closing a session by creating it directly in Python instead of converting it from a template. This reduces the risk of errors and makes the process easier to maintain, with no major expected change for end users.
Original PR description
[REF] l10n_de_pos_cert: replace rendering of json object from the xml Currently, the json object needed to close the session is obtained from an xml template that is transformed in python. This approach is not necessary and is also error prone. In this PR i refactor the code in order to create the object directly in Python Task 3323623