Wednesday, June 26, 2024
28 changes · saas-17.2
Enhancements to existing features
This update improves and fixes Odoo's internal testing tools, especially the HOOT test framework used by developers to validate product behavior. It helps catch issues earlier and makes tests more predictable, reducing the risk of faulty changes reaching users.
Original PR description
## Pull Request HOOT (PRHOOT) - part 17 Part 1: https://github.com/odoo/odoo/pull/152930 Part 2: https://github.com/odoo/odoo/pull/153018 Part 3: https://github.com/odoo/odoo/pull/153023 Part 4:…
## Pull Request HOOT (PRHOOT) - part 17 Part 1: https://github.com/odoo/odoo/pull/152930 Part 2: https://github.com/odoo/odoo/pull/153018 Part 3: https://github.com/odoo/odoo/pull/153023 Part 4: https://github.com/odoo/odoo/pull/153203 Part 5: https://github.com/odoo/odoo/pull/153425 Part 6: https://github.com/odoo/odoo/pull/153700 Part 7: https://github.com/odoo/odoo/pull/154054 Part 8: https://github.com/odoo/odoo/pull/154579 Part 9: https://github.com/odoo/odoo/pull/155073 Part 10: https://github.com/odoo/odoo/pull/155639 Part 11: https://github.com/odoo/odoo/pull/156255 / https://github.com/odoo/enterprise/pull/58135 Part 12: https://github.com/odoo/odoo/pull/156869 Part 13: https://github.com/odoo/odoo/pull/158384 / https://github.com/odoo/enterprise/pull/59019 Part 14: https://github.com/odoo/odoo/pull/158916 Part 15: https://github.com/odoo/odoo/pull/160292 / https://github.com/odoo/enterprise/pull/59971 Part 15.5: https://github.com/odoo/odoo/pull/166463 Part 16: https://github.com/odoo/odoo/pull/166311 This pull requests brings various improvements and fixes to Hoot and the Odoo unit test ecosystem. See the different commit messages for more details. Note: these changes are made in stable to avoid having to support multiple versions of the HOOT API. As such, these changes are intended to be strictly limited to unit tests as to not put the rest of the code base at risk. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
Peruvian electronic invoices now show the configured QR code correctly when generated for printing or sending. This helps companies meet local invoice presentation requirements and avoids missing payment or validation information on customer documents.
Original PR description
**Steps to reproduce:** - Install Accounting and l10n_pe_edi - Switch to a Peruvian company (e.g. PE Company) - In Accounting settings, select "SUNAT" as Signature Provider and activate "QR Codes" option - Create an invoice for a Peruvian contact - Sent the invoice to Peru UBL 2.1 - Generate the invoice via "Send & Print" button **Issue:** The QR code doesn't appear on the invoice. **Cause:** There's a condition on the parent element of the QR element that checks if "spot" is defined. **Solution:** The display of the QR code should be independent of the "spot" variable. opw-3990721
Miscellaneous changes
Issue --> With a large number of `account.move.line` and `pos.order.line` records, methods `_get_tax_details`, `_get_gstr1_hsn_json` and `_set_details_pos_lines` do not perform well. Solution --> In `_get_tax_details` --> Replace the journal items recordset with a set of ids to do deletions. Move the fetch to when it is actually needed. In `_get_gstr_hsn_json` --> Prefetch the l10n_in_code values on `uom.uom` records that are used in the for loop. This optimization prevents add
Original PR description
Issue --> With a large number of `account.move.line` and `pos.order.line` records, methods `_get_tax_details`, `_get_gstr1_hsn_json` and `_set_details_pos_lines` do not perform well. Solution --> In…
Issue --> With a large number of `account.move.line` and `pos.order.line` records, methods `_get_tax_details`, `_get_gstr1_hsn_json` and `_set_details_pos_lines` do not perform well. Solution --> In `_get_tax_details` --> Replace the journal items recordset with a set of ids to do deletions. Move the fetch to when it is actually needed. In `_get_gstr_hsn_json` --> Prefetch the l10n_in_code values on `uom.uom` records that are used in the for loop. This optimization prevents additional hits to the backend. In `_set_details_pos_lines` --> Fetch `product.product` records and all the `uom.uom` records before the for loop to prevent additional hits to the backend when trying to fetch `product_id.type`, `product_id.l10n_in_hsn_code` and `product_uom_id.l10n_in_code` Benchmark --> For about 110k journal items and 95k pos order lines, the current implementation takes about 2800 seconds to finish computation. After the fix, the process takes about 300 seconds to finish. opw-3895401 Forward-Port-Of: odoo/enterprise#64986 Forward-Port-Of: odoo/enterprise#62305
This change fixes memory leaks that occurred while running JavaScript unit tests for the web module. It helps keep automated test runs more stable and efficient, reducing the risk of slowdowns or failures during development validation.
Original PR description
This PR clears a few retainers that would leak memory during the execution of JS unit tests. Backport of https://github.com/odoo/odoo/pull/170885 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Only load relevant MOs based on the workcenters that are shown in the view and reintroduce a limit to the amount of MOs that can be loaded simultaneously into the view. task-3895017 Forward-Port-Of: odoo/enterprise#65139 Forward-Port-Of: odoo/enterprise#64551
Original PR description
Only load relevant MOs based on the workcenters that are shown in the view and reintroduce a limit to the amount of MOs that can be loaded simultaneously into the view. task-3895017 Forward-Port-Of: odoo/enterprise#65139 Forward-Port-Of: odoo/enterprise#64551
### Steps to reproduce: - Enable multi-step routes in the settings - Inventory > Configuration > Warehouse Management > Operations types - Click on Manufacturing and put "Always" on create a backorder - Create a product P (no need for a bom) - Create and confirm a manufacturing order for 2 units of the product - Go to the barcode module > operations > manufacturing > the MO - Register only one unit of P and produce #### > A backorder is automatically created but you are redirected to
Original PR description
### Steps to reproduce: - Enable multi-step routes in the settings - Inventory > Configuration > Warehouse Management > Operations types - Click on Manufacturing and put "Always" on create a…
### Steps to reproduce: - Enable multi-step routes in the settings - Inventory > Configuration > Warehouse Management > Operations types - Click on Manufacturing and put "Always" on create a backorder - Create a product P (no need for a bom) - Create and confirm a manufacturing order for 2 units of the product - Go to the barcode module > operations > manufacturing > the MO - Register only one unit of P and produce #### > A backorder is automatically created but you are redirected to the backend. Note: If you were in "ask" on create backorder or if your product had a bom and you did not register the quantities of consumed components, a pop up would appear and resolving the pop up would redirect you to the kanban view of mrp.production in the barcode module. ### Cause of the issue: The `validate` method called by clicking will execute the action if the orm call returns one and adds an 'onClose' call to its options: https://github.com/odoo/enterprise/blob/661fd61c0f50d4bf80484227c92a3fd0b9a05c68/stock_barcode/static/src/models/barcode_model.js#L475-L482 https://github.com/odoo/enterprise/blob/661fd61c0f50d4bf80484227c92a3fd0b9a05c68/stock_barcode/static/src/models/barcode_model.js#L487-L492 If the action is a popup, the onClose method will be called once the pop up is resolved. However, if the action redirects you directly to the form view of the mrp.propduction the onClose method will not be triggered and you will not be redirected to the kanban view. ### Fix: As pop ups are the only actions that we really want to trigger during the validate call we exclude actions from the base models (stock.picking and mrp.production) to avoid any redirection to the backend. #### Follow up of commit 6915741 ## opw-3890886 Forward-Port-Of: odoo/enterprise#64850
With this commit: https://github.com/odoo/odoo/pull/166896/commits/90088bd97ec096fa8c360868e3a1addef91bd4ce We automatically add the country of the chart template to the company if the company does not have one by default. This change had a side effect that in the context of the test "TestPeSales," the boolean field l10n_latam_use_documents on the journal was now set to True. The consequence of that was that the constraint _check_l10n_latam_documents was breaking since this constraint chec
Original PR description
With this commit: https://github.com/odoo/odoo/pull/166896/commits/90088bd97ec096fa8c360868e3a1addef91bd4ce We automatically add the country of the chart template to the company if the company does not have one by default. This change had a side effect that in the context of the test "TestPeSales," the boolean field l10n_latam_use_documents on the journal was now set to True. The consequence of that was that the constraint _check_l10n_latam_documents was breaking since this constraint checks that for the posted moves that use documents, the move must have a document type and a document number. task: 3945833 Forward-Port-Of: odoo/enterprise#64991
Following the doc https://www.europeanpaymentscouncil.eu/sites/default/files/kb/file/2023-11/EPC132-08%20SCT%20C2PSP%20IG%202023%20V1.1.pdf , InitgPty/Id is not required in the XML file. We used to block the generation if we had no value to put in it; not anymore. opw-3985622 Forward-Port-Of: odoo/enterprise#65255 Forward-Port-Of: odoo/enterprise#65214
Original PR description
Following the doc https://www.europeanpaymentscouncil.eu/sites/default/files/kb/file/2023-11/EPC132-08%20SCT%20C2PSP%20IG%202023%20V1.1.pdf , InitgPty/Id is not required in the XML file. We used to block the generation if we had no value to put in it; not anymore. opw-3985622 Forward-Port-Of: odoo/enterprise#65255 Forward-Port-Of: odoo/enterprise#65214
### Issue: The VAT lines in tax reports do not populate correctly. ### Steps to reproduce: - Activate l10n_es module - Go to Accounting > Reporting > Statement Reports > Tax Report - Select a 'Generic Tax Report' and click on 'VAT Record Books (XLSX)' - In the report, only Spain and partners without countries have a NIF number ### Cause: A line of code is only populating the NIF field in the report if the partner has no country or if the country is Spain. In addition, other lines
Original PR description
### Issue: The VAT lines in tax reports do not populate correctly. ### Steps to reproduce: - Activate l10n_es module - Go to Accounting > Reporting > Statement Reports > Tax Report - Select a 'Generic Tax Report' and click on 'VAT Record Books (XLSX)' - In the report, only Spain and partners without countries have a NIF number ### Cause: A line of code is only populating the NIF field in the report if the partner has no country or if the country is Spain. In addition, other lines related to the NIF are not populated as they should. ### Solution: Add conditions to populate the NIF lines as the specs demands it. Specs: https://sede.agenciatributaria.gob.es/static_files/AEAT/LSI.xlsx (second point) opw-3918623 Forward-Port-Of: odoo/enterprise#63923
**Before this PR:** There were no test cases written for the following three GST treatments: deemed export, composition and UIN holder. **After this PR:** Test cases have been added for the deemed export, composition and UIN holder GST treatments. **task**-3892511 Forward-Port-Of: odoo/enterprise#65344 Forward-Port-Of: odoo/enterprise#63333
Original PR description
**Before this PR:** There were no test cases written for the following three GST treatments: deemed export, composition and UIN holder. **After this PR:** Test cases have been added for the deemed export, composition and UIN holder GST treatments. **task**-3892511 Forward-Port-Of: odoo/enterprise#65344 Forward-Port-Of: odoo/enterprise#63333
Steps to reproduce: - Install Helpdesk - Create two internal user with admin access to Helpdesk - Log as the first user and create a ticket for the second user with empty phone Issues: An access error is shown as we do not have the rights to write on the partner phone. To fix this issue a sudo was added as well as a filter in the inverse to make sure we skip ticket without a partner phone in the inverse. opw-3989614 Forward-Port-Of: odoo/enterprise#65289 Forward-Port-Of: odoo/enterpri
Original PR description
Steps to reproduce: - Install Helpdesk - Create two internal user with admin access to Helpdesk - Log as the first user and create a ticket for the second user with empty phone Issues: An access error is shown as we do not have the rights to write on the partner phone. To fix this issue a sudo was added as well as a filter in the inverse to make sure we skip ticket without a partner phone in the inverse. opw-3989614 Forward-Port-Of: odoo/enterprise#65289 Forward-Port-Of: odoo/enterprise#64860
Problem --- In the accounting dashboard, when going to Bank > Payments draft and cancelled payments are not filtered out by default. This makes the amount displayed on the kanban card inconsistent with the sum of the payments that are shown by default. opw-3978180 Forward-Port-Of: odoo/enterprise#65274
Original PR description
Problem --- In the accounting dashboard, when going to Bank > Payments draft and cancelled payments are not filtered out by default. This makes the amount displayed on the kanban card inconsistent with the sum of the payments that are shown by default. opw-3978180 Forward-Port-Of: odoo/enterprise#65274
## Steps to reproduce: - Install **Timesheets** and **payroll** apps. - Create a copy of the (**Standard 40 hours/week**) working schedule but remove **Wednesday** working hours. - Create a new **employee**, and set his Working Hours to the newly created working schedule. - Create a new **_running_** **contract** for the newly created employee with the newly created working schedule. - Go to **Timesheets** app, and search for the newly created employee. - **Add a line** for a project and r
Original PR description
## Steps to reproduce: - Install **Timesheets** and **payroll** apps. - Create a copy of the (**Standard 40 hours/week**) working schedule but remove **Wednesday** working hours. - Create a new…
## Steps to reproduce: - Install **Timesheets** and **payroll** apps. - Create a copy of the (**Standard 40 hours/week**) working schedule but remove **Wednesday** working hours. - Create a new **employee**, and set his Working Hours to the newly created working schedule. - Create a new **_running_** **contract** for the newly created employee with the newly created working schedule. - Go to **Timesheets** app, and search for the newly created employee. - **Add a line** for a project and register 8 hours in each day from Monday to Saturday. - Switch the view to Day, Notice how for both Wednesday and Saturday, no overtime is shown. +08:00 should be shown for each as both are non-working days per the newly created working schedule. **(Issue 2)** ## Investigation: - The overtime text comes from https://github.com/odoo/enterprise/blob/1720b5578998b28c91c6820a63ecbd397297c47f/timesheet_grid/static/src/components/employee_overtime_indication/employee_overtime_indication.xml#L8 using `overtimeIndication()` getter https://github.com/odoo/enterprise/blob/1720b5578998b28c91c6820a63ecbd397297c47f/timesheet_grid/static/src/components/employee_overtime_indication/employee_overtime_indication.js#L34 - For the off days - (Wed, Sat, Sun) in our example -, the `allocated_hours` (`this.props.allocated_hours`) = ZERO - And so `shouldShowHours()` returns `false` https://github.com/odoo/enterprise/blob/1720b5578998b28c91c6820a63ecbd397297c47f/timesheet_grid/static/src/components/employee_overtime_indication/employee_overtime_indication.js#L19-L21 - which makes `overtimeIndication()` returns null. That's why no overtime text is shown for off-days - Note that `allocated_hours` is `undefined` for rows that represent employee hours of the current week opw-3718279 Forward-Port-Of: odoo/enterprise#63526 Forward-Port-Of: odoo/enterprise#60048
When posting a big invoice (>800 lines) for products that are valuated in real_time, the `_post` override in `purchase_stock` can become a bottleneck for anglo-saxon companies. This method calls `_stock_account_anglo_saxon_reconcile_valuation` which performs reconciliations for all the invoice_lines. Thanks to odoo/odoo#113680 it's now possible to batch the reconciliation process via the backend method `_reconcile_plan`. This gives various speedups by batching create, reducing the number of
Original PR description
When posting a big invoice (>800 lines) for products that are valuated in real_time, the `_post` override in `purchase_stock` can become a bottleneck for anglo-saxon companies. This method calls…
When posting a big invoice (>800 lines) for products that are valuated in real_time, the `_post` override in `purchase_stock` can become a bottleneck for anglo-saxon companies. This method calls `_stock_account_anglo_saxon_reconcile_valuation` which performs reconciliations for all the invoice_lines. Thanks to odoo/odoo#113680 it's now possible to batch the reconciliation process via the backend method `_reconcile_plan`. This gives various speedups by batching create, reducing the number of flush, etc. Moving the reconciliation process outside of the loops in `_stock_account_anglo_saxon_reconcile_valuation` and calling `_reconcile_plan` only at the end of the method gives a significant speedup for big invoices. #### speedup Customer database with mix of real_time and manual inventory valuation and anglo-saxon accounting. purchase_stock is installed. 15 000 products, 80 000 stock.moves, 66 000 stock.move.lines, 100 000 account.moves, 289 000 account.move.line. Time to post an invoice changing the number of lines. | # Lines | Before PR | After PR | |:-------:|:------------------------:|:--------:| | 10 | 1.66s | 1.11s | | 50 | 8.53s | 2.95s | | 200 | 1min30s | 11.51s | | 889 | +20min (killed) | 58.84s | opw-3901468 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#169825 Forward-Port-Of: odoo/odoo#166482
This commit fixes a bug where there would be a traceback occuring when the user would either create a favorite with a name that already exists or one with an empty name by pressing enter instead of save. The crash occurs because the keydown event is not passed to saveFavorite and in these cases, saveFavorite will invoke stopPropagation on an undefined event. Solution: pass the event to saveFavorite. Forward-Port-Of: odoo/odoo#170551 Forward-Port-Of: odoo/odoo#170320
Original PR description
This commit fixes a bug where there would be a traceback occuring when the user would either create a favorite with a name that already exists or one with an empty name by pressing enter instead of save. The crash occurs because the keydown event is not passed to saveFavorite and in these cases, saveFavorite will invoke stopPropagation on an undefined event. Solution: pass the event to saveFavorite. Forward-Port-Of: odoo/odoo#170551 Forward-Port-Of: odoo/odoo#170320
Problem: A recent commit (below) added carriage return characters to the .pot file for new `deleteConfirmationMessage` popup. Since the value of the string itself doesn't contain these characters, we'll never see a translation for this popup. Purpose: Revert .pot msgid back to its previous state. FW commit /pull/162106/commits/50f9df296c44d3c86bc251a67944bb0ce36a154e opw-3954024 Forward-Port-Of: odoo/odoo#169688
Original PR description
Problem: A recent commit (below) added carriage return characters to the .pot file for new `deleteConfirmationMessage` popup. Since the value of the string itself doesn't contain these characters, we'll never see a translation for this popup. Purpose: Revert .pot msgid back to its previous state. FW commit /pull/162106/commits/50f9df296c44d3c86bc251a67944bb0ce36a154e opw-3954024 Forward-Port-Of: odoo/odoo#169688
Since [1], `opacity` needs to be a number as defined in ColorPlaette's props definition. However, in the ColorpickerUserValueWidget, when the props is passed to the ColorPalette component, it is given from the dataAttributes, which are strings. This leads to a crash in debug mode as the types are miss-matching. This commit fixes that by parsing the dataAttribute to float. [1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997#diff-c4e4c8cbbe59c3e61eba1cdcfd8f2380
Original PR description
Since [1], `opacity` needs to be a number as defined in ColorPlaette's props definition. However, in the ColorpickerUserValueWidget, when the props is passed to the ColorPalette component, it is given from the dataAttributes, which are strings. This leads to a crash in debug mode as the types are miss-matching. This commit fixes that by parsing the dataAttribute to float. [1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997#diff-c4e4c8cbbe59c3e61eba1cdcfd8f23809818a0b78c118d84606a1ab5d7bf1203 task-4001189 Forward-Port-Of: odoo/odoo#170092
The COGS registered was wrong when invoicing a product that is a kit with UOM A and component uses UOM B. Steps to reproduce: ------------------- * Create Comp A with UOM Dozens. It's cost should be 12000 * Create Product A with UOM Units. * Make sure both use the same category, and the category should use automcatic inventory valuation. * Create a kit bom for product A that contains 1 comp A. * Sell this kit in the PoS and invoice it. * Close the PoS and go to the order then on th
Original PR description
The COGS registered was wrong when invoicing a product that is a kit with UOM A and component uses UOM B. Steps to reproduce: ------------------- * Create Comp A with UOM Dozens. It's cost should be…
The COGS registered was wrong when invoicing a product that is a kit with UOM A and component uses UOM B. Steps to reproduce: ------------------- * Create Comp A with UOM Dozens. It's cost should be 12000 * Create Product A with UOM Units. * Make sure both use the same category, and the category should use automcatic inventory valuation. * Create a kit bom for product A that contains 1 comp A. * Sell this kit in the PoS and invoice it. * Close the PoS and go to the order then on the invoice. * Check the journal items > Observation: the COGS is 12000 it's wrong. It should be 1000 Why the fix: ------------ The `_get_pos_anglo_saxon_price_unit` is not taking the product uom into account. So in this example the price unit will be for a dozen, but the bom specifies that we are using a unit and not a dozen. So the quantity needs to be modified from a dozen to unit. That's what the `_compute_price` method is doing. opw-3787201 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#170267 Forward-Port-Of: odoo/odoo#166382
Before this commit, when creating a company and directly installing a chart template without putting a country first, the installation of the chart template was giving a traceback. By updating the country of the company by the one of the chart template, the issues will not happen again. task: 3945833 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#166896
Original PR description
Before this commit, when creating a company and directly installing a chart template without putting a country first, the installation of the chart template was giving a traceback. By updating the country of the company by the one of the chart template, the issues will not happen again. task: 3945833 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#166896
Description of the Issue/Feature Addressed by This PR: This pull request addresses translation issues related to a string defined in JavaScript code. Previously, the string was incorrectly formatted, making it unlocatable for the translation files. The proposed solution ensures that Odoo can now accurately translate the string. Current Behavior Before PR: In the point of sale, when attempting to close a session with a closing difference exceeding the maximum, a popup displays two sentence
Original PR description
Description of the Issue/Feature Addressed by This PR: This pull request addresses translation issues related to a string defined in JavaScript code. Previously, the string was incorrectly formatted,…
Description of the Issue/Feature Addressed by This PR: This pull request addresses translation issues related to a string defined in JavaScript code. Previously, the string was incorrectly formatted, making it unlocatable for the translation files. The proposed solution ensures that Odoo can now accurately translate the string. Current Behavior Before PR: In the point of sale, when attempting to close a session with a closing difference exceeding the maximum, a popup displays two sentences. Unfortunately, these sentences couldn’t be translated due to an improperly formatted string in the JavaScript. The translation files were unable to identify the string. Desired Behavior After PR Is Merged: The corrected string enables Odoo to perform accurate translations. The change has been implemented following an example from another well-formed string in the code.  Now the text displayed in the pop up will be translated without problems.  --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#168952 Forward-Port-Of: odoo/odoo#160303
### Steps to reproduce: - Enable Batch Transfers in the settings - Go to Inventory > Config> Warehouse Management > Operation Types - On receipts, enable "Automatic Batches" group by contact - Create and confirm a purchase order for any contact with: - 1 X storable product P1 - Create and confirm a purchase order for the same contact with: - 1 X storable product P1 - 1 x storable product P2 - Go to the assocated stock picking > change the quantity of P1 to 0 - Validate and cre
Original PR description
### Steps to reproduce: - Enable Batch Transfers in the settings - Go to Inventory > Config> Warehouse Management > Operation Types - On receipts, enable "Automatic Batches" group by contact - Create…
### Steps to reproduce: - Enable Batch Transfers in the settings - Go to Inventory > Config> Warehouse Management > Operation Types - On receipts, enable "Automatic Batches" group by contact - Create and confirm a purchase order for any contact with: - 1 X storable product P1 - Create and confirm a purchase order for the same contact with: - 1 X storable product P1 - 1 x storable product P2 - Go to the assocated stock picking > change the quantity of P1 to 0 - Validate and create a backorder #### > invalid operation: The following transfers cannot be added to batch ### Cause of the issue: When the backorder is processed, the stock picking that currently belongs to our batch is validated and a backorder is created: https://github.com/odoo/odoo/blob/f168c4ba9d64a05a4a55715c44016a15230fe706/addons/stock/models/stock_move.py#L1891-L1892 The picking associated to this backorder is then added to our batch https://github.com/odoo/odoo/blob/f168c4ba9d64a05a4a55715c44016a15230fe706/addons/stock_picking_batch/models/stock_picking.py#L160-L162 But for this action to be performed, we need to pass the sanity check verifying that the pickings associated to our batch are allowed: https://github.com/odoo/odoo/blob/f168c4ba9d64a05a4a55715c44016a15230fe706/addons/stock_picking_batch/models/stock_picking_batch.py#L282-L286 And here comes the problem, the picking that created the backorder was not yet removed from our batch but is not allowed anymore since it is now in 'done' state: https://github.com/odoo/odoo/blob/f168c4ba9d64a05a4a55715c44016a15230fe706/addons/stock_picking_batch/models/stock_picking_batch.py#L76-L77 opw-3893543 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#163935
Before this commit: The version of the IoT was ambiguous and was needed to be updated manually for windows. As windows IoT does not have the concept of "image" (as it depends on the installer build) the version should give this information. This information can be found in odoo release.py file Benefit from this PR to add more details on the IoT box version to also give more information as an IoT box can be on a certain image and "code release" independently. The image shown on the homepage
Original PR description
Before this commit: The version of the IoT was ambiguous and was needed to be updated manually for windows. As windows IoT does not have the concept of "image" (as it depends on the installer build) the version should give this information. This information can be found in odoo release.py file Benefit from this PR to add more details on the IoT box version to also give more information as an IoT box can be on a certain image and "code release" independently. The image shown on the homepage is the same as before, but the detailed/revision information is now sent to the odoo's synced server in order to be visible and used by the support After this commit: Windows IoT version: - Before: W22_11 - After: W22.11 (detailed version: `W22.11-16.0+e-20240412` ) IoT box version: - Before: 24.01 - After: L24.01 (detailed version: `L24.01-16.0#71bd27465` ) Forward-Port-Of: odoo/odoo#169368 Forward-Port-Of: odoo/odoo#163697
When using a cover page with a duplex letter, it would print the content of the letter behind the cover page due to an extra blank page missing. Using Unicode characters in the address would result in black boxes. This is fixed by using the Lato font provided by the web module. Forward-Port-Of: odoo/odoo#170282 Forward-Port-Of: odoo/odoo#155752
Original PR description
When using a cover page with a duplex letter, it would print the content of the letter behind the cover page due to an extra blank page missing. Using Unicode characters in the address would result in black boxes. This is fixed by using the Lato font provided by the web module. Forward-Port-Of: odoo/odoo#170282 Forward-Port-Of: odoo/odoo#155752
### Steps to reproduce: - Create a product SP tracked by lots - Click on "on hand" and create a lot with 10 units on hand - Create and validate picking for 1 x any other product - Unlock the delivery - Add a line (stock move) for 1 x SP - Click on the list icon of the line and set your lot - Save the picking - Go to the on hand quantity of SP #### > 1 unit was reserved even though the move is 'done' ### Cause of the issue: Creating the stock move line associating the lot to th
Original PR description
### Steps to reproduce: - Create a product SP tracked by lots - Click on "on hand" and create a lot with 10 units on hand - Create and validate picking for 1 x any other product - Unlock the delivery…
### Steps to reproduce: - Create a product SP tracked by lots - Click on "on hand" and create a lot with 10 units on hand - Create and validate picking for 1 x any other product - Unlock the delivery - Add a line (stock move) for 1 x SP - Click on the list icon of the line and set your lot - Save the picking - Go to the on hand quantity of SP #### > 1 unit was reserved even though the move is 'done' ### Cause of the issue: Creating the stock move line associating the lot to the stock move will update the reserved quantity of stock quants independently of the state of the move created: https://github.com/odoo/odoo/blob/347c7e21002313da155ebf872853078de23b38fe/addons/stock/models/stock_move_line.py#L337-L343 https://github.com/odoo/odoo/blob/347c7e21002313da155ebf872853078de23b38fe/addons/stock/models/stock_move.py#L1525-L1528 opw-3906472 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#170304 Forward-Port-Of: odoo/odoo#166186
Currently when applying a coupon for 10% on the order on the current order, the points awarded are 100% of the points instead of 90%. The loyalty program rewarding x points per $ spent. The same behavior is also observed in the sale worflow. Steps to reproduce: ------------------- * Go to the **Point of Sale** App * Open shop session * Select a customer * Add a product (ex. Office chair 70$) * Select **Enter Code** * Enter the code `10pc` > Observation: The order will grant 700 poi
Original PR description
Currently when applying a coupon for 10% on the order on the current order, the points awarded are 100% of the points instead of 90%. The loyalty program rewarding x points per $ spent. The same…
Currently when applying a coupon for 10% on the order on the current order, the points awarded are 100% of the points instead of 90%. The loyalty program rewarding x points per $ spent.
The same behavior is also observed in the sale worflow.
Steps to reproduce:
-------------------
* Go to the **Point of Sale** App
* Open shop session
* Select a customer
* Add a product (ex. Office chair 70$)
* Select **Enter Code**
* Enter the code `10pc`
> Observation: The order will grant 700 points instead of 630. The amount paid is 63$ with the code for 10% on the order.
Settings of the **Discount & Loyalties**:
* **Code for 10% on orders**
* Rule:
* `Among` -> no restriction set
* `Minimum quantity`: 1
* `Minimum Purchase`: 0
* Reward:
* `Discount`: 10% `on` order
* **Loyalty Program**
* `Use points on`: Current & Future orders
* Rule:
* `Among` -> no restriction set
* `Minimum quantity`: 1
* `Minimum Purchase`: 0
* `Grant` 10 loyalty poins per $ spent
Idea of the fix
---------------
As discussed with DALA, discount should count toward points awarded. Here is how it should apply:
* If program_rule has no domain, all lines should count (except ewallet & gift cards)
* If program_rule has a domain, we should use all the lines where the product matches the domain (except ewallet & gift cards)
This applies for the computation of points based on the money spent.
Why the fix:
------------
https://github.com/odoo/odoo/blob/2f6f8014f79e1db53d6c4c27e0cc60ccd48fd301/addons/sale_loyalty/models/sale_order.py#L917
Sale-wise, we replace `rule_products` with `so_products_per_rule.get(rule, [])`. We also replace `order_lines` by `lines_per_rule`.
* `rule_products` don't include discounts as they are computed on `order_lines` (all lines that are not reward lines). https://github.com/odoo/odoo/blob/2f6f8014f79e1db53d6c4c27e0cc60ccd48fd301/addons/sale_loyalty/models/sale_order.py#L834-L841 https://github.com/odoo/odoo/blob/2f6f8014f79e1db53d6c4c27e0cc60ccd48fd301/addons/sale_loyalty/models/sale_order.py#L889
* `so_products_per_rule` will include the discounts if they match with the program's domain.
https://github.com/odoo/odoo/blob/2f6f8014f79e1db53d6c4c27e0cc60ccd48fd301/addons/sale_loyalty/models/sale_order.py#L844
* We don't need to exclude the free product reward lines from `lines_for_points` as the price is 0 on the SO. Shipping lines and free shipping rewards are not counted.
In pos, the fix is a bit different.
https://github.com/odoo/odoo/blob/4b9dee8fbe9aefde798c8543fef89c661cc85c57/addons/pos_loyalty/static/src/js/Loyalty.js#L908-L914
We first notice that this piece of code is never triggered as the structure of `program.id` is a number and `reward.program_id` is the following thus the last if statement is never true. A `.id` is added.
```
Proxy(Object) {id: 1, name: 'Code for 10% on orders', trigger: 'with_code', applies_on: 'current', program_type: 'promo_code', …}
```
This now means that we only count reward lines if they are from the same program.
With the following if statement, it means that only the lines that are not reward lines are counted (which excludes discounts).
https://github.com/odoo/odoo/blob/eadfa4ee290a8b62956097aa66989eacff230275/addons/pos_loyalty/static/src/js/Loyalty.js#L921-L924
We conclude that those two ifs must be changed as we want a similar behavior as the workflow in sales.
We remove `orderedProductPaid` out of the if statement since it can be impacted by reward lines. We change the first if to excludes the reward lines only from the current program or from ewallet and giftcards. With this, `orderedProductPaid` now counts the discount lines from other program. (Similar to sales, where `amount_paid` is computed with `lines_per_rule`)
`totalProductQty` still applies only on non reward lines. (Same as sales)
opw-3858286
Forward-Port-Of: odoo/odoo#170391
Forward-Port-Of: odoo/odoo#164723-Before this commit, when user has no expense at all and in mobile view of expense, it will display term "Or" alongside with "Snap pictures of your receipts..." -After this commit, remove term "Or". Description of the issue/feature this PR addresses: Current behavior before PR:  Desired behavior after PR is merged:  Desired behavior after PR is merged:  --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#170460
### Steps to reproduce - Install project. - Create 2 projects one with timesheets and the second without timesheets. - Open the project without time sheets. - Observe that there are timesheet filters even if the timesheets are disabled. ### Issue: Timesheet filters are available for project tasks even though the project is not using the timesheets. ### Cause: Filters were missing some conditions to enable only when timesheets are available. ### Solution: Corrected the timesheet
Original PR description
### Steps to reproduce - Install project. - Create 2 projects one with timesheets and the second without timesheets. - Open the project without time sheets. - Observe that there are timesheet filters even if the timesheets are disabled. ### Issue: Timesheet filters are available for project tasks even though the project is not using the timesheets. ### Cause: Filters were missing some conditions to enable only when timesheets are available. ### Solution: Corrected the timesheet-related filters so they are only available for the project tasks which use the timesheets. Note: When we refresh the page, filters become visible because the context is lost. task-3754591 Forward-Port-Of: odoo/odoo#170001 Forward-Port-Of: odoo/odoo#155186
**[IMP] website: match navbar toggler color to overlay header text color** Before this commit, the navbar hamburger button didn't have the same color as the text color defined for the "Over The Content" header, which led to situations where it wasn't visible. Steps to reproduce: - Go to the website edit mode. - Click on the header and choose "Over The Content" for the "Header Position" option. - Use the color picker to set the "Text Color" option to white. - Drag and drop a "Text-
Original PR description
**[IMP] website: match navbar toggler color to overlay header text color** Before this commit, the navbar hamburger button didn't have the same color as the text color defined for the "Over The…
**[IMP] website: match navbar toggler color to overlay header text color** Before this commit, the navbar hamburger button didn't have the same color as the text color defined for the "Over The Content" header, which led to situations where it wasn't visible. Steps to reproduce: - Go to the website edit mode. - Click on the header and choose "Over The Content" for the "Header Position" option. - Use the color picker to set the "Text Color" option to white. - Drag and drop a "Text-Image" snippet onto the page. - Apply a dark background color to the "Text-Image" snippet. - Click on the "Mobile Preview" button. => The navbar hamburger button is not visible in the header. After this commit, the navbar hamburger button in the "Over The Content" header matches the color of the header's text. task-3853573 --------------------------------- **[FIX] website: hide the overlay on the mobile menu navbar toggler** Before this commit, after clicking on the mobile menu navbar toggler in Website edit mode, the blue overlay was covering the button. This commit fixes this. Indeed, this element is not editable, so there's no need for an overlay on it. task-3853573 Forward-Port-Of: odoo/odoo#163139