Saturday, March 23, 2024
15 changes · master
Enhancements to existing features
Point of sale receipt data is now prepared without relying on the broader POS session object. This makes receipt printing easier to maintain and more consistent across country-specific POS modules, with no expected change for cashiers or customers.
Original PR description
The method export_for_printing is used to export the order data to be printed in the receipt. This method was using the pos object to get information about the company, the cashier, the currency, etc. This commit removes the use of the pos object from the export_for_printing
Resolved issues and error corrections
Corrects planning demo records so their start and end dates are always in the right order. This prevents demo data from failing validation on certain calendar days, making setup and testing more reliable.
Original PR description
In the demo data, we have two records with expressions like ```py start_date = datetime.today() - relativedelta(weeks=2, weekday=4) end_date = datetime.today() - relativedelta(weeks=2, weekday=5) ``` On 2024-03-23 (Saturday), these expressions give the values ```py start_date = datetime.date(2024, 3, 15) end_date = datetime.date(2024, 3, 9) ``` which makes a constraint checking `start_date < end_date` fail. In order to make the computation correct, the solution is to compute end_date like start_date and add an extra day, like in ```py start_date = datetime.today() - relativedelta(weeks=2, weekday=4) end_date = start_date + relativedelta(days=1) ```
Miscellaneous changes
Uses `product_category_name` instead of `categ_id` when deciding how to sort SMLs in the barcode picking view. Previously, `categ_id` was used for sorting, however there are two issues with that: 1.) This would sort by the ID, not the name, which is probably not expected behavior. 2.) `categ_id` is actually always undefined in the `_sortingMethod` call because it is never passed into the front end in the first place. This fix adds `product_category_name` as a field to be read from the `s
Original PR description
Uses `product_category_name` instead of `categ_id` when deciding how to sort SMLs in the barcode picking view. Previously, `categ_id` was used for sorting, however there are two issues with that: 1.)…
Uses `product_category_name` instead of `categ_id` when deciding how to sort SMLs in the barcode picking view. Previously, `categ_id` was used for sorting, however there are two issues with that: 1.) This would sort by the ID, not the name, which is probably not expected behavior. 2.) `categ_id` is actually always undefined in the `_sortingMethod` call because it is never passed into the front end in the first place. This fix adds `product_category_name` as a field to be read from the `stock.move.line` within the `_get_stock_barcode_data` method of `stock_barcode/models/stock_picking.py`. It also changes `categ_id` to `product_category_name` with the `_sortingMethod` method of `stock_barcode/static/src/models/barcode_model.js` As a final note, I am unsure if `categ_id` should be removed from the [`_get_fields_stock_barcode` method in `stock_barcode/models/product_product.py`](https://github.com/odoo/enterprise/blob/5b2fb8d0f3baf4fdc13e9399061110e06e3c76da/stock_barcode/models/product_product.py#L19). In this context it should be removed, however I'm unsure if other code may use it, and for compatibility sake it would be best to leave it there. opw-3693232 Forward-Port-Of: odoo/enterprise#59169 Forward-Port-Of: odoo/enterprise#56633
### Commit 1 [FIX] l10n_us_1099: clear lines when start or end date is changed Before this, setting the date fields to 2023 would show all 2023 lines in the wizard. Changing the date range to 2022 would add 2022 lines while keeping the 2023 lines. After this commit only 2022 lines remain in the wizard. opw-3774654 ### Commit 2 [FIX] l10n_us_1099: filter on date by default when adding new lines Typically a user clicks "Add a new line" on the lines_to_export o2m when they want to a
Original PR description
### Commit 1 [FIX] l10n_us_1099: clear lines when start or end date is changed Before this, setting the date fields to 2023 would show all 2023 lines in the wizard. Changing the date range to 2022 would add 2022 lines while keeping the 2023 lines. After this commit only 2022 lines remain in the wizard. opw-3774654 ### Commit 2 [FIX] l10n_us_1099: filter on date by default when adding new lines Typically a user clicks "Add a new line" on the lines_to_export o2m when they want to add lines in the selected date range from other accounts. Currently the user is presented with all journal items and will have to manually filter on the right date. Improve usability by filtering on the right date range by default. opw-3774654 Forward-Port-Of: odoo/enterprise#59180
In such a hierarchy: Clara -> Maxime -> Gregory Before this revision: Maxime and Gregory can validate Clara's timesheets, but only Maxime can edit fields of Clara's validated timesheets thanks to the fact he is the direct manager of Clara. Gregory is the manager of Clara by recursivity, and the recursivity was correctly handled in the validation check, but not in the edition of validated timesheets. After this revision: Maxime and Gregory can validate Clara's timesheets, Max
Original PR description
In such a hierarchy: Clara -> Maxime -> Gregory Before this revision: Maxime and Gregory can validate Clara's timesheets, but only Maxime can edit fields of Clara's validated timesheets thanks to the fact he is the direct manager of Clara. Gregory is the manager of Clara by recursivity, and the recursivity was correctly handled in the validation check, but not in the edition of validated timesheets. After this revision: Maxime and Gregory can validate Clara's timesheets, Maxime and Gregory can edit fields of Clara's validated timesheets. opw-3613473 Forward-Port-Of: odoo/enterprise#59088 Forward-Port-Of: odoo/enterprise#58782
This commit fixes the way we filter fields to show in the kanban editor sidebar, under the 'Add' tab. Since this view don't render what's included before the <templates> node from the xmlDoc. In other types of view, we can easily toggle the 'Show invisible' elements to display items that are considered being present in the view, but not in Kanban when they add items before the kanban card template. A test has been added too. task-3647045 Forward-Port-Of: odoo/enterprise#58911 Forward-P
Original PR description
This commit fixes the way we filter fields to show in the kanban editor sidebar, under the 'Add' tab. Since this view don't render what's included before the <templates> node from the xmlDoc. In other types of view, we can easily toggle the 'Show invisible' elements to display items that are considered being present in the view, but not in Kanban when they add items before the kanban card template. A test has been added too. task-3647045 Forward-Port-Of: odoo/enterprise#58911 Forward-Port-Of: odoo/enterprise#57322
The purpose of this PR is to fix the broken links on the homepage of the barcode app in addition to the print links in the settings of Inventory and Manufacturing apps related to barcodes. Before, clicking on these links led to an error of `The action ... does not exist`. As dictated by odoo/enterprise#58078, urls now have to start with a "/" in order to work properly. Task-3821539 Forward-Port-Of: odoo/enterprise#59181
Original PR description
The purpose of this PR is to fix the broken links on the homepage of the barcode app in addition to the print links in the settings of Inventory and Manufacturing apps related to barcodes. Before, clicking on these links led to an error of `The action ... does not exist`. As dictated by odoo/enterprise#58078, urls now have to start with a "/" in order to work properly. Task-3821539 Forward-Port-Of: odoo/enterprise#59181
- In PR #54687, a currency tag label "moneda" was added for all electronic documents and in the wrong position. - Fix the position to add the "moneda" tag for invoices, liquidations, credit notes and fix the tests for this electronic documents. Forward-Port-Of: odoo/enterprise#59087 Forward-Port-Of: odoo/enterprise#58932
Original PR description
- In PR #54687, a currency tag label "moneda" was added for all electronic documents and in the wrong position. - Fix the position to add the "moneda" tag for invoices, liquidations, credit notes and fix the tests for this electronic documents. Forward-Port-Of: odoo/enterprise#59087 Forward-Port-Of: odoo/enterprise#58932
The ir.rule in documents_spreadsheet opens too many doors. With the condition `'|', ('document_id', '=', False)`, the rule result is always `True` for comment threads which are not linked to a document (but linked to a dashboard or a spreadsheet template). Since all rules are OR-ed together, every operation is therefore allowed on threads on dashboards and templates, regardless of the user's rights on the underlying dashboard or template record.. Task: 3822402 Forward-Port-Of: odoo/e
Original PR description
The ir.rule in documents_spreadsheet opens too many doors.
With the condition `'|', ('document_id', '=', False)`, the rule result is always `True` for comment threads which are not linked to a document (but linked to a dashboard or a spreadsheet template).
Since all rules are OR-ed together, every operation is therefore allowed
on threads on dashboards and templates, regardless of the user's rights
on the underlying dashboard or template record..
Task: 3822402
Forward-Port-Of: odoo/enterprise#59200The aim of this commit is to allow the user to make xslx export with custom composite report. Context: The customer made a custom report in which he is calling some other reports. Before this commit: Exporting the report would results in a traceback. This happenned because a keyError is raise when trying to access the `companies` key which isn't present in the dictionnary. The initializers for the `companies` key weren't consistent with each other. In some initializer, the `currenc
Original PR description
The aim of this commit is to allow the user to make xslx export with custom composite report. Context: The customer made a custom report in which he is calling some other reports. Before this commit:…
The aim of this commit is to allow the user to make xslx export with custom composite report. Context: The customer made a custom report in which he is calling some other reports. Before this commit: Exporting the report would results in a traceback. This happenned because a keyError is raise when trying to access the `companies` key which isn't present in the dictionnary. The initializers for the `companies` key weren't consistent with each other. In some initializer, the `currency_id` key was set. In other, it wasn't. In method `_add_options_xlsx_sheet` only the exact same options were kept before pursuing the operations. As the `currency_id` wasn't set for all the options, it was ignored. After this commit: The file can be exported with success. To solve the `currency_id` key difference issue and prevent it to happen again, we centralize the place where the dictionnaries are created to be sure the exact same keys are set for the `companies` options regardless of how those companies are chosen. opw-3802602 Forward-Port-Of: odoo/enterprise#58777
Sugar tax groups were not present in saas-16.2+ fw-port, due to the new way Chart Templates are handled. https://github.com/odoo/enterprise/pull/50366/files Adding them back now. Old PR for saas-16.2: odoo/enterprise#53209 Task link: http://www.odoo.com/web#id=3569752&model=project.task task-3569752 Forward-Port-Of: odoo/enterprise#59192 Forward-Port-Of: odoo/enterprise#58802
Original PR description
Sugar tax groups were not present in saas-16.2+ fw-port, due to the new way Chart Templates are handled. https://github.com/odoo/enterprise/pull/50366/files Adding them back now. Old PR for saas-16.2: odoo/enterprise#53209 Task link: http://www.odoo.com/web#id=3569752&model=project.task task-3569752 Forward-Port-Of: odoo/enterprise#59192 Forward-Port-Of: odoo/enterprise#58802
In studio, click on the "Automation" menu item. Create, or edit, one base.automation record, and modify some fields. Hit the button "Close" to get out of Studio. Before this commit, the base automation record was not saved. This was because the studio's action service did not receive the clear uncommitted changes from the main one. After this commit, the record is saved when we leave studio. Note that the ViewEditor mode should not be affected as we operate under a clean owl environmen
Original PR description
In studio, click on the "Automation" menu item. Create, or edit, one base.automation record, and modify some fields. Hit the button "Close" to get out of Studio. Before this commit, the base automation record was not saved. This was because the studio's action service did not receive the clear uncommitted changes from the main one. After this commit, the record is saved when we leave studio. Note that the ViewEditor mode should not be affected as we operate under a clean owl environment in StudioView. Forward-Port-Of: odoo/enterprise#59086 Forward-Port-Of: odoo/enterprise#58862
Since this pr: https://github.com/odoo/enterprise/pull/51954, multiples test from test_company_branch were failing due to access rights. The reason is that in l10n_ma_report, we used a function called _get_reconciled_payments, that is a helper to retrieve the reconciled payments on a journal entry. This method will call _get_reconciled_amls (to retrieve the reconciled move lines on a journal entry) and then return the payment_id from the move. When being in the branch environment with an i
Original PR description
Since this pr: https://github.com/odoo/enterprise/pull/51954, multiples test from test_company_branch were failing due to access rights. The reason is that in l10n_ma_report, we used a function called _get_reconciled_payments, that is a helper to retrieve the reconciled payments on a journal entry. This method will call _get_reconciled_amls (to retrieve the reconciled move lines on a journal entry) and then return the payment_id from the move. When being in the branch environment with an invoice from the branch and a refund from the root company, doing the reconciliation between the two will cause an access right error. The way we solved this, is to add a sudo so that we can access the move without having an error. Task: 3802369 Forward-Port-Of: odoo/enterprise#59105
Impacted Version: - 17.0 and above This commit improve below features: - Create statement of account reports in follow-up reports task-3610441 Forward-Port-Of: odoo/enterprise#52098
Original PR description
Impacted Version: - 17.0 and above This commit improve below features: - Create statement of account reports in follow-up reports task-3610441 Forward-Port-Of: odoo/enterprise#52098
Link the brand new documentation in the settings. PR note: starting in saas-16.1 we can use `documentation=` instead.  Forward-Port-Of: odoo/enterprise#48340 Forward-Port-Of: odoo/enterprise#48040
Original PR description
Link the brand new documentation in the settings. PR note: starting in saas-16.1 we can use `documentation=` instead.  Forward-Port-Of: odoo/enterprise#48340 Forward-Port-Of: odoo/enterprise#48040