Friday, July 26, 2024
17 changes · saas-17.2
Miscellaneous changes
Steps to reproduce: ------------------- - Install `data_merge` and `CRM` module - Go to CRM and create 2 opportunities with same name - Activate debug mode and go to `Scheduled Actions` - Run `Data Merge: Find Duplicate Records` action - Go to Discuss and click on `History` channel Issue: ------ Error: `Record does not exist or has been deleted.`. Cause: ------ When uninstalling a module that have a model that is used as `res_model_id` in a `Deduplication Model`, we do not
Original PR description
Steps to reproduce: ------------------- - Install `data_merge` and `CRM` module - Go to CRM and create 2 opportunities with same name - Activate debug mode and go to `Scheduled Actions` - Run `Data Merge: Find Duplicate Records` action - Go to Discuss and click on `History` channel Issue: ------ Error: `Record does not exist or has been deleted.`. Cause: ------ When uninstalling a module that have a model that is used as `res_model_id` in a `Deduplication Model`, we do not remove message the message linked to the record deleted. Therefore, when opening history channel, we try to access messages linked to records that might have been deleted. Solution: --------- When removing `Deduplication Model`, also remove the messages linked to the record. opw-3906945 Forward-Port-Of: odoo/enterprise#67094 Forward-Port-Of: odoo/enterprise#64906
**[FIX] stock_barcode_picking_batch: scan lots with multiple pickings** > How to reproduce: > - Create a product tracked by lots and set a barcode for this product; > - Create a receipt for this product, with at least 2 quantities and confirm it; > - Create a second similar receipt (you can duplicate the first one) and confirm it; > - Add these two receipt in a new batch and confirm the batch; > - Go in the Barcode App and open the batch, you should have two lines, one for each picking; >
Original PR description
**[FIX] stock_barcode_picking_batch: scan lots with multiple pickings** > How to reproduce: > - Create a product tracked by lots and set a barcode for this product; > - Create a receipt for this…
**[FIX] stock_barcode_picking_batch: scan lots with multiple pickings** > How to reproduce: > - Create a product tracked by lots and set a barcode for this product; > - Create a receipt for this product, with at least 2 quantities and confirm it; > - Create a second similar receipt (you can duplicate the first one) and confirm it; > - Add these two receipt in a new batch and confirm the batch; > - Go in the Barcode App and open the batch, you should have two lines, one for each picking; > - Scan the product -> the first line should be selected; > - Scan a lot -> the lot is set on the first line and its qty is incremented; > - Scan another lot -> the lot is set on the second line and its qty is incremented. That's the issue. > > Expected behavior: When another lot is scanned after the first one, since we are picking quantity for the first picking, the line for the second picking shouldn't be selected until the first one is processed. To fix that, the search for a line following the scan will avoid to take a tracked line if its `picking_id` is not the same than the selected line and if the selected line is not completed. **[FIX] stock_barcode: increment right qty** > When a product tracked by lots is reserved and multiple lots are reserved, in the Barcode App, each line has a "+ qty" button where the quantity is the remaining quantity. That said, this remaining quantity was always computed regarding the difference between the move line's done and reserved quantity which means if the user scans a not reserved lot, those buttons aren't reliable anymore. > > How to reproduce: > - Create a product tracked by lots and set a barcode; > - Update the quantity on hand for this product like following: > - 3x lot1 > - 3x lot2 > - 3x lot3 > - Create a delivery for 6x this product and confirm it; > - Open the delivery in the Barcode App, unfold the line for the tracked product, you should have: > - 0/3 lot1, [+3] > - 0/3 lot2, [+3] > - Scan lot1 one time and lot3 three times, you now have: > - 3 lot3, [+1] > - 1/3 lot1, [+2] > - 0/3 lot2, [+3] > -> Since the total demand is 6 and 4 quantities have been processed, no button should display a quantity greater than 2 since it's the remaining quantity. > > To fix that, the quantity used by the increment button is also computed regarding the parent line's quantity. task-3688770 Forward-Port-Of: odoo/enterprise#67045 Forward-Port-Of: odoo/enterprise#54589
Where possible, we make the eTIMS-specific fields and buttons invisible unless the company has Kenya as fiscal country. Exceptions to this are: - the buttons on partner and user form views. We don't have a way of showing them only if the currently selected company is Kenyan. However, they are already visible only in debug mode, so this isn't too much of a problem. - the 'Custom Imports' menuitem - we don't have a way of making it conditionally visible. Forward-Port-Of: odoo/enterprise#6690
Original PR description
Where possible, we make the eTIMS-specific fields and buttons invisible unless the company has Kenya as fiscal country. Exceptions to this are: - the buttons on partner and user form views. We don't have a way of showing them only if the currently selected company is Kenyan. However, they are already visible only in debug mode, so this isn't too much of a problem. - the 'Custom Imports' menuitem - we don't have a way of making it conditionally visible. Forward-Port-Of: odoo/enterprise#66905
Instead of calling `env.cr.savepoint()` in a loop, which will create a savepoint at every iteration, we should create a single savepoint and rollback to it at the end of every subtest. In Postgres, the number of sub-transactions that may exist in active transactions has a hard limit of 64 before sub-transactions are stored on disk. It's therefore best practice to limit the number of savepoints we create. See also https://github.com/odoo/odoo/pull/167236 Forward-Port-Of: odoo/enterprise#66
Original PR description
Instead of calling `env.cr.savepoint()` in a loop, which will create a savepoint at every iteration, we should create a single savepoint and rollback to it at the end of every subtest. In Postgres, the number of sub-transactions that may exist in active transactions has a hard limit of 64 before sub-transactions are stored on disk. It's therefore best practice to limit the number of savepoints we create. See also https://github.com/odoo/odoo/pull/167236 Forward-Port-Of: odoo/enterprise#66665 Forward-Port-Of: odoo/enterprise#66322
### Before this PR In WhatsApp Composer, the Sample Values do not update when changing the WhatsApp Template. Instead, it display the sample values from the initially selected template. This issue also occurs with the Button URL as well. ### After this PR The Sample Values for Free Text Fields and Button Dynamic URL will now update based on the selected WhatsApp Template. Task-3996935 Forward-Port-Of: odoo/enterprise#66892
Original PR description
### Before this PR In WhatsApp Composer, the Sample Values do not update when changing the WhatsApp Template. Instead, it display the sample values from the initially selected template. This issue also occurs with the Button URL as well. ### After this PR The Sample Values for Free Text Fields and Button Dynamic URL will now update based on the selected WhatsApp Template. Task-3996935 Forward-Port-Of: odoo/enterprise#66892
How to reproduce: ================= - Enable "Storage Locations"; - Create a product with a barcode and add some qty in a sublocation (e.g.: 10 products in Shelf 1); - Create an internal transfer from WH/Stock to WH/Stock for this product for at least 2 qty; - Confirm the internal transfer and open it in the Barcode app; - You can see you have one line, from WH/Stock/Shelf 1 to WH/Stock (if we follow previous example); - Scan one time the product, then scan another location (eg.: shelf2),
Original PR description
How to reproduce: ================= - Enable "Storage Locations"; - Create a product with a barcode and add some qty in a sublocation (e.g.: 10 products in Shelf 1); - Create an internal transfer…
How to reproduce: ================= - Enable "Storage Locations"; - Create a product with a barcode and add some qty in a sublocation (e.g.: 10 products in Shelf 1); - Create an internal transfer from WH/Stock to WH/Stock for this product for at least 2 qty; - Confirm the internal transfer and open it in the Barcode app; - You can see you have one line, from WH/Stock/Shelf 1 to WH/Stock (if we follow previous example); - Scan one time the product, then scan another location (eg.: shelf2), the line will be split. => Issue here: the line for the remaining quantity has WH/Stock as source location instead of Shelf 1. Expected behavior: ================== The source location of the split line doesn't change. Explanation: ============ When a line is split, a new line is created for the remaining quantity. But the issue is, when a new line is created, it uses the picking's source location (or the previous scanned source) as the default location. OPW-4016136 Forward-Port-Of: odoo/enterprise#66360
We are facing an access error when the planning user tries to access the conflict shift because we have not given the planning user access to the draft shift. Steps to reproduce: - Install the planning app - Go to planning - Create two shifts at the same time (one published and the other in draft) - Create a new planning user - Log in as the planning user - Open the published shift task-3823274 Forward-Port-Of: odoo/enterprise#67346 Forward-Port-Of: odoo/enterprise#66356
Original PR description
We are facing an access error when the planning user tries to access the conflict shift because we have not given the planning user access to the draft shift. Steps to reproduce: - Install the planning app - Go to planning - Create two shifts at the same time (one published and the other in draft) - Create a new planning user - Log in as the planning user - Open the published shift task-3823274 Forward-Port-Of: odoo/enterprise#67346 Forward-Port-Of: odoo/enterprise#66356
Steps to reproduce: - Create a product that is a kit in company A and not in company B - Try updating quantity on hand in company B Bug: since [1] it's not possible to update kit quantites directly but is_kits is not company dependant Fix: is_kits depends on the selected companies opw-3946361 [1]:https://github.com/odoo/odoo/pull/161124/files Forward-Port-Of: odoo/odoo#174233 Forward-Port-Of: odoo/odoo#169063
Original PR description
Steps to reproduce: - Create a product that is a kit in company A and not in company B - Try updating quantity on hand in company B Bug: since [1] it's not possible to update kit quantites directly but is_kits is not company dependant Fix: is_kits depends on the selected companies opw-3946361 [1]:https://github.com/odoo/odoo/pull/161124/files Forward-Port-Of: odoo/odoo#174233 Forward-Port-Of: odoo/odoo#169063
This is a complement to previous fix https://github.com/odoo/odoo/commit/649a7f185dca806af3b3d54a1e4390b9baff79c6 in which the use case where both companies have "Round Globally" set as "Rounding Method" was not handled. **Steps to reproduce:** - Install Sales & Accounting - Create a second company with a different currency (e.g. AED) than the first one (e.g. USD) - Configure the rounding factor of the currency of the second company to 1.000000 - Configure the default company of the curre
Original PR description
This is a complement to previous fix https://github.com/odoo/odoo/commit/649a7f185dca806af3b3d54a1e4390b9baff79c6 in which the use case where both companies have "Round Globally" set as "Rounding…
This is a complement to previous fix https://github.com/odoo/odoo/commit/649a7f185dca806af3b3d54a1e4390b9baff79c6 in which the use case where both companies have "Round Globally" set as "Rounding Method" was not handled. **Steps to reproduce:** - Install Sales & Accounting - Create a second company with a different currency (e.g. AED) than the first one (e.g. USD) - Configure the rounding factor of the currency of the second company to 1.000000 - Configure the default company of the current user to the second company - Switch to the second company - In Accounting settings, set "Rounding Method" to "Round Globally" - Switch to the first company - In Accounting settings, set "Rounding Method" to "Round Globally" - Create a SO: * Customer: [any] * Order Lines: [any line with a tax] - Save the SO - Edit the SO by changing the price unit of the product !!! Make sure that the tax amount has a decimal part - Save the SO **Issue:** In the chatter, the note about the new value of the tracked field Total is different from the Total value shown in the SO. Also, in Customer Preview, the total to pay shown on the upper-left of the page is different than the total shown in the SO details. opw-3814058 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#174560
[FIX] website_crm_partner_assign: fix sitemap grades Context: when visiting the `/partners` url, the user has access to the "silver", "gold" and "platinum" grades. However, when generating the sitemap, the `/partners/grade/bronze-4` url is part of it but trying to access it leads to a 404 server answer. Another problematic behavior is that if the user deactivates a grade ("gold" for example), the grade is still accessible from `/partners` (but the `/partners/grade/gold-2` url is not on
Original PR description
[FIX] website_crm_partner_assign: fix sitemap grades Context: when visiting the `/partners` url, the user has access to the "silver", "gold" and "platinum" grades. However, when generating the…
[FIX] website_crm_partner_assign: fix sitemap grades
Context: when visiting the `/partners` url, the user has access to the
"silver", "gold" and "platinum" grades. However, when generating the
sitemap, the `/partners/grade/bronze-4` url is part of it but trying to
access it leads to a 404 server answer. Another problematic behavior is
that if the user deactivates a grade ("gold" for example), the grade is
still accessible from `/partners` (but the `/partners/grade/gold-2` url
is not on the sitemap anymore).
This can be explained as:
- When visiting the `/partners` url, the `partners` route searches for
grades from `request.env['res.partner']`. By doing so, it ensures that
grades are linked to at least one partner; this explains why the
"bronze" grade (not linked to any partner) is not shown at the
`/partners` url and why the deactivated "gold" grade is still
accessible (as a partner is still related to it).
- When the user tries to reach a `/partners` route, a 404 server answer
is returned if no partners are found for the route (e.g.
`/partners/grade/bronze-4`).
- When generating the sitemap, the system is searching for grades from
`env['res.partner.grade']`. Due to it, inactive grades (e.g. "gold") are
not shown on the sitemap and grades that are not linked to a partner
(e.g. "bronze") are shown on the sitemap.
The goal of this commit is to:
- Correct the `/partners` route so that it does not show inactive
grades.
- Generate the sitemap coherently from what is done in the `/partners`
route.
In the end, the `/partner` route only shows company website published
partners linked to active website published grades. The user has then
the possibility to filter the partners by grades or by country.
opw-3992340
Forward-Port-Of: odoo/odoo#174250
Forward-Port-Of: odoo/odoo#170582Previously, the amount sent to Mollie always had 2 decimal places. However, Mollie supports 0 decimal places for amounts in ISK and JPY so it failed for payments in those currencies. This fix adjusts the decimal places sent to Mollie according to the currency. opw-4011259 Forward-Port-Of: odoo/odoo#174278 Forward-Port-Of: odoo/odoo#173595
Original PR description
Previously, the amount sent to Mollie always had 2 decimal places. However, Mollie supports 0 decimal places for amounts in ISK and JPY so it failed for payments in those currencies. This fix adjusts the decimal places sent to Mollie according to the currency. opw-4011259 Forward-Port-Of: odoo/odoo#174278 Forward-Port-Of: odoo/odoo#173595
`stdnum` library incorrectly sets `zeep` `Transport` timeout, resulting in some requests hanging for 15 minutes. With this monkeypatch the timeout will be set correctly. The monkeypatch is a full copy of the original code except for adding `operational_timeout` to the `Transport` initialization. The monkeypatch can be removed when https://github.com/arthurdejong/python-stdnum/issues/444 is resolved and the version is upgraded. Related zeep github issue: https://github.com/mvantellingen/
Original PR description
`stdnum` library incorrectly sets `zeep` `Transport` timeout, resulting in some requests hanging for 15 minutes. With this monkeypatch the timeout will be set correctly. The monkeypatch is a full…
`stdnum` library incorrectly sets `zeep` `Transport` timeout, resulting in some requests hanging for 15 minutes. With this monkeypatch the timeout will be set correctly. The monkeypatch is a full copy of the original code except for adding `operational_timeout` to the `Transport` initialization. The monkeypatch can be removed when https://github.com/arthurdejong/python-stdnum/issues/444 is resolved and the version is upgraded. Related zeep github issue: https://github.com/mvantellingen/python-zeep/issues/140 This fix was already merged but reverted due to an unexpected side-effect: Original commit: https://github.com/odoo-dev/odoo/commit/11062f6f77ed1292c6db9d64985dddeb46d354c8 Revert: https://github.com/odoo-dev/odoo/commit/de9df2ba5c15d399d6906ef54f3e4ac9f063a175 The issue originated from a dependency issue in the `zeep` library in [Ubuntu 22.04](https://packages.ubuntu.com/jammy/python3-zeep). The `python3-platformdirs` dependency is missing in there, yet it is used in that version of `zeep`. This missing dependency used to be hidden by the [chains of `try ... except ImporError` of `stdnum`](https://github.com/arthurdejong/python-stdnum/blob/d5666b8bfe379688a38bb0fd6764a8c536dd3c75/stdnum/util.py#L254). That means that it's another import from the chain that was used. So to reduce the possibility of introducing a similar bug and catch such errors, the original code from `get_soap_client` of `stdnum` has been fully copied. opw-3980718 Forward-Port-Of: odoo/odoo#174199 Forward-Port-Of: odoo/odoo#173359
Steps to reproduce: - Edit any product's 'Description for delivery orders' (inventory tab) - Create a delivery for this product (or confirm sale order to create one automatically) - Print delivery slip (Correct formatting) - Validate delivery - Print delivery slip once more (Description loses linebreaks) This is only for looks, but it's a document the end user will see so there are concerns about it looking unprofessional. This formatting error is due to us not being able to use a fie
Original PR description
Steps to reproduce: - Edit any product's 'Description for delivery orders' (inventory tab) - Create a delivery for this product (or confirm sale order to create one automatically) - Print delivery slip (Correct formatting) - Validate delivery - Print delivery slip once more (Description loses linebreaks) This is only for looks, but it's a document the end user will see so there are concerns about it looking unprofessional. This formatting error is due to us not being able to use a field element after remaking the order lines to group related products in python. opw-4040127 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#174495
Before this commit, when calling `_getSaveLineCommand` to get the save commands for the move lines, we do each line one by one, in the order where they were marked as to save, which means we can have an update command followed by a create command, itself followed by another update command for example. In the module `stock_barcode_picking_batch`, we add the test `test_barcode_batch_scan_lots`. In this test, we got a situation where we will write on the batch a command like that: ```python
Original PR description
Before this commit, when calling `_getSaveLineCommand` to get the save commands for the move lines, we do each line one by one, in the order where they were marked as to save, which means we can have…
Before this commit, when calling `_getSaveLineCommand` to get the save commands for the move lines, we do each line one by one, in the order where they were marked as to save, which means we can have an update command followed by a create command, itself followed by another update command for example.
In the module `stock_barcode_picking_batch`, we add the test `test_barcode_batch_scan_lots`. In this test, we got a situation where we will write on the batch a command like that:
```python
{
'move_line_ids': [
[UPDATE command],
[CREATE command],
[UPDATE command],
[CREATE command],
[CREATE command]
]}
```
The 2 first commands are for the move lines in the first batch's picking. The 3 last commands are for the move lines i the second batch's picking.
The issue is, the first CREATE command won't happen. The two move lines for the second picking will be created but the move line who should be created for the first commit will not.
It fails because the compute has a depends on himself. And it's recomputed on picking_ids that have a different cache than the batch. So the second UPDATE will trigger the compute that will rewrite the move_line_ids fields and cancel the first CREATE. So it means every CREATE commands before the last UPDATE will be ignored
Enterprise PR: odoo/enterprise#65182
Forward-Port-Of: odoo/odoo#173521[FIX] web_editor: won't place font element between if else nodes Previously when we updated color on multiple selected nodes, </font> tag would get inserted between qweb if and else tags. This caused qweb processor to crash. After this change we don't insert font on the "t" elements. [Reproduce] - Install account - Open Email Template called "Invoice: Sending" - Change color of all of its content - Open preview opw-3912434 Forward-Port-Of: odoo/odoo#173703 Forward-Port-Of: odoo
Original PR description
[FIX] web_editor: won't place font element between if else nodes Previously when we updated color on multiple selected nodes, </font> tag would get inserted between qweb if and else tags. This caused qweb processor to crash. After this change we don't insert font on the "t" elements. [Reproduce] - Install account - Open Email Template called "Invoice: Sending" - Change color of all of its content - Open preview opw-3912434 Forward-Port-Of: odoo/odoo#173703 Forward-Port-Of: odoo/odoo#169678
Avoid extra redirect, use slug directly instead. Forward-Port-Of: odoo/odoo#174032
Original PR description
Avoid extra redirect, use slug directly instead. Forward-Port-Of: odoo/odoo#174032
Due to introduction of downpayment mechanism, if downpayment was made, Sale Order would no longer be in "has to be payed" state and it would prevent client from further payments. opw-3891128 Forward-Port-Of: odoo/odoo#163178
Original PR description
Due to introduction of downpayment mechanism, if downpayment was made, Sale Order would no longer be in "has to be payed" state and it would prevent client from further payments. opw-3891128 Forward-Port-Of: odoo/odoo#163178