Saturday, May 25, 2024
5 changes · master
Code cleanup and technical improvements
This update simplifies how navigation bars and control buttons adapt on smaller screens. It reduces hidden duplicate interface elements, making behavior more consistent and easier to maintain across several Odoo apps.
Original PR description
*: account_consolidation,documents,documents_spreadsheet,industry_fsm, planning,sign,timesheet_grid,web_grid,web_studio During the "Milk" redesign, the display of some parts/buttons of the ControlPanel and Navbar were transformed into dropdown or hidden on smaller screens. To do so, the Bootstrap's responsive classed were used to make the transition between viewport's width more "fluid". The side-effect was that the elements for both implementations are present in the DOM (just hidden behind breakpoints), leading to more complexity in the implementation and/or weirdness in the tests. This commit simplifies it by binding those buttons/dropdown presence to the common `isSmall` threshold, cleaning up the DOM generated, making it more consistent with the rest of the codebase and allowing to remove weird/misleading selectors in the tests (i.e. click on `.d-none button`). task-3336242
Miscellaneous changes
Moving the DocumentState component from l10n_mx_edi to account. As `l10n_mx_edi_document_state` is still referenced in various views and we cannot change them in stable, we keep an empty shell in l10n_mx_edi inheriting the new generic component in account. In master, we remove `l10n_mx_edi_document_state`. task-3141517,3595436 see https://github.com/odoo/odoo/pull/165549 Forward-Port-Of: odoo/enterprise#62514
Original PR description
Moving the DocumentState component from l10n_mx_edi to account. As `l10n_mx_edi_document_state` is still referenced in various views and we cannot change them in stable, we keep an empty shell in l10n_mx_edi inheriting the new generic component in account. In master, we remove `l10n_mx_edi_document_state`. task-3141517,3595436 see https://github.com/odoo/odoo/pull/165549 Forward-Port-Of: odoo/enterprise#62514
Currently, applying an analytic filter on the general ledger results in a traceback. ### Steps to reproduce * Install `account_reports` * Open the General Ledger * Unfold all the lines * Attempt to apply an analytic filter You will encounter a traceback: `psycopg2.ProgrammingError: can't adapt type 'SQL'` ### Cause Commit odoo/odoo@467cabacc49893c433e69ca7a2cd65add068098b introduced new SQL queries using the `SQL()` wrapper. However, these `SQL()` wrapped queries are being mixe
Original PR description
Currently, applying an analytic filter on the general ledger results in a traceback. ### Steps to reproduce * Install `account_reports` * Open the General Ledger * Unfold all the lines * Attempt to apply an analytic filter You will encounter a traceback: `psycopg2.ProgrammingError: can't adapt type 'SQL'` ### Cause Commit odoo/odoo@467cabacc49893c433e69ca7a2cd65add068098b introduced new SQL queries using the `SQL()` wrapper. However, these `SQL()` wrapped queries are being mixed with regular string queries and end up being used as parameters for `cr.execute()`, which produces the error. opw-3910410 Forward-Port-Of: odoo/enterprise#63076 Forward-Port-Of: odoo/enterprise#62513
In certain scenarios, the `_compute_l10n_mx_edi_idccp()` method does not assign a value to its related field. This omission results in a traceback because non-stored computed fields must be assigned a value by the end of their compute method's execution. opw-3923109 Forward-Port-Of: odoo/enterprise#63131 Forward-Port-Of: odoo/enterprise#62533
Original PR description
In certain scenarios, the `_compute_l10n_mx_edi_idccp()` method does not assign a value to its related field. This omission results in a traceback because non-stored computed fields must be assigned a value by the end of their compute method's execution. opw-3923109 Forward-Port-Of: odoo/enterprise#63131 Forward-Port-Of: odoo/enterprise#62533
When the yearly cost is recomputed, beecause the change of a benefit re-triggered it, it is badly recomputed if the contract contains extra time off. To avoid this issue, we us the function _get_yearly_cost with inverse param to true that correctly handle the value of the extra time off in the yearly cost. The amount of the yearly cost can slightly change, few cents, because of the precision lost caused by computing gross from yearly cost and then recomputing yearly cost based on the gross
Original PR description
When the yearly cost is recomputed, beecause the change of a benefit re-triggered it, it is badly recomputed if the contract contains extra time off. To avoid this issue, we us the function _get_yearly_cost with inverse param to true that correctly handle the value of the extra time off in the yearly cost. The amount of the yearly cost can slightly change, few cents, because of the precision lost caused by computing gross from yearly cost and then recomputing yearly cost based on the gross Forward-Port-Of: odoo/enterprise#62704