Tuesday, February 11, 2025
8 changes · saas-17.2
Resolved issues and error corrections
The French accounting add-on will again be installed automatically when both Accounting and French localization are present. This prevents French accounting features from being missed during setup, while relying on the existing French localization for country configuration.
Original PR description
This commit:https://github.com/odoo/odoo/commit/134324c5cf0e2e62f02d212ac27a9442e1f7a824 removed the auto-install for l10n_fr. Which has the consequence of not having l10n_fr_account installed when we have account and l10n_fr. This commit will reintroduce that but also removing the countries since it depends on l10n_fr that already has the country set up. task: 4296946 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The activity dropdown now closes after users choose Lead/Opportunity in CRM or Today's Meetings in Calendar. This makes the menu behave consistently and avoids leaving an unnecessary dropdown open after navigation.
Original PR description
[FIX] calendar, crm: close activity dropdown on option selection Previously, selecting the Lead/Opportunity activity option (CRM module) or the Today's Meetings option (calendar module) in the systray activity dropdown would redirect to the appropriate view, but keep the dropdown open. This is inconsistent with the behavior for the rest of the options in the dropdown, which close said dropdown when selected. This makes it so the dropdown in the systray activity dropdown gets closed when selecting the Lead/Opportunity option. task-3874130
Miscellaneous changes
### Issues: Creating and validating a picking from the barcode app does not behave correctly with respect to quality check trigger and creation. Depending on your flow, you might end up with QC created twice or with QC not being triggered before validation. ### Cause of the issues: The quality checks are created during the "_action_confirm" of moves: https://github.com/odoo/enterprise/blob/dd4a1ec4aaa7cbb95d6e40a8bb6ab1d6c88fc7b7/quality_control/models/stock_move.py#L12-L15 However, d
Original PR description
### Issues: Creating and validating a picking from the barcode app does not behave correctly with respect to quality check trigger and creation. Depending on your flow, you might end up with QC…
### Issues:
Creating and validating a picking from the barcode app does not behave correctly with respect to quality check trigger and creation. Depending on your flow, you might end up with QC created twice or with QC not being triggered before validation.
### Cause of the issues:
The quality checks are created during the "_action_confirm" of moves: https://github.com/odoo/enterprise/blob/dd4a1ec4aaa7cbb95d6e40a8bb6ab1d6c88fc7b7/quality_control/models/stock_move.py#L12-L15
However, depending on where you click in the barcode app, the moves might end up being assigned and hence skip the "_action_confirm" of the picking (which is computed to be assigned) prior to the `_pre_action_done_hook` of the `button_validate` of the picking wich is suppose to return already created quality check:
https://github.com/odoo/odoo/blob/08f0c6481a190349369ead5ab9328886392ddbeb/addons/stock/models/stock_picking.py#L1145-L1147
In which case, the quality check is not triggered (Issue 1). Furthermore, since the `_action_confirm` of moves can also be applied to extra moves created to update the demand and to be merged to the initial move during the validation, the quality check creation might be called twice on a move once during its own `action_confirm` and once during the `_action_confirm` of its extra move (Issue2).
### Issue 1:
1. Create a storable product P with a barcode: XXX
2. Go to Quality > Quality Control > Quality Points > New
3. Create a new quality point for your product:
- Control per: "Operation"
- Operations: "Receipts"
4. Go to the barcode app > Operations > Receipts > New
5. Scan your product
6. Click on the pencil (key step)
7. Either edit the quantity from the digipad and confirm or go back to the picking and edit it from there.
8. Validate the receipt
#### > Even thought a quality check was created using your quality point for your receipt, it was not triggered before validation.
### Cause of the Issue:
Clicking on the pencil will trigger a call of the `save_barcode_data` which will in turn create a stock move line related to the picking during the write performed on the picking:
https://github.com/odoo/enterprise/blob/dd4a1ec4aaa7cbb95d6e40a8bb6ab1d6c88fc7b7/stock_barcode/controllers/stock_barcode.py#L68-L74
After this edition of the quantity of the picking will write on the `qty_done` dummy field of that move line which will in turn trigger a call of its inverse method and modify its quantity: https://github.com/odoo/enterprise/blob/dd4a1ec4aaa7cbb95d6e40a8bb6ab1d6c88fc7b7/stock_barcode/models/stock_move_line.py#L58-L61
Changing the quantity of the ml will then update the state of the move to "assigned" because of these lines:
https://github.com/odoo/odoo/blob/a74684777c27e26639b75b0668bb15afadb78c4f/addons/stock/models/stock_move_line.py#L487-L488 https://github.com/odoo/odoo/blob/a74684777c27e26639b75b0668bb15afadb78c4f/addons/stock/models/stock_move_line.py#L530-L531 https://github.com/odoo/odoo/blob/08f0c6481a190349369ead5ab9328886392ddbeb/addons/stock/models/stock_move.py#L2022-L2023 In turns, the state compute method of the picking will determine that the picking is assigned and the picking will not be confirmed during its `button_validate` prior to the `_pre_action_done_hook` of the `button_validate` as it is not in draft anymore.
### Fix:
The state of the move should stay as draft just as if we didn't created the move line through the pencil if we were to edit the qty_done via the barcode app.
### Note:
The inverse method of the "qty_done" computed field was introduced in 17.0+ by commit: 4f19668c51a90e8c12e57b6353bbe5194f83ca10 during the quantity refactoring so that the issue is not reproducible prior to that version.
### Issue 2:
Same steps 1 -> 5.
6'. click on the +1 button.
7'. Validate > this opens the quality check
8'. Pass the quality check > Validate again
9'. Go to Quality > Quality Control > Quality check
#### > Two quality checks were created isntead of one for your receipt
### Cause of the issue:
At some later point in the button validate of the picking, an `_action_done` is called to put the pickings and its move in done state: https://github.com/odoo/odoo/blob/a74684777c27e26639b75b0668bb15afadb78c4f/addons/stock/models/stock_picking.py#L1157
However, during the `_action_done` of the moves if the quantity of the move exceeds its `product_uom_qty`, extra moves will be created, confirmed and merged back to the move in order to update its `product_uom_qty`:
https://github.com/odoo/odoo/blob/607d63fd4d9c07bac9cb68b2d31d86551e93d5b1/addons/stock/models/stock_move.py#L1885-L1890 https://github.com/odoo/odoo/blob/607d63fd4d9c07bac9cb68b2d31d86551e93d5b1/addons/stock/models/stock_move.py#L1823-L1832 However, the action confirm of this extra move will trigger the same override of the `_action_confirm` that creates a quality check and it will even be called on the original move that was already confirmed and already created its QC since the extra move was merged into it: https://github.com/odoo/enterprise/blob/dd4a1ec4aaa7cbb95d6e40a8bb6ab1d6c88fc7b7/quality_control/models/stock_move.py#L12-L15
As a result we end up with an extra quality check creation.
### Fix:
We avoid quality check creation during extra move confirmation.
Community: https://github.com/odoo/odoo/pull/192034
opw-4266053
---
Forward-Port-Of: odoo/enterprise#76301Before when sending request to hmrc we had a fraud prevention headers creation but only with part of the data needed, client_data was provided for one of the two request. Another problem was the ips. If we are in a private network we should still send the public IP. task-4387562 Forward-Port-Of: odoo/enterprise#78310 Forward-Port-Of: odoo/enterprise#75383
Original PR description
Before when sending request to hmrc we had a fraud prevention headers creation but only with part of the data needed, client_data was provided for one of the two request. Another problem was the ips. If we are in a private network we should still send the public IP. task-4387562 Forward-Port-Of: odoo/enterprise#78310 Forward-Port-Of: odoo/enterprise#75383
**Current behavior:** If a picking has two moves with move lines for the same lot-tracked product, they will be grouped under one parent line in the barcode app. Then, if the parent line is selected and a lot for their product is scanned, it will keep adding the quantity to the first subline even after it's completed. **Expected behavior:** Move lines for the same lot shouldn't be grouped under one parent if they are for different moves. **Steps to reproduce:** 1. Create a lot-trac
Original PR description
**Current behavior:** If a picking has two moves with move lines for the same lot-tracked product, they will be grouped under one parent line in the barcode app. Then, if the parent line is selected…
**Current behavior:**
If a picking has two moves with move lines for the same
lot-tracked product, they will be grouped under one parent line
in the barcode app. Then, if the parent line is selected and a
lot for their product is scanned, it will keep adding the
quantity to the first subline even after it's completed.
**Expected behavior:**
Move lines for the same lot shouldn't be grouped under one
parent if they are for different moves.
**Steps to reproduce:**
1. Create a lot-tracked product and some quant for it
2. Create a new delivery picking and add 1 move to it for the
lot product -> assign the picking
3. Add another move to the picking, again for the lot product
4. Open the picking in barcode, without expanding the sublines,
scan the lot created with the quant
5. When the parent line is complete, expand it to see that one
of the sublines has no quantity
6. Furthermore, validating the transfer at this point will
create a backorder despite it being technically completed
**Cause of the issue:**
The group key for sublines doesn't take into account the line's
move id.
**Fix:**
Add `line.move_id` to the group key for sublines.
Then, ensure when checking whether to merge some new lot scan
qty with an existing line in `_getNewLineDefaultValues()`, take
into account the lot details (not done prior to this commit).
Additionally, check all available barcode lines for a merge-able
line if there is not one currently selected.
Similarly, check that two barcode lines belong to the same
picking when in a batched context before allowing their
quantities to comingle.
opw-4185767
Forward-Port-Of: odoo/enterprise#70539**Current behavior:** With a FIFO + real-time product, `ProductA`: Creating a sale order with multiple order lines for ProductA, processing the resulting delivery in 2 separate pickings via backorder (1st delivery for the 1st line, 2nd delivery for the 2nd line), then invoicing the delivered product separately result in an invoice with invoice lines which do not reflect the value of the product at delivery time. **Expected behavior:** The SVLs generated from the deliveries should info
Original PR description
**Current behavior:** With a FIFO + real-time product, `ProductA`: Creating a sale order with multiple order lines for ProductA, processing the resulting delivery in 2 separate pickings via backorder…
**Current behavior:** With a FIFO + real-time product, `ProductA`: Creating a sale order with multiple order lines for ProductA, processing the resulting delivery in 2 separate pickings via backorder (1st delivery for the 1st line, 2nd delivery for the 2nd line), then invoicing the delivered product separately result in an invoice with invoice lines which do not reflect the value of the product at delivery time. **Expected behavior:** The SVLs generated from the deliveries should inform the generated AccountMoves. **Steps to reproduce:** 1. `FIFO-prod`: FIFO and real-time valuation & costing 2. Receive 12 units of `FIFO-prod` @ $100 per 3. Create a sale order with order lines: * `FIFO-prod` `10 units` `price_unit=$100` * `FIFO-prod` `2 units` `price_unit=$100` 4. Confirm the sale order, on the delivery, only receive the first move for the 10 qty, backorder the other 2 qty 5. Receive the backorder, create an invoice- edit the invoice lines so that 5/10 of line 1 and 2/2 of line 2 are invoiced, then post/confirm 6. Edit the `standard_price` of `FIFO-prod` (e.g., $100 -> $50) 7. Create another invoice for the remaining quantity and post 8. Observe that the COGs lines on the invoice have been calculated with a different price unit than the other invoice & unit_price for the out SVLs **Cause of the issue:** When getting the price unit of a given anglo saxon invoice line, there is no check that all the collected COGS lines are linked to the sale order line which corresponds to the product and product_qty that we are attempting to value. This creates an imbalance in the qty calculation later here: https://github.com/odoo/odoo/blob/f2728b2fe13a355ecb301a3714639b8a07f418b4/addons/stock_account/models/stock_valuation_layer.py#L202-L211 when the valuation is actually performed. **Fix:** Only consider posted COGS lines for the sale order line with the product qty that is getting valued when calculating `qty_invoiced`. opw-4321363 Forward-Port-Of: odoo/odoo#195046
This commit will add a protection for the removal of bank and cash accounts. task: 4392444 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#190529
Original PR description
This commit will add a protection for the removal of bank and cash accounts. task: 4392444 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#190529
### Issues: Creating and validating a picking from the barcode app does not behave correctly with respect to quality check trigger and creation. Depending on your flow, you might end up with QC created twice or with QC not being triggered before validation. ### Cause of the issues: The quality checks are created during the "_action_confirm" of moves: https://github.com/odoo/enterprise/blob/dd4a1ec4aaa7cbb95d6e40a8bb6ab1d6c88fc7b7/quality_control/models/stock_move.py#L12-L15 However, d
Original PR description
### Issues: Creating and validating a picking from the barcode app does not behave correctly with respect to quality check trigger and creation. Depending on your flow, you might end up with QC…
### Issues:
Creating and validating a picking from the barcode app does not behave correctly with respect to quality check trigger and creation. Depending on your flow, you might end up with QC created twice or with QC not being triggered before validation.
### Cause of the issues:
The quality checks are created during the "_action_confirm" of moves: https://github.com/odoo/enterprise/blob/dd4a1ec4aaa7cbb95d6e40a8bb6ab1d6c88fc7b7/quality_control/models/stock_move.py#L12-L15
However, depending on where you click in the barcode app, the moves might end up being assigned and hence skip the "_action_confirm" of the picking (which is computed to be assigned) prior to the `_pre_action_done_hook` of the `button_validate` of the picking wich is suppose to return already created quality check:
https://github.com/odoo/odoo/blob/08f0c6481a190349369ead5ab9328886392ddbeb/addons/stock/models/stock_picking.py#L1145-L1147
In which case, the quality check is not triggered (Issue 1). Furthermore, since the `_action_confirm` of moves can also be applied to extra moves created to update the demand and to be merged to the initial move during the validation, the quality check creation might be called twice on a move once during its own `action_confirm` and once during the `_action_confirm` of its extra move (Issue2).
### Issue 1:
1. Create a storable product P with a barcode: XXX
2. Go to Quality > Quality Control > Quality Points > New
3. Create a new quality point for your product:
- Control per: "Operation"
- Operations: "Receipts"
4. Go to the barcode app > Operations > Receipts > New
5. Scan your product
6. Click on the pencil (key step)
7. Either edit the quantity from the digipad and confirm or go back to the picking and edit it from there.
8. Validate the receipt
#### > Even thought a quality check was created using your quality point for your receipt, it was not triggered before validation.
### Cause of the Issue:
Clicking on the pencil will trigger a call of the `save_barcode_data` which will in turn create a stock move line related to the picking during the write performed on the picking:
https://github.com/odoo/enterprise/blob/dd4a1ec4aaa7cbb95d6e40a8bb6ab1d6c88fc7b7/stock_barcode/controllers/stock_barcode.py#L68-L74
After this edition of the quantity of the picking will write on the `qty_done` dummy field of that move line which will in turn trigger a call of its inverse method and modify its quantity: https://github.com/odoo/enterprise/blob/dd4a1ec4aaa7cbb95d6e40a8bb6ab1d6c88fc7b7/stock_barcode/models/stock_move_line.py#L58-L61
Changing the quantity of the ml will then update the state of the move to "assigned" because of these lines:
https://github.com/odoo/odoo/blob/a74684777c27e26639b75b0668bb15afadb78c4f/addons/stock/models/stock_move_line.py#L487-L488 https://github.com/odoo/odoo/blob/a74684777c27e26639b75b0668bb15afadb78c4f/addons/stock/models/stock_move_line.py#L530-L531 https://github.com/odoo/odoo/blob/08f0c6481a190349369ead5ab9328886392ddbeb/addons/stock/models/stock_move.py#L2022-L2023 In turns, the state compute method of the picking will determine that the picking is assigned and the picking will not be confirmed during its `button_validate` prior to the `_pre_action_done_hook` of the `button_validate` as it is not in draft anymore.
### Fix:
The state of the move should stay as draft just as if we didn't created the move line through the pencil if we were to edit the qty_done via the barcode app.
### Note:
The inverse method of the "qty_done" computed field was introduced in 17.0+ by commit: 4f19668c51a90e8c12e57b6353bbe5194f83ca10 during the quantity refactoring so that the issue is not reproducible prior to that version.
### Issue 2:
Same steps 1 -> 5.
6'. click on the +1 button.
7'. Validate > this opens the quality check
8'. Pass the quality check > Validate again
9'. Go to Quality > Quality Control > Quality check
#### > Two quality checks were created isntead of one for your receipt
### Cause of the issue:
At some later point in the button validate of the picking, an `_action_done` is called to put the pickings and its move in done state: https://github.com/odoo/odoo/blob/a74684777c27e26639b75b0668bb15afadb78c4f/addons/stock/models/stock_picking.py#L1157
However, during the `_action_done` of the moves if the quantity of the move exceeds its `product_uom_qty`, extra moves will be created, confirmed and merged back to the move in order to update its `product_uom_qty`:
https://github.com/odoo/odoo/blob/607d63fd4d9c07bac9cb68b2d31d86551e93d5b1/addons/stock/models/stock_move.py#L1885-L1890 https://github.com/odoo/odoo/blob/607d63fd4d9c07bac9cb68b2d31d86551e93d5b1/addons/stock/models/stock_move.py#L1823-L1832 However, the action confirm of this extra move will trigger the same override of the `_action_confirm` that creates a quality check and it will even be called on the original move that was already confirmed and already created its QC since the extra move was merged into it: https://github.com/odoo/enterprise/blob/dd4a1ec4aaa7cbb95d6e40a8bb6ab1d6c88fc7b7/quality_control/models/stock_move.py#L12-L15
As a result we end up with an extra quality check creation.
### Fix:
We avoid quality check creation during extra move confirmation.
Enterprise: https://github.com/odoo/enterprise/pull/76301
opw-4266053
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#192034