Thursday, December 17, 2020
3 changes · master
Enhancements to existing features
Odoo's code quality checks now allow a newer JavaScript standard, reflecting current browser support. This helps teams using TypeScript keep generated code closer to the original source, making it easier to read and debug internally.
Original PR description
Commit d431f94 fixed the supported ES version to ES8 because Edge did not support "Spread in destructuring" of higher version. It's now supported since Edge version 79. Hence we can support the next version. We now have several libraries written in Typescript. If we stick to an older ES version, we would need to compile the Typescript code to this older version. The source code and compiled code would then be quite different. The compiled code would also be much less readable and therefore more difficult to debug in Odoo where we have the compiled code only. We might support ES10/ES2019 before V15. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update streamlines how IoT device drivers choose and run actions such as display, keyboard, printer, and serial operations. It makes the driver code easier to maintain and extend, reducing the chance of future issues when adding new device behaviors.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The IoT hardware driver system now uses a clearer mapping to connect incoming actions with the right driver behavior. This makes camera and payment terminal drivers easier to maintain and extend, reducing the risk of errors when adding future device actions.
Original PR description
Add possibilities to map actions for the drivers To avoid a sequence of "if elif else" we integrate in the metaclass of drivers a '_set_actions()' function which initializes a '_actions()' dictionary where the key is the name of the action and the value is the name of the function to be executed in the drivers with the action data as a parameter