Thursday, September 5, 2024
3 changes · saas-17.2
Resolved issues and error corrections
Python-based tax formulas now accept product field references written in the familiar dot format, such as product.standard_price. This prevents errors when creating sales orders with custom computed taxes and keeps behavior consistent with other supported versions.
Original PR description
Only in saas-17.2 the JS style of addressing product fields is not accepted. (`product['standard_price']` is accepted, but not `product.standard_price`) ### Steps to reproduce: - Create a tax with…
Only in saas-17.2 the JS style of addressing product fields is not accepted. (`product['standard_price']` is accepted, but not `product.standard_price`) ### Steps to reproduce: - Create a tax with "Tax Computation" at "Python Code" - Enter `result = (price_unit - product.standard_price) * 1` as the formula - In Sales create a SO and add this tax - An error shows saying product dict has no field standard_price ### Cause: The code does not consider the formula can be written in JS format. Before saas-17.2 the information given to `safe_eval` was not a dictionary so it worked. Since saas-17.2 the information is in a dictionary so to access it you must use the format `dict['field']`. In saas-17.4 the code was refactored and the formula is adapted to JS and Python: if the JS format is used, it will change the formula to use Python format. (commit: https://github.com/odoo/odoo/commit/5363189842674b77d03e031896cef2e5e970fdf7) ### Solution: Change the formula to Python format each time it is used. The way to adapt the formula is the same as in saas-17.4 where the JS format is taken into account. opw-4110562
This update brings the spreadsheet component to a newer version with fixes for exporting XLSX files, pasting values in localized sheets, scrolling the bottom bar, and preventing conflicting session updates. Users should see more reliable spreadsheet behavior, especially when sharing, exporting, or working in localized environments.
Original PR description
### Contains the following commits: https://github.com/odoo/o-spreadsheet/commit/e5e2be8d3 [REL] 17.2.23 Task: 0 https://github.com/odoo/o-spreadsheet/commit/ecdc7a5ff [FIX] XLSX: Export values along…
### Contains the following commits: https://github.com/odoo/o-spreadsheet/commit/e5e2be8d3 [REL] 17.2.23 Task: 0 https://github.com/odoo/o-spreadsheet/commit/ecdc7a5ff [FIX] XLSX: Export values along the formula string Task: 4141855 https://github.com/odoo/o-spreadsheet/commit/8943c0aa7 [FIX] sheetview: Avoid useless cleanViewport Task: 4084860 https://github.com/odoo/o-spreadsheet/commit/bcfb09f65 [FIX] selection: avoid useless selection anchor assignation Task: 4084860 https://github.com/odoo/o-spreadsheet/commit/9695b0e9d [FIX] session: avoid concurrent updates Task: 4080148 https://github.com/odoo/o-spreadsheet/commit/6cc683a59 [FIX] bottom bar: handle horizontal scroll Task: 4129625 https://github.com/odoo/o-spreadsheet/commit/95cdcd79e [FIX] clipboard: Fix paste as value for in localized sheet Task: 4104432 Co-authored-by: Anthony Hendrickx (anhe) <anhe@odoo.com> Co-authored-by: Alexis Lacroix (laa) <laa@odoo.com> Co-authored-by: Lucas Lefèvre (lul) <lul@odoo.com> Co-authored-by: Dhrutik Patel (dhrp) <dhrp@odoo.com> Co-authored-by: Adrien Minne (adrm) <adrm@odoo.com> Co-authored-by: Mehdi Rachico (mera) <mera@odoo.com> Co-authored-by: Rémi Rahir (rar) <rar@odoo.com> Co-authored-by: Pierre Rousseau (pro) <pro@odoo.com> Co-authored-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Dropdown menus now avoid unnecessary background updates when they are closed. This improves responsiveness on screens with many dropdowns, such as pivot views with many headers.
Original PR description
Have 1000 drodowns to setup. Setup one of them will trigger the event state-changed and the dropdowns already setuped will react to that event. In the end, DropdownNestingState.handleChange will be called (999 * 1000) / 2 = 499500 that means quadraticaly with the number of dropdowns. Here we avoid to trigger that event when setuping a closed dropdown. This problem was originaly observed in a pivot view with many headers.