Thursday, October 26, 2023
4 changes · master
Code cleanup and technical improvements
The company switching code has been reorganized and renamed to make it easier for developers to understand and maintain. There is no intended functional change for users, aside from clearer company hierarchy display on mobile.
Original PR description
This commit refactors the company service to be split responsibilities. The selection logic is now entirely contained in the switch_company_menu, making the company service clearer. The following variables have also been renamed: - `availableCompanies` has been renamed to `allowedCompanies` to reflect the name from the python side - `allowedCompanies` has been renamed to `activeCompanies` Indent has aslo been added to SwitchMenuItem on mobile to display the hierachy of companies. *The functional aspect of the company service and company switch has not been changed.* Community: https://github.com/odoo/odoo/pull/138521 Task: [3522168](https://www.odoo.com/mail/view?model=project.task&res_id=3522168) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update modernizes how keyboard input is detected across several Odoo apps by replacing outdated browser properties. It helps keep document signing, PDF handling, helpdesk search, website knowledge search, and related screens compatible with current and future browsers without changing business workflows.
Original PR description
…perties These properties are deprecated. We should consider to use `KeyboardEvent.key` or `KeyboardEvent.code` for new code. Note that we prefer to use the `key` property as multiple physical keys…
…perties These properties are deprecated. We should consider to use `KeyboardEvent.key` or `KeyboardEvent.code` for new code. Note that we prefer to use the `key` property as multiple physical keys can send the same value (e.g. Enter can also be sent by the numeric pad). We should only use `code` when we explicitly want to target a single physical key on the keyboard. By doing this, we can now remove the dependency of `jQuery.ui.keyCode` that was used as mapping of key code descriptions to their numeric values. References: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/charCode (deprecated) https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode (deprecated) https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/which (deprecated) https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key https://api.jqueryui.com/1.12/jQuery.ui.keyCode/ Some links that helps: https://w3c.github.io/uievents/tools/key-event-viewer.html https://www.toptal.com/developers/keycode/table
This update removes older behind-the-scenes page behavior functions as part of ongoing code cleanup. It should make the product easier to maintain without changing how business users work day to day.
The Knowledge app now uses the browser's built-in clipboard capability for copying template content. This reduces reliance on an external clipboard tool while keeping the user experience the same.
Original PR description
task-3439226