Friday, January 24, 2025
75 changes · saas-18.1
Enhancements to existing features
Upgrades will now keep existing database indexes when they have no recorded comment, instead of dropping and recreating them. This helps preserve customer-specific index changes and reduces unnecessary database work during upgrades.
Original PR description
Description of the issue/feature this PR addresses: When upgrading, the team would like to keep existing modified indexes. Therefore, we will not re-create indexes that already exist and have no comments. We create the index only when the comment does not match or when the index does not exist. Current behavior before PR: If there is no comment, drop and re-create the index during the upgrade. Desired behavior after PR is merged: Keep the indexes during the upgrade. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
Discuss calls no longer show flickering in the small video preview when a user is sharing their screen and has the camera enabled. This creates a steadier, less distracting call experience for users.
Original PR description
Before this commit, during a discuss call while sharing screen and enabling camera, the inset card (= small video stream preview in bottom right of call view of the participant, either camera or screen-sharing depending on other stream being main active) was flickering. This happens because each rendering of the call view re-renders the inset, which leads to the perceived flickers from stream being re-rendered. The main cause of re-render comes from `setInset()` that is invoked whenever the `visibleMainCards` getter is called with inset, which is triggered on renderings like mouse-hovering on call view to display the call actions. Even when the inset card is unchanged, `setInset()` produces another object, which forces OWL to re-render the inset component. This commit fixes the issue by having `setInset` reusing the inset data object if the inset to render refers to the same inset session. Task-4484908
Miscellaneous changes
The livechat button loader template adds `websocket_worker_version` to the Odoo session. However, when the loader is called through `chatbot_test_script_page`, it does not receive the `websocket_worker_version`. In the standard Odoo environment, this value is already available in the session This fix ensures the `websocket_worker_version` is properly handled in scenarios involving `chatbot_test_script_page`. Task-4462067 --- I confirm I have signed the CLA and read the PR guidelines at
Original PR description
The livechat button loader template adds `websocket_worker_version` to the Odoo session. However, when the loader is called through `chatbot_test_script_page`, it does not receive the `websocket_worker_version`. In the standard Odoo environment, this value is already available in the session This fix ensures the `websocket_worker_version` is properly handled in scenarios involving `chatbot_test_script_page`. Task-4462067 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193063
Leaving a livechat conversation from Discuss now avoids sending the same unfollow action twice. This reduces unnecessary background processing and helps keep livechat membership changes cleaner and more reliable for users.
Original PR description
Before this PR, leaving a livechat channel from the Discuss app would trigger multiple `action_unfollow` actions: - One initiated by the Discuss app. - Another triggered by the `channel/leave` notification. This PR resolves the issue by ensuring that the `channel/leave` notification does not redundantly trigger an `action_unfollow`. Task-4488437 Additionally, this commit addresses minor code structure issues. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The India Time Off screen now shows the sandwich leave warning in the correct layout. This prevents a visual glitch when HR teams configure or review leave requests around weekends.
Original PR description
Steps to reproduce: - Install India - Time Off - Create a new time off type in the Indian company and enable sandwich leave - Create two time offs around the weekends - The sandwich leave warning appears Issue: There is a visual issue with the sandwich leave warning sign. Cause: The group contains two columns: one for labeling and one for input. Solution: Added colspan="2" to a single div element to occupy the entire space. task-4435090
The product form no longer shows an empty Purchase tab when the Purchase app is not installed. This removes a confusing screen that no longer contains useful settings after the unit-of-measure changes.
Original PR description
Before the refactoring of uom, it was possible to define `uom_po_id`, the uom for purchase that was used for vendor bills. This was the only setting to define in Purchase tab if the Purchase app was not installed. Since the commit removed this field, the tab became useless and should be removed. *https://github.com/odoo/odoo/commit/d3fa388cf7c41984b5f7cbc2a81fec3e27a00325
This fix prevents unnecessary warning messages when employee-related filters have already been prepared for a related employee model. It keeps internal processing quieter and more reliable without changing how users work with employee records.
Original PR description
If the domain is already optimized for another model, the optimize function logs a warning. While the domain could probably be used as is without requiring the domain to be optimized again (due to the nature of the hr.employee models), we reset the domain completely if the domain has been optimized for another model.
This fixes an error that could appear when users clicked on a shift popover in Planning. Sales-related planning views should now load the shift details reliably, reducing interruptions for scheduling users.
Original PR description
This PR fixes a traceback occurring in planning when clicking on the popover of a shift, due to an async method not being properly overridden. Task-4506661
Currently when we validate a transfer with products tracked by serial number, we may run into a bottleneck when the `quality_mrp` module is installed. That's because there's 1 move_line by Serial Number and inside `_create_assign_production_lot` those move_lines are grouped by `(company_id, product_id, lot_name)`. As we are tracking by Serial Number, each of these group key will be unique. Also, the mls are grouped in key_to_mls using `__union__` which calls `browse` to produce a recordset, effe
Original PR description
Currently when we validate a transfer with products tracked by serial number, we may run into a bottleneck when the `quality_mrp` module is installed. That's because there's 1 move_line by Serial…
Currently when we validate a transfer with products tracked by serial number, we may run into a bottleneck when the `quality_mrp` module is installed. That's because there's 1 move_line by Serial Number and inside `_create_assign_production_lot` those move_lines are grouped by `(company_id, product_id, lot_name)`. As we are tracking by Serial Number, each of these group key will be unique. Also, the mls are grouped in key_to_mls using `__union__` which calls `browse` to produce a recordset, effectively setting the `_prefetch_ids` of the results to `_ids`. Therefore, in the sml `write` override in quality_mrp when there's a condition on `self.sudo().check_ids`, the `_prefetch_ids` of self will only be the id in self, leading to 1 SELECT query by SML, i.e. 1 SELECT query by serial number. This wouldn't be that much of an issue if `quality_check.move_line_id` was properly indexed but that's not the case. So this commit first adds a missing `btree_not_null` index on `quality_check.move_line_id` to change the query plan from Seq Scan to Index Scan. Then we manually set the `_prefetch_ids` in `_create_and_assign_production_lot` to reduce the number of queries. #### speedup In a 17 database with 750 000 quality checks, on hot cache, adding the index makes a single query go from ~50ms to 0.250ms. When doing a transfer of 1000 serial numbers, setting the `_prefetch_ids` reduce the number of queries from 1000 to 1. This query takes around 120ms on hot cache without the index. Both with the index and the `_prefetch_ids`, the total time of the `_create_and_assign_production_lot` method when validating a transer of 1000 serial numbers goes from 50ms * 1000 = 50s -> 2ms * 1 = 2ms. opw-4285293 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#190479
When a product has a fixed tax, there should be a separate downpayment line for the fixed tax amount. Steps to reproduce: ------------------- * Create a fixed tax of 1€ * Assign this tax to any product * Create a sale order with this product * Open PoS and make a downpayment of 10% > Observation: There is only one downpayment line with the total amount of the product and the fixed tax combined. opw-4252104 Forward-Port-Of: odoo/odoo#194031 Forward-Port-Of: odoo/odoo#192208
Original PR description
When a product has a fixed tax, there should be a separate downpayment line for the fixed tax amount. Steps to reproduce: ------------------- * Create a fixed tax of 1€ * Assign this tax to any product * Create a sale order with this product * Open PoS and make a downpayment of 10% > Observation: There is only one downpayment line with the total amount of the product and the fixed tax combined. opw-4252104 Forward-Port-Of: odoo/odoo#194031 Forward-Port-Of: odoo/odoo#192208
Peppol migration creates more issues than it solves. A lot of users issue migration requests to move to another SMP but later discover that the SMP they wanted to migrate to does not support migration keys. This creates a state that we need to handle manually. Most SMP do not support migrating away and force users to deregister and reregister again on another one. This commit adds a fix in stable for that issue by removing the button from the res_config_settings_buttons and adding a deprecate
Original PR description
Peppol migration creates more issues than it solves. A lot of users issue migration requests to move to another SMP but later discover that the SMP they wanted to migrate to does not support migration keys. This creates a state that we need to handle manually. Most SMP do not support migrating away and force users to deregister and reregister again on another one. This commit adds a fix in stable for that issue by removing the button from the res_config_settings_buttons and adding a deprecated warning when the user tries to call the `button_migrate_peppol_registration` method. task-4394408 Forward-Port-Of: odoo/odoo#194524 Forward-Port-Of: odoo/odoo#193794
The test suffered from multiple problems: - Duration of leaves could sometimes be less or more depending on the day of the week (weekend don't count in duration) - Demo data could make the test pass while the leaves created during the test were not actually found Here we improved the date mechanism as well as forcing the domain to only search within our own leaves as well as comparing that those leaves are the one with fetched. Forward-Port-Of: odoo/odoo#194994
Original PR description
The test suffered from multiple problems: - Duration of leaves could sometimes be less or more depending on the day of the week (weekend don't count in duration) - Demo data could make the test pass while the leaves created during the test were not actually found Here we improved the date mechanism as well as forcing the domain to only search within our own leaves as well as comparing that those leaves are the one with fetched. Forward-Port-Of: odoo/odoo#194994
Fixes an issue with the xml file where the tax exchange rate node would be added before the payment terms node if both features are used, which render the xml wrong. Also add a sudo when getting the system param for the test url; as this shouldn't block a non administrator user from testing the feature. opw-4425472 opw-4505562 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194971
Original PR description
Fixes an issue with the xml file where the tax exchange rate node would be added before the payment terms node if both features are used, which render the xml wrong. Also add a sudo when getting the system param for the test url; as this shouldn't block a non administrator user from testing the feature. opw-4425472 opw-4505562 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194971
- Fix bug where session opening time was set to previous session closing time. - Now we want the pos session opening time to be set when we click "Open register". task-id: 4500391 Description of the issue/feature this PR addresses: Current behavior before PR: 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#194977
Original PR description
- Fix bug where session opening time was set to previous session closing time. - Now we want the pos session opening time to be set when we click "Open register". task-id: 4500391 Description of the issue/feature this PR addresses: Current behavior before PR: 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#194977
Tour bubble points to every New button in kanban. Fixed it to only point at New button in crm lead kanban view. Task-4377574 Forward-Port-Of: odoo/odoo#190937
Original PR description
Tour bubble points to every New button in kanban. Fixed it to only point at New button in crm lead kanban view. Task-4377574 Forward-Port-Of: odoo/odoo#190937
Before this commit, if an employee had multiple related partners, an expected singleton error occurred when attempting to set the opening or closing of the session. opw-4482497 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194984
Original PR description
Before this commit, if an employee had multiple related partners, an expected singleton error occurred when attempting to set the opening or closing of the session. opw-4482497 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194984
**Steps to reproduce:** - Install Accounting - Create a first tax: * Tax Name: Tax1 * Tax Computation: Percentage of Price * Tax Type: Sales * Amount: 20% * Label on Invoices: Tax1 * Tax Group: Tax1 * Affect Base of Subsequent Taxes: [Checked] - Create a second tax: * Tax Name: Tax2 * Tax Computation: Percentage of Price * Tax Type: Sales * Amount: 20% * Label on Invoices: Tax2 * Tax Group: Tax2 * Base Affected by Previous Taxes: [Not checked] - Crea
Original PR description
**Steps to reproduce:** - Install Accounting - Create a first tax: * Tax Name: Tax1 * Tax Computation: Percentage of Price * Tax Type: Sales * Amount: 20% * Label on Invoices: Tax1 * Tax Group: Tax1 * Affect Base of Subsequent Taxes: [Checked] - Create a second tax: * Tax Name: Tax2 * Tax Computation: Percentage of Price * Tax Type: Sales * Amount: 20% * Label on Invoices: Tax2 * Tax Group: Tax2 * Base Affected by Previous Taxes: [Not checked] - Create an invoice - Add an invoice line - Add Tax1 - Add Tax2 **Issue:** Base amount of Tax2 is affected by Tax1 when it should not. opw-4450494 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194953 Forward-Port-Of: odoo/odoo#193451
It was failing in single module builds /locally and the reason was due to the fact that project not having a analytic account. task-4500108 Forward-Port-Of: odoo/odoo#194701
Original PR description
It was failing in single module builds /locally and the reason was due to the fact that project not having a analytic account. task-4500108 Forward-Port-Of: odoo/odoo#194701
Steps to reproduce: - With an EG Company setup - Create an invoice with a '3% WH' tax - Confirm invoice and send for validation Issue: Validation will fail with error ``` {'code': '2', 'message': 'Validation Error', 'target': 'INV/2025/00001', 'propertyPath': None, 'details': [{'code': None, 'message': 'ArrayItemNotValid', 'target': '[0]', 'propertyPath': '#/invoiceLines[0]', 'details': None}, {'code': None, 'message': 'ArrayItemNotValid', 'target': '[1]', 'propertyPath': '#/taxTotals[1]
Original PR description
Steps to reproduce:
- With an EG Company setup
- Create an invoice with a '3% WH' tax
- Confirm invoice and send for validation
Issue: Validation will fail with error
```
{'code': '2', 'message': 'Validation Error', 'target': 'INV/2025/00001', 'propertyPath': None, 'details': [{'code': None, 'message': 'ArrayItemNotValid', 'target': '[0]', 'propertyPath': '#/invoiceLines[0]', 'details': None}, {'code': None, 'message': 'ArrayItemNotValid', 'target': '[1]', 'propertyPath': '#/taxTotals[1]', 'details': None}]}
```
This is caused by the withholding tax amount being reported as negative, while it should be reported as positive
opw-4453002
Description of the issue/feature this PR addresses:
Current behavior before PR:
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#194708### Steps to reproduce: - Install "l10n_ch" and switch to a Swiss company - Create an invoice for a Swiss partner - Send it - The QR code appears in the generated PDF ### Cause: The bank eligibility is not checked when printing the QR code. ### Solution: After a discussion with the PO (THB) the Qr codes should appear on all Swiss transaction. But if the fiscal country of the user's company is not Switzerland, it must still be printed if its bank account is eligible to receive payment
Original PR description
### Steps to reproduce: - Install "l10n_ch" and switch to a Swiss company - Create an invoice for a Swiss partner - Send it - The QR code appears in the generated PDF ### Cause: The bank eligibility is not checked when printing the QR code. ### Solution: After a discussion with the PO (THB) the Qr codes should appear on all Swiss transaction. But if the fiscal country of the user's company is not Switzerland, it must still be printed if its bank account is eligible to receive payments via QRcodes. So the solution is to add a check if the fiscal_country is not Switzerland, then we check the account validity. A valid account is an IBAN account of this type CHXX 3000 0XXX XXXX with the number in the middle being between 30000 and 31999. opw-4380520 Forward-Port-Of: odoo/odoo#194563 Forward-Port-Of: odoo/odoo#194421
## General Issue: Cross-dock rules cannot function as the main rule without disrupting unrelated flows (e.g., regular purchases). They also fail as exceptions, as they are not triggered in such cases. ## Cause: Push and pull rules have been refactored in saas-17.2 (see commit 11e69870db1c49d9a6af79ffd263e4e162b34b6b). Previously, most flows relied solely on pull rules, generating the entire picking chain at inventory need confirmation. With the refactoring, push rules are now prioritize
Original PR description
## General Issue: Cross-dock rules cannot function as the main rule without disrupting unrelated flows (e.g., regular purchases). They also fail as exceptions, as they are not triggered in such…
## General Issue:
Cross-dock rules cannot function as the main rule without disrupting unrelated flows (e.g., regular purchases). They also fail as exceptions, as they are not triggered in such cases.
## Cause:
Push and pull rules have been refactored in saas-17.2 (see commit 11e69870db1c49d9a6af79ffd263e4e162b34b6b). Previously, most flows relied solely on pull rules, generating the entire picking chain at inventory need confirmation. With the refactoring, push rules are now prioritized, generating pickings step-by-step upon validation. While this increases route flexibility, it introduces issues for flows expected to be entirely triggered by sales order (SO) validations, such as cross-docking.
In version 18.0, cross-dock rules were refactored to rely only on push rules (see commit af5479dfdbed0959c02bd862c8184fe141b51788), but this created significant issues.
### Steps to Reproduce:
- In the settings, Enable multi-step routes.
- Configure the warehouse for 2-step receipt and delivery
> automatically unarchives the cross-dock route and updates its rules:
- Push rule: Input → Output
- Buy rule: → Partner/Customer
#### Scenario 1: Cross-dock set on the product
#### Issue: Cannot receipt in 2 steps → cross dock can not be the rule.
- Create an inventory-tracked product with the buy and cross-dock routes.
- Create and confirm a purchase order for 1 unit of the product.
- Validate the receipt from Vendor → Input.
Result:
Instead of generating a picking Input → Stock, the cross-dock push rule triggers, generating a picking Input → Output.
### Cause:
Rules are prioritized by product-specific rules, followed by warehouse rules:
https://github.com/odoo/odoo/blob/e3d54695862f73d9be6c35121def57ed641a1a45/addons/stock/models/stock_rule.py#L535-L539 The cross-dock push rule therefore overrides regular 2-step receipt rules, even though cross-dock routes only make sense for flows initiated by an SO.
#### Scenario 2: Cross-dock not set on the product
#### Issue: Cannot trigger cross-docking by any means → cross dock can not be the exception.
- Create an inventory-tracked product with only the buy route.
- Create an SO for 1 unit of the product and set the cross-dock route on the Sales Order Line (SOL). Confirm the SO.
> A purchase order (PO) is created.
- Confirm the PO.
> A regular receipt is generated.
- Confirm the receipt.
Result:
The flow proceeds as a regular 2-step delivery; the cross-dock route is not applied.
### Cause:
The SO uses the cross-dock route only for the buy rule to generate a PO. Once the PO is generated is role in this world is done. There is no way to provide a route on the PO, it will just generate a regular receipt: https://github.com/odoo/odoo/blob/e3d54695862f73d9be6c35121def57ed641a1a45/addons/purchase_stock/models/purchase_order_line.py#L343-L350 Once it is confirmed, the flow defaults to regular 2-step delivery rules, as the cross-dock route is neither a default nor set on the product.
### Fix:
We add the possibility of transmitting the route_id from the pol. As such, we make it possible to use the crossdock route by setting it on the sol, to generate a PO that will pursue with the crossdock route. Furthermore, we discourage to use the crossdock route on products/product categories by setting the default setable values to False.
opw-4380375
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#192362Description of the issue/feature this PR addresses: Current behavior before PR: 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#191402
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: 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#191402
Before this commit, `domain['reward_product_domain']` was being evaluated with `ast.literal_eval` while containing JSON-style booleans (`true/false`). That caused a `ValueError` because `true/false` are invalid in Python syntax. With this commit, we now use `json.loads` to parse the domain string, which correctly handles JSON booleans without error. opw-4458627 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193425
Original PR description
Before this commit, `domain['reward_product_domain']` was being evaluated with `ast.literal_eval` while containing JSON-style booleans (`true/false`). That caused a `ValueError` because `true/false` are invalid in Python syntax. With this commit, we now use `json.loads` to parse the domain string, which correctly handles JSON booleans without error. opw-4458627 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193425
This commit add few data on the report_invoice for Mauritius localization. task-4379202 Forward-Port-Of: odoo/odoo#194590 Forward-Port-Of: odoo/odoo#190723
Original PR description
This commit add few data on the report_invoice for Mauritius localization. task-4379202 Forward-Port-Of: odoo/odoo#194590 Forward-Port-Of: odoo/odoo#190723
Adds a configuration that can be used to mitigate PostgreSQL transactional errors with long-living connections and the `LISTEN/NOTIFY`[^1] functionality by re-establishing the database connection periodically. In the case that a connection outlives the transaction wraparound[^2] mechanism of postgres, the `LISTEN/NOTIFY` internal queue might contain references to transactions that have already been deleted by the system's (or a manual) `VACUUM`[^3] as it has its own transaction validit
Original PR description
Adds a configuration that can be used to mitigate PostgreSQL transactional errors with long-living connections and the `LISTEN/NOTIFY`[^1] functionality by re-establishing the database connection…
Adds a configuration that can be used to mitigate PostgreSQL
transactional errors with long-living connections and the
`LISTEN/NOTIFY`[^1] functionality by re-establishing the database
connection periodically.
In the case that a connection outlives the transaction wraparound[^2]
mechanism of postgres, the `LISTEN/NOTIFY` internal queue might contain
references to transactions that have already been deleted by the
system's (or a manual) `VACUUM`[^3] as it has its own transaction
validity mechanisms (roughly comparing transaction ids).
This can be reproduced by:
- Triggering a wraparound _AND_ cleaning of pg_xact between the cron's
`LISTEN` + `COMMIT` and its recyling.
- Having done at least one `NOTIFY` during that time period (?).
- Try to `LISTEN` to the same channel on the same database (transcation
id must be < than the first connection's transaction id).
The following is an example error message:
```
ERROR database odoo.service.server: Worker (3194772) Exception occurred, exiting...
Traceback (most recent call last):
File "/home/user/odoo/service/server.py", line 1089, in run
self.start()
File "/home/user/odoo/service/server.py", line 1235, in start
self.dbcursor.commit()
File "/home/user/odoo/sql_db.py", line 480, in commit
result = self._cnx.commit()
^^^^^^^^^^^^^^^^^^
psycopg2.errors.UndefinedFile: could not access status of transaction 1194816979
DETAIL: Could not open file "pg_xact/0473": No such file or directory.
```
[LISTEN/NOTIFY code](https://github.com/postgres/postgres/blob/REL_16_STABLE/src/backend/commands/async.c)
[Connection being kept](https://github.com/postgres/postgres/blob/REL_16_STABLE/src/backend/commands/async.c#L2167-L2191)
[See more](https://www.postgresql.org/message-id/flat/VE1PR03MB531295B1BDCFE422441B15FD92499%40VE1PR03MB5312.eurprd03.prod.outlook.com#7e36d1fdca921b5292e92c7017984ffa)
[^1]: https://www.postgresql.org/docs/current/sql-notify.html
[^2]: https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND
[^3]: https://www.postgresql.org/docs/17/sql-vacuum.html
Forward-Port-Of: odoo/odoo#194937
Forward-Port-Of: odoo/odoo#194141This commit makes use of the ir.cron.progress feature in the stock scheduler. The first approach is to simply count how many tasks have been completely done among the 5 currently available * stock - trigger orderpoints - merge quant & delete 0 quant - reserve confirm stock move * point_of_sale - close session * product_expiry - make alerts on expired lots They will be split in 5 different crons later to be able to count exactly the remaining records number to man
Original PR description
This commit makes use of the ir.cron.progress feature in the stock scheduler. The first approach is to simply count how many tasks have been completely done among the 5 currently available
* stock
- trigger orderpoints
- merge quant & delete 0 quant
- reserve confirm stock move
* point_of_sale
- close session
* product_expiry
- make alerts on expired lots
They will be split in 5 different crons later to be able to count exactly the remaining records number to manage in each sub tasks.
Description of the issue/feature this PR addresses:
Current behavior before PR:
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#189708Before this commit, it could happen that the autocomplete does not find the option to select. Now, we give the option to select so we're sure that the option exists when we select it. runbot errors: 5759, 102534, 111418 Forward-Port-Of: odoo/odoo#194672 Forward-Port-Of: odoo/odoo#124584
Original PR description
Before this commit, it could happen that the autocomplete does not find the option to select. Now, we give the option to select so we're sure that the option exists when we select it. runbot errors: 5759, 102534, 111418 Forward-Port-Of: odoo/odoo#194672 Forward-Port-Of: odoo/odoo#124584
**Problem**: When typing `@` in a non-collapsed selection (`a[b]`) and selecting an item from the mention list, the selection state becomes stale. This happens because `handleObserverRecords` calls `updateHints`, which relies on `getSelectionData`. However, `this.activeSelection` retains the outdated selection due to conditions like `documentSelectionIsInEditable` and `!this.activeSelection.anchorNode.isConnected` being `false`. As a result, `this.activeSelection` reflects `a[b]` while the D
Original PR description
**Problem**: When typing `@` in a non-collapsed selection (`a[b]`) and selecting an item from the mention list, the selection state becomes stale. This happens because `handleObserverRecords` calls…
**Problem**: When typing `@` in a non-collapsed selection (`a[b]`) and selecting an item from the mention list, the selection state becomes stale. This happens because `handleObserverRecords` calls `updateHints`, which relies on `getSelectionData`. However, `this.activeSelection` retains the outdated selection due to conditions like `documentSelectionIsInEditable` and `!this.activeSelection.anchorNode.isConnected` being `false`. As a result, `this.activeSelection` reflects `a[b]` while the DOM selection has already updated to `a[]`, leading to invalid offsets. **Solution**: Call `this.dependencies.selection.focusEditable();` during `onSelect` to ensure the selection is updated to reflect the editor state rather than the mention state. **Steps to Reproduce**: 1. Open the chatter. 2. Add some text. 3. Select a portion of the text. 4. Type `@`. 5. Select an item (person) from the mention list. 6. Observe a traceback error. opw-4498165 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194480
Current behavior before PR: When multiple types of lists were selected and the deleteBackward operation was performed, the list type remained unchanged. Desired behavior after PR is merged: When deleteBackward is pressed with multiple types of lists selected, and all selected content is removed, if the anchor node's list item is empty, that list item type will change to match the type of the list where the deleteBackward operation started. task:4187739 Forward-Port-Of: odoo/odoo#192
Original PR description
Current behavior before PR: When multiple types of lists were selected and the deleteBackward operation was performed, the list type remained unchanged. Desired behavior after PR is merged: When deleteBackward is pressed with multiple types of lists selected, and all selected content is removed, if the anchor node's list item is empty, that list item type will change to match the type of the list where the deleteBackward operation started. task:4187739 Forward-Port-Of: odoo/odoo#192446 Forward-Port-Of: odoo/odoo#180687
Steps to reproduce: - Create SO and add a product. - Apply discount coupon to SO. Issue: - Traceback occurs when the delivery module is not installed. Cause: - The line.is_delivery attribute is not accessible when the delivery module is not installed, leading to an error. Fix: - Use the line._is_delivery() method to correctly check for delivery lines. opw-4509360 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/
Original PR description
Steps to reproduce: - Create SO and add a product. - Apply discount coupon to SO. Issue: - Traceback occurs when the delivery module is not installed. Cause: - The line.is_delivery attribute is not accessible when the delivery module is not installed, leading to an error. Fix: - Use the line._is_delivery() method to correctly check for delivery lines. opw-4509360 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194839
In error_service, event.preventDefault() is required to prevent uncaught error message due to latest Chrome version (132) compatibility. Description of the issue/feature this PR addresses: Current behavior before PR: 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#194789
Original PR description
In error_service, event.preventDefault() is required to prevent uncaught error message due to latest Chrome version (132) compatibility. Description of the issue/feature this PR addresses: Current behavior before PR: 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#194789
Before this commit: =================== - The purchase tour was failing because the tour's JavaScript used an incorrect class selector (targeting 'partner_id'), which prevented it from locating the intended DOM element. Consequently, the sequence of actions was interrupted, causing the tour to break midway. After this commit: =================== - The issue has been resolved by updating the tour to use the correct and unique class selector. This ensures the tour accurately tar
Original PR description
Before this commit: =================== - The purchase tour was failing because the tour's JavaScript used an incorrect class selector (targeting 'partner_id'), which prevented it from locating the intended DOM element. Consequently, the sequence of actions was interrupted, causing the tour to break midway. After this commit: =================== - The issue has been resolved by updating the tour to use the correct and unique class selector. This ensures the tour accurately targets the intended element, allowing it to proceed without interruptions. As a result, the purchase tour runs successfully and achieves its intended purpose. TaskId: 4268662 Forward-Port-Of: odoo/odoo#194780 Forward-Port-Of: odoo/odoo#184735
**Steps to reproduce:** - Install Accounting - Configure a Check Layout in Accounting settings - Go to Bank journal configuration - Make sure that "Checks" payment mehtod doesn't have an Outstanding Payment account - Create a bill - Register a Check payment for the bill - Print the check **Issue:** All the data about the bill are missing from the check. **Cause:** These data were retrieved from the journal entry linked to the check payment. As there is no journal entry in this ca
Original PR description
**Steps to reproduce:** - Install Accounting - Configure a Check Layout in Accounting settings - Go to Bank journal configuration - Make sure that "Checks" payment mehtod doesn't have an Outstanding Payment account - Create a bill - Register a Check payment for the bill - Print the check **Issue:** All the data about the bill are missing from the check. **Cause:** These data were retrieved from the journal entry linked to the check payment. As there is no journal entry in this case, they cannot be computed. **Solution:** Compute these data from the amount of the check and the linked bills. opw-4482589 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194404
This commit ensures that the websocket connection is established when receiving a connect or initialized event. This can happen in multitab use of Odoo. Forward-Port-Of: odoo/odoo#194487 Forward-Port-Of: odoo/odoo#194343
Original PR description
This commit ensures that the websocket connection is established when receiving a connect or initialized event. This can happen in multitab use of Odoo. Forward-Port-Of: odoo/odoo#194487 Forward-Port-Of: odoo/odoo#194343
Follow up of https://github.com/odoo/odoo/pull/187799 The livechat override needs to be adapted as well to provide the token. - Login with Mitchell Admin to a database with im_livechat installed - Open support page as guest - The operator picture is missing opw-4489740 Forward-Port-Of: odoo/odoo#194414
Original PR description
Follow up of https://github.com/odoo/odoo/pull/187799 The livechat override needs to be adapted as well to provide the token. - Login with Mitchell Admin to a database with im_livechat installed - Open support page as guest - The operator picture is missing opw-4489740 Forward-Port-Of: odoo/odoo#194414
**Description of the issue/feature this PR addresses**: 1) It is necessay not to set "Existing Third Party Checks" outgoing payment method in all argentinean cash journals. It is only needed to be set on "Third Party Checks" and "Rejected Third Party Checks" Argentinean journals that are created when the module is installed or a new argentinean company is created. 2) Also when a user mistakenly remove the 'Existing Third Party Checks' payment method from the 'Third Party Checks' journal then
Original PR description
**Description of the issue/feature this PR addresses**: 1) It is necessay not to set "Existing Third Party Checks" outgoing payment method in all argentinean cash journals. It is only needed to be…
**Description of the issue/feature this PR addresses**: 1) It is necessay not to set "Existing Third Party Checks" outgoing payment method in all argentinean cash journals. It is only needed to be set on "Third Party Checks" and "Rejected Third Party Checks" Argentinean journals that are created when the module is installed or a new argentinean company is created. 2) Also when a user mistakenly remove the 'Existing Third Party Checks' payment method from the 'Third Party Checks' journal then is not able to add it back. This bug was introduced on this commit https://github.com/odoo/odoo/pull/188451/commits/0618fff9f9bb4716d22dc2ce8950cada824b90f4. **Current behavior before PR**: 1) "Existing Third Party Checks" outgoing payment method is set in all argentinean cash journals. 2) When a user mistakenly remove the 'Existing Third Party Checks' payment method from the 'Third Party Checks' journal then is not able to add it back. **Desired behavior after PR is merged**: 1) "Existing Third Party Checks" outgoing payment method is set only in "Third Party Checks" and "Rejected Third Party Checks" argentinean journals. 2) When a user mistakenly remove the 'Existing Third Party Checks' payment method from the 'Third Party Checks' journal then is able to add it back. _Ticket Adhoc side_: 83443 _Task Latam side_: 1309 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194713
account.root is a technical model only meant to be used in the side panel and therefore only has a limited ORM functionality. Trying to search on anything else than the ID is not allowed, and rather useless since a domain on `root_id` and be replaced with a domain on the account (or it's display_name) directly. Instead of: * `[('root_id', 'ilike', prefix)]`, use `[('display_name', 'ilike', prefix)]` * `[('account_id.root_id', 'ilike', prefix)]`, use `[('account_id', 'ilike', prefix)]` This
Original PR description
account.root is a technical model only meant to be used in the side panel and therefore only has a limited ORM functionality. Trying to search on anything else than the ID is not allowed, and rather useless since a domain on `root_id` and be replaced with a domain on the account (or it's display_name) directly.
Instead of:
* `[('root_id', 'ilike', prefix)]`, use `[('display_name', 'ilike', prefix)]`
* `[('account_id.root_id', 'ilike', prefix)]`, use `[('account_id', 'ilike', prefix)]`
This commit simply redirects the user to the alternate field.
Forward-Port-Of: odoo/odoo#194165Steps to reproduce: - have two companies A and B - create a new partner - create a new payment term for Company A - In Company A, set the customer's payment term the newly created one - Configure aliases for invoice in company A and B - Make sure the default company for OdooBot is COmpany A - Send an email to company B Issue: Access Error Cause: payment_term is pre-compute and the company context is the one of OdooBot opw-4103229 Forward-Port-Of: odoo/odoo#184482 Forward-Port-
Original PR description
Steps to reproduce: - have two companies A and B - create a new partner - create a new payment term for Company A - In Company A, set the customer's payment term the newly created one - Configure aliases for invoice in company A and B - Make sure the default company for OdooBot is COmpany A - Send an email to company B Issue: Access Error Cause: payment_term is pre-compute and the company context is the one of OdooBot opw-4103229 Forward-Port-Of: odoo/odoo#184482 Forward-Port-Of: odoo/odoo#178829
The combo configurator works with `product.product` records, so previously, we only allowed to configure `no_variant` PTALs. However, we should also allow to configure the `product.product`'s custom PTAVs (which can be `always` or `dynamic`). Moreover, we always allowed to configure `no_variant` PTALs, even if they weren't configurable (i.e. PTALs with a single, non-custom, non-multicheckbox PTAV). However, such PTAVs should be preselected and non-configurable in the combo configurator.
Original PR description
The combo configurator works with `product.product` records, so previously, we only allowed to configure `no_variant` PTALs. However, we should also allow to configure the `product.product`'s custom PTAVs (which can be `always` or `dynamic`). Moreover, we always allowed to configure `no_variant` PTALs, even if they weren't configurable (i.e. PTALs with a single, non-custom, non-multicheckbox PTAV). However, such PTAVs should be preselected and non-configurable in the combo configurator. Forward-Port-Of: odoo/odoo#191130
Description of the issue/feature this PR addresses: This commit introduces system parameter to skip the creation of bank account in the reconciliation of bank statements. The issue it can solve happens when 2 different commercial entities use the same paying partner (ie a partner that is not a subcontact) to pay their invoices. When an invoice is paid by the paying partner, Odoo will store the account number that was used for the transfer on account.bank.statement.line. When this statem
Original PR description
Description of the issue/feature this PR addresses: This commit introduces system parameter to skip the creation of bank account in the reconciliation of bank statements. The issue it can solve…
Description of the issue/feature this PR addresses: This commit introduces system parameter to skip the creation of bank account in the reconciliation of bank statements. The issue it can solve happens when 2 different commercial entities use the same paying partner (ie a partner that is not a subcontact) to pay their invoices. When an invoice is paid by the paying partner, Odoo will store the account number that was used for the transfer on account.bank.statement.line. When this statement line is reconciled with an invoice, if the bank account was not stored on the partner previously, a res.partner.bank will be created automatically. When another payment is coming from the same bank account, Odoo will then select the partner linked to the bank account that it did store previously, even if the payment was for an invoice linked to another partner, and it will not propose the proper invoice in the reconciliation widget, even if it uses an exact match on the payment reference number. Having a parameter allowing to skip creation of the bank account in Odoo will allow the reconciliation to be based striclty on the reference number. Current behavior before PR: Bank account is stored and wrong invoices are proposed by the reconciliation widget Desired behavior after PR is merged: Allow to avoid storing bank account and having wrong invoices are proposed by the reconciliation widget --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#173546 Forward-Port-Of: odoo/odoo#168029
This is a rework of the mexican localisation to make it compliant with the local authorities. In our case, it will be a working system only for the full-time jobs. The other cases will be coming separately. Task: 3673251 Forward-Port-Of: odoo/odoo#189466
Original PR description
This is a rework of the mexican localisation to make it compliant with the local authorities. In our case, it will be a working system only for the full-time jobs. The other cases will be coming separately. Task: 3673251 Forward-Port-Of: odoo/odoo#189466
We update quote detection for gmail and outlook: - gmail has simple wrapper divs with explicit classes - outlook has a mix of div ids and simple pattern-based quoting (everything under "<hr><div id="divRplyFwdMsg"/> seems to be considered a quote) Previously gmail just used blockquote, which still works but does not capture "On xx:xx:xx X <X@gmail.com> wrote:" headers, which are caught for outlook. Previously outlook had a wrapper div around divRplyFwdMsg which would set data-o-mail-quot
Original PR description
We update quote detection for gmail and outlook: - gmail has simple wrapper divs with explicit classes - outlook has a mix of div ids and simple pattern-based quoting (everything under "<hr><div id="divRplyFwdMsg"/> seems to be considered a quote) Previously gmail just used blockquote, which still works but does not capture "On xx:xx:xx X <X@gmail.com> wrote:" headers, which are caught for outlook. Previously outlook had a wrapper div around divRplyFwdMsg which would set data-o-mail-quote-container on it, and propagate to children. However it seems that outer div was either removed or is not always present, a heuristic is thus needed. task-4381505 Forward-Port-Of: odoo/odoo#194722 Forward-Port-Of: odoo/odoo#192875
Since #584a172, controller endpoints can specify `readonly=False` if they are expected to write to the DB. The webhook endpoint for Viva Wallet was previously not specified this way, which leads to a warning being logged. This commit simply adds `readonly=False` to the webhook endpoint to prevent the warning. task-4472274 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193371
Original PR description
Since #584a172, controller endpoints can specify `readonly=False` if they are expected to write to the DB. The webhook endpoint for Viva Wallet was previously not specified this way, which leads to a warning being logged. This commit simply adds `readonly=False` to the webhook endpoint to prevent the warning. task-4472274 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193371
Before this commit, `mail.ir_cron_post_scheduled_message` fails with a traceback when there are a lot of scheduled messages to be sent. Steps to reproduce ----- 1. Create a scheduled message from the chatter full composer 2. Duplicate it 50+ times 3. Run the scheduled action "Mail: Post scheduled messages" 4. Traceback occurs ``` File "/home/odoo/src/odoo/odoo/api.py", line 553, in __new__ assert isinstance(cr, BaseCursor) ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ``` Cause ---
Original PR description
Before this commit, `mail.ir_cron_post_scheduled_message` fails with a traceback when there are a lot of scheduled messages to be sent. Steps to reproduce ----- 1. Create a scheduled message from the chatter full composer 2. Duplicate it 50+ times 3. Run the scheduled action "Mail: Post scheduled messages" 4. Traceback occurs ``` File "/home/odoo/src/odoo/odoo/api.py", line 553, in __new__ assert isinstance(cr, BaseCursor) ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError ``` Cause ----- This commit (df18d5257cef737f3e1d245a8b85769e1fe1a032) introduced this cron which posts past-due scheduled messages with a default `limit=50`. If there are more messages than the limit, the cron is triggered again. However, there is a typo when restarting the cron that incorrectly calls `env`. Solution ----- Change the line to use `env.ref()` to correctly access the xml_id and restart the cron. opw-4474171 Forward-Port-Of: odoo/odoo#194233
Currently in v18 Stripe payments are broken and don't work anymore. This PR adjusts the code so that Stripe works again in self order mode. It fixes the error "An error has occured" seen when sending a payment to a Stripe terminal + it also fixes the response sent to PoS to confirm Stripe payments. opw-4283413 opw-4358017 Forward-Port-Of: odoo/odoo#194691
Original PR description
Currently in v18 Stripe payments are broken and don't work anymore. This PR adjusts the code so that Stripe works again in self order mode. It fixes the error "An error has occured" seen when sending a payment to a Stripe terminal + it also fixes the response sent to PoS to confirm Stripe payments. opw-4283413 opw-4358017 Forward-Port-Of: odoo/odoo#194691
Steps to reproduce: 1. Set a flexible working schedule with 40h / week and 8h / day for an employee 2. Record an attendance for the employee 3. Go to reporting, the expected hours is the same as the worked hours Expected behavior: The expected hours should be what was set in the schedule, which is 8 hours Explanation: The calculation of expected hours is based on the difference between overtime hours and worked hours. This is done to ensure the overtimes are always computed correctly.
Original PR description
Steps to reproduce: 1. Set a flexible working schedule with 40h / week and 8h / day for an employee 2. Record an attendance for the employee 3. Go to reporting, the expected hours is the same as the worked hours Expected behavior: The expected hours should be what was set in the schedule, which is 8 hours Explanation: The calculation of expected hours is based on the difference between overtime hours and worked hours. This is done to ensure the overtimes are always computed correctly. However if the overtime duration is negative, it is not taken into account in `_update_overtime`. This commit allows negative amounts for overtime hours. opw-4388707 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193523
## How to reproduce: - Create product P, tracked by lot, cost_method = 'standard', standard_price = 1 - Create quant with lot L1, 10 units on hand - Set L1 standard_price = 2 - Set lot_valuated to True => lot value_svl is $10 for 10 units (product.standard_price * quantity) - Set L1 quantity to 0 => lot value_svl is $-10 for 0 units ## Issue When the svl is replenished for the lot, the product.standard_price is used. However, the lot.standard_price is not updated; hence, when the stock
Original PR description
## How to reproduce: - Create product P, tracked by lot, cost_method = 'standard', standard_price = 1 - Create quant with lot L1, 10 units on hand - Set L1 standard_price = 2 - Set lot_valuated to True => lot value_svl is $10 for 10 units (product.standard_price * quantity) - Set L1 quantity to 0 => lot value_svl is $-10 for 0 units ## Issue When the svl is replenished for the lot, the product.standard_price is used. However, the lot.standard_price is not updated; hence, when the stock is emptied, and the lot.standard_price is used, a discrepancy is created. ## Solution When the svl is replenished, we u se the product.standard_price and update the lot.standard_price --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193770
Steps to Reproduce: • Install the Time Off app. • Create a new user and corresponding employee without any group in Time Off. • Create a new time off request with a start date < today's date. • Attempt to change the date, which results in a validation error. Issue: - Users are unable to modify time off requests, even if they are not yet approved. Fix: - Added a check to ensure that modifications are allowed for time off requests that are not in an approved state. task-4236572
Original PR description
Steps to Reproduce: • Install the Time Off app. • Create a new user and corresponding employee without any group in Time Off. • Create a new time off request with a start date < today's date. • Attempt to change the date, which results in a validation error. Issue: - Users are unable to modify time off requests, even if they are not yet approved. Fix: - Added a check to ensure that modifications are allowed for time off requests that are not in an approved state. task-4236572 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194747 Forward-Port-Of: odoo/odoo#190944
Add missing index on move_line_id to speedup checking the check_ids of a stock_move_line. See community PR for more info https://github.com/odoo/odoo/pull/190479 Forward-Port-Of: odoo/enterprise#75537
Original PR description
Add missing index on move_line_id to speedup checking the check_ids of a stock_move_line. See community PR for more info https://github.com/odoo/odoo/pull/190479 Forward-Port-Of: odoo/enterprise#75537
**[IMP] account_reports: hide "Amount Currency" in PL if single currency** Currently, the column "Amount Currency" is displayed in the partner ledger even in a single currency setup. With this commit, it will now be hidden. **[FIX] account_reports: fix isNextLineChild** Currently, `isNextLineChild` method will consider `~account.report~14|~res.partner~10|0~account.move.line~32` being a a child of `~account.report~14|~res.partner~10|0~account.move.line~3` as the first string star
Original PR description
**[IMP] account_reports: hide "Amount Currency" in PL if single currency** Currently, the column "Amount Currency" is displayed in the partner ledger even in a single currency setup. With this commit, it will now be hidden. **[FIX] account_reports: fix isNextLineChild** Currently, `isNextLineChild` method will consider `~account.report~14|~res.partner~10|0~account.move.line~32` being a a child of `~account.report~14|~res.partner~10|0~account.move.line~3` as the first string starts with the second one. This is wrong, they are siblings. The fix here is to add a pipe, as done in `isLineChildOf`. **task-4321032** Forward-Port-Of: odoo/enterprise#77590 Forward-Port-Of: odoo/enterprise#73843
In quant_barcode_model we fetch the quant at the new line creation. It's use in order to define the current theorical inventory quantity. But with rfid, it could be heavy since each serial number can be a new line and doing an rpc by line will be a bottleneck. To improve it, each time we add a product in the cache, we also add the associated quants. During the new line creation, we search for the product in the cache rather than doing an rpc with a specific domain Forward-Port-Of: odoo/en
Original PR description
In quant_barcode_model we fetch the quant at the new line creation. It's use in order to define the current theorical inventory quantity. But with rfid, it could be heavy since each serial number can be a new line and doing an rpc by line will be a bottleneck. To improve it, each time we add a product in the cache, we also add the associated quants. During the new line creation, we search for the product in the cache rather than doing an rpc with a specific domain Forward-Port-Of: odoo/enterprise#71660
[FIX] documents, documents_hr: fix company folder protection How to reproduce: - install documents_hr - In Document, create a folder prjComp2 in /Marketing/Brand 2 - create a second company: SecondCompany - Select SecondCompany - Activate centralization of document for HR and select prjComp2 folder - Log as Marc Demo and delete the folder Brand 2 (Move to Trash + delete) There is no error while this folder should have been protected by the method _raise_if_used_folder called when arc
Original PR description
[FIX] documents, documents_hr: fix company folder protection How to reproduce: - install documents_hr - In Document, create a folder prjComp2 in /Marketing/Brand 2 - create a second company:…
[FIX] documents, documents_hr: fix company folder protection How to reproduce: - install documents_hr - In Document, create a folder prjComp2 in /Marketing/Brand 2 - create a second company: SecondCompany - Select SecondCompany - Activate centralization of document for HR and select prjComp2 folder - Log as Marc Demo and delete the folder Brand 2 (Move to Trash + delete) There is no error while this folder should have been protected by the method _raise_if_used_folder called when archiving or deleting a folder. The cause is that Marc user doesn't have access to SecondCompany and as the check is not done in sudo in _raise_if_used_folder, the folder is not identified as a folder to be protected. We solve the issue by running the check in sudo. Technical note: the protection mechanism is defined in the documents app but tested in documents_hr because there is no company folder defined in documents that could be used in a test. [FIX] documents,documents_project: fix document deletion How to reproduce (Move to the Trash): - Install documents_project - Remove any access to the project folder (except to Mitchel Admin) - Login as Marc Demo - Upload a file in Marketing - Move that file to the Trash You get an access error while you should be able to move that document to the Trash. How to reproduce (Delete): - install documents_project - Login as Marc Demo - Upload a file in Marketing - Move it to the Trash - Remove any access to the project folder (except to Mitchel Admin) - As Marc Demo, go to the Trash and delete the document You get an access error while you should be able to delete that document. We solve the problem by doing the check in sudo (in unlink_except_project_folder). Technical note: We haven't done that test in documents (where there are already delete tests) because we had to change the test so that they are executed after all the modules are installed and that cause query count issue in performance tests. Task-4480581 Forward-Port-Of: odoo/enterprise#77162
Several things addressed on the details panel. A. When editing a previewed document, no data was saved. When editing a previewed document, no data was saved. Reproduce: 1. Without selecting any document, open a preview 2. Rename the document or add a tag 3. Close the preview 4. Reload the page 5. See that changes were not saved BTW, tags could not be created from the inspector, it's not clear why. Technical note: for previewed record, that are not "selected" when we update
Original PR description
Several things addressed on the details panel. A. When editing a previewed document, no data was saved. When editing a previewed document, no data was saved. Reproduce: 1. Without selecting any…
Several things addressed on the details panel. A. When editing a previewed document, no data was saved. When editing a previewed document, no data was saved. Reproduce: 1. Without selecting any document, open a preview 2. Rename the document or add a tag 3. Close the preview 4. Reload the page 5. See that changes were not saved BTW, tags could not be created from the inspector, it's not clear why. Technical note: for previewed record, that are not "selected" when we update them, we need to force saving immediately. For records that are selected, we can leave the webclient behavior for saving records (urgent save). This can lead to having tracked fields being immediately reported (seen in chatter) when editing previewed documents but not the others. This is acceptable for simplicity. B. When showing data for the current folder opened, the contact info was missing (partner_id). Reproduce: 1. Go inside any folder 2. Without selecting any documents, add a contact to the current folder via the details panel 4. Reload the page 5. The partner doesn't show up in the field (even though it is updated on the record). C. U pdate previewed document only Reproduce: 1. Select two records 2. Preview one of them 3. Change a value in the details panel 4. Both records were modified instead of the previewed one only We're also fixing the removal of the correct documents from the kanban view when documents are moved and making sure we do not try to edit this document again as it could likely not be in the view anymore at all. Task-4465443 Forward-Port-Of: odoo/enterprise#77136
### Steps to reproduce: - Install helpdesk_sale_timesheet module - Go to Timesheets and click on 'Add a line' - Set a task while the project is empty - Notice the project is not automatically filled with the task's project ### Cause: This is happening because while changing the task it trigger the computation of the helpdesk_ticket_id where it checks if something changed and if not we are removing the project_id from the computation tree. https://github.com/odoo/enterprise/blob/f5384
Original PR description
### Steps to reproduce: - Install helpdesk_sale_timesheet module - Go to Timesheets and click on 'Add a line' - Set a task while the project is empty - Notice the project is not automatically filled with the task's project ### Cause: This is happening because while changing the task it trigger the computation of the helpdesk_ticket_id where it checks if something changed and if not we are removing the project_id from the computation tree. https://github.com/odoo/enterprise/blob/f53841d756c532a95fccc15aca986143dfb53337/helpdesk_timesheet/models/analytic.py#L54-L60 ### Fix: Checking if the record is not created yet we won't remove the project_id from the computation tree to make sure it will get computed and auto-populate opw-4478579 opw-4457347 Forward-Port-Of: odoo/enterprise#77418
#### Issue: - When an employee is assigned a resource calendar with the `flexible_hours` option enabled, the daily/weekly overtime on the timesheet calendar is not calculated based on the 'Average Hour per Day' that we set for the flexible resource, it is instead being calculated based on the specific work intervals. #### Steps to reproduce: 1. Assign a resource calendar with `flexible_hours` enabled to an employee. 2. Ensure the calendar has a defined `hours_per_day` value. 3. Verify
Original PR description
#### Issue: - When an employee is assigned a resource calendar with the `flexible_hours` option enabled, the daily/weekly overtime on the timesheet calendar is not calculated based on the 'Average…
#### Issue: - When an employee is assigned a resource calendar with the `flexible_hours` option enabled, the daily/weekly overtime on the timesheet calendar is not calculated based on the 'Average Hour per Day' that we set for the flexible resource, it is instead being calculated based on the specific work intervals. #### Steps to reproduce: 1. Assign a resource calendar with `flexible_hours` enabled to an employee. 2. Ensure the calendar has a defined `hours_per_day` value. 3. Verify that the timesheet grid correctly shows the daily/weekly overtime hours as per `hours_per_day`. 4. Test with non-flexible schedules to confirm existing behavior remains unchanged. #### Solution: - In the frontend, the method `fetchDailyWorkingHours` retrieves daily working hours data by calling the backend method `get_daily_working_hours`. - This method computes working hours based on the employee's `resource_calendar_id` and its associated work intervals. However, It does not check if the `flexible_hours` flag is enabled on the `resource_calendar_id`. For employees with flexible schedules, the backend still calculates working hours based on detailed intervals instead of simply using the `hours_per_day` value defined in the `resource_calendar`. - To fix this I ensure we respect flexible schedules by using `hours_per_day` directly when `flexible_hours` is enabled. opw-4407910 Forward-Port-Of: odoo/enterprise#77315
See test in this commit to reproduce. Forward-Port-Of: odoo/enterprise#77563
Original PR description
See test in this commit to reproduce. Forward-Port-Of: odoo/enterprise#77563
1st issue: Since the introduction of the [media command] in the editor, replacing the previous `/file`, some tour steps of a disabled test became obsolete. This commit fixes these steps according to changes introduced along the `/media` command, in order to re-enable this test. 2nd issue: Other steps were incorrectly modified by [this commit] and had to be adapted too, related to the composer signature. 3rd issue: An embedded video was present in an article body in the readonly to
Original PR description
1st issue: Since the introduction of the [media command] in the editor, replacing the previous `/file`, some tour steps of a disabled test became obsolete. This commit fixes these steps according to…
1st issue: Since the introduction of the [media command] in the editor, replacing the previous `/file`, some tour steps of a disabled test became obsolete. This commit fixes these steps according to changes introduced along the `/media` command, in order to re-enable this test. 2nd issue: Other steps were incorrectly modified by [this commit] and had to be adapted too, related to the composer signature. 3rd issue: An embedded video was present in an article body in the readonly tour, and the patch supposed to neutralize it (to avoid external http requests) was applied in a manner that resulted in an indeterministic result: Sometimes the article body was loaded with the video, resulting in errors, sometimes the patch was applied resulting in the tour performing normally. This commit fixes the issue by ensuring there is no embedded video after the end of the editable tour, so that there is no need to care about it in the readonly tour. [media command]: https://github.com/odoo/odoo/commit/96c8c398c0fbef519b56edf4941691d11372eac0 [this commit]: https://github.com/odoo/enterprise/commit/1a73e227a5ce9fb1194e5664c8c4f5fcfe51b572 runbot-task-111948 Forward-Port-Of: odoo/enterprise#77654
Bug 1 ===== The chatter in the list view never open on the current folder / selected document. Bug 2 ===== If we are in the list view, and we are inside a folder, when selecting a document, it will show "Unnamed" for the folder. The reason is that with `column_invisible=1`, the display name is not loaded. To solve that, we can put the field in `optional="hide"`. Task-4461038 Forward-Port-Of: odoo/enterprise#76699
Original PR description
Bug 1 ===== The chatter in the list view never open on the current folder / selected document. Bug 2 ===== If we are in the list view, and we are inside a folder, when selecting a document, it will show "Unnamed" for the folder. The reason is that with `column_invisible=1`, the display name is not loaded. To solve that, we can put the field in `optional="hide"`. Task-4461038 Forward-Port-Of: odoo/enterprise#76699
Currently, simple pos users can see the due amount of the customers, unless the customer wasn't loaded and we need to search for a customer that isn't loaded. Steps to reproduce: ------------------- * Create a new customer, make a sale order and invoice it. This will set an amount due for that customer * Connect to the shop with a user that has the `point_of_sale.group_pos_user` but not the `account.group_account_readonly` group * Open customer list > Observation: You can see the amount
Original PR description
Currently, simple pos users can see the due amount of the customers, unless the customer wasn't loaded and we need to search for a customer that isn't loaded. Steps to reproduce: -------------------…
Currently, simple pos users can see the due amount of the customers, unless the customer wasn't loaded and we need to search for a customer that isn't loaded. Steps to reproduce: ------------------- * Create a new customer, make a sale order and invoice it. This will set an amount due for that customer * Connect to the shop with a user that has the `point_of_sale.group_pos_user` but not the `account.group_account_readonly` group * Open customer list > Observation: You can see the amount due for multiple customers * Search for the customer created * Select search more > You can't see the amount due for that customer Why the fix: ------------ Since simple pos users are allowed to see the amount due for the loaded customer, there is no reason they shouldn't see it as well for a customer they need to load. Commit allowing simple pos users to see (and settle) customer accounts: https://github.com/odoo/enterprise/commit/37fa4d5f4ed7c7d77f73395a53b7b3ab7006afc4 When loading the pos session `_loader_params_res_partner` is called first and later is called `_get_pos_ui_res_partner`. It is in the function `_get_pos_ui_res_partner` that the amount due is compted if the user does not belong to the group `account.group_account_readonly`. https://github.com/odoo/enterprise/blob/a35a4755cdf86bcfeda0aca6c06397748ba27362/pos_settle_due/models/pos_session.py#L22-L28 However when we load a customer that wasn't previously loaded, only `_loader_params_res_partner` is loaded. And since the users does not belong to the group `account.group_account_readonly`, the field witll not get loaded. We now compute the amount due with the same logic as in `_get_pos_ui_res_partner`. opw-4141955 Forward-Port-Of: odoo/enterprise#77604 Forward-Port-Of: odoo/enterprise#73671
task-4328333 Forward-Port-Of: odoo/enterprise#76727
Original PR description
task-4328333 Forward-Port-Of: odoo/enterprise#76727
The REV line was introduced in 18.0 when revamping the P&L, here: https://github.com/odoo/enterprise/commit/cbe74884b937f630cf1d2ccf475a04e70b6f4669 Following this change, this line should be used in the formula of the Net profit margin of the Executive Summary, as stated here https://www.investopedia.com/terms/n/net_margin.asp Forward-Port-Of: odoo/enterprise#77524
Original PR description
The REV line was introduced in 18.0 when revamping the P&L, here: https://github.com/odoo/enterprise/commit/cbe74884b937f630cf1d2ccf475a04e70b6f4669 Following this change, this line should be used in the formula of the Net profit margin of the Executive Summary, as stated here https://www.investopedia.com/terms/n/net_margin.asp Forward-Port-Of: odoo/enterprise#77524
Steps to reproduce: 1) Configure SEPA provider 2) Input wrong IBAN 3) See UI blocked After this commit when a rpc error happens during payment processing UI is unblocked allowing user to see the error. opw-4411773 Forward-Port-Of: odoo/enterprise#77634
Original PR description
Steps to reproduce: 1) Configure SEPA provider 2) Input wrong IBAN 3) See UI blocked After this commit when a rpc error happens during payment processing UI is unblocked allowing user to see the error. opw-4411773 Forward-Port-Of: odoo/enterprise#77634
The uninstallation of this test module, which is a standard step during upgrades, requires the removal of the test product `product_fire_insurance`. This product is referenced by sale orders and invoices and deferred invoices created dynamically and have no xmlids, blocking the removal of the record. This commits adds the xmlids to the dynamically created orders and moves so they can be removed as well during the module uninstallation. The target sale orders are those created via 'copy' and whe
Original PR description
The uninstallation of this test module, which is a standard step during upgrades, requires the removal of the test product `product_fire_insurance`. This product is referenced by sale orders and invoices and deferred invoices created dynamically and have no xmlids, blocking the removal of the record. This commits adds the xmlids to the dynamically created orders and moves so they can be removed as well during the module uninstallation. The target sale orders are those created via 'copy' and when doing upsell and renew for subscriptions. The target moves are the regular invoices for the sale orders and their deferred moves. Forward-Port-Of: odoo/enterprise#77657 Forward-Port-Of: odoo/enterprise#76813
Before this commit, `_compute_past_shift` method will compute the `is_past` but also set `request_to_switch` field to False when the shift is in the past and `request_to_switch` was truely. The problem is the `_compute_past_shift` could be only called to read `is_past` field and so the cursor is sometimes in readonly to only allow SQL queries to fetch data. This commit makes sure the `_compute_past_shift` method will only alter `is_past` field and alter `request_to_switch` inside the met
Original PR description
Before this commit, `_compute_past_shift` method will compute the `is_past` but also set `request_to_switch` field to False when the shift is in the past and `request_to_switch` was truely. The problem is the `_compute_past_shift` could be only called to read `is_past` field and so the cursor is sometimes in readonly to only allow SQL queries to fetch data. This commit makes sure the `_compute_past_shift` method will only alter `is_past` field and alter `request_to_switch` inside the method that could be called when `request_to_switch` is truly for the shift contains in self. A cron is not added to make sure the request_to_switch for the shifts in the past will be set to False because the actual code is sufficient since we usually check if the shift is in the past before allowing the action or displaying the button. runbot-66162 task-4276516 Forward-Port-Of: odoo/enterprise#77523 Forward-Port-Of: odoo/enterprise#68031
The goal of this commit is to remove the AR, AP and G prefix when exporting the journal report to a PDF. This was first introduced here: https://github.com/odoo/enterprise/commit/d023d914dce1b23bf321252fb844c780e831f003 We now want to revert back that idea task-4453514 Forward-Port-Of: odoo/enterprise#77476
Original PR description
The goal of this commit is to remove the AR, AP and G prefix when exporting the journal report to a PDF. This was first introduced here: https://github.com/odoo/enterprise/commit/d023d914dce1b23bf321252fb844c780e831f003 We now want to revert back that idea task-4453514 Forward-Port-Of: odoo/enterprise#77476
Forward-Port-Of: odoo/enterprise#77473
Original PR description
Forward-Port-Of: odoo/enterprise#77473
In this PR: - Introduced a new method `_get_gstr_responsible_activity_and_user` to dynamically retrieve or create the GSTR-1 exception mail activity type and determine the responsible user for handling GSTR-1 errors. - Ensured that the activity type is created on-the-fly if it does not exist, avoiding potential errors during execution. - Updated `check_gstr1_status` to utilize the new method for assigning the responsible user and activity type when scheduling activities for invoices with
Original PR description
In this PR: - Introduced a new method `_get_gstr_responsible_activity_and_user` to dynamically retrieve or create the GSTR-1 exception mail activity type and determine the responsible user for…
In this PR: - Introduced a new method `_get_gstr_responsible_activity_and_user` to dynamically retrieve or create the GSTR-1 exception mail activity type and determine the responsible user for handling GSTR-1 errors. - Ensured that the activity type is created on-the-fly if it does not exist, avoiding potential errors during execution. - Updated `check_gstr1_status` to utilize the new method for assigning the responsible user and activity type when scheduling activities for invoices with GSTR-1 errors. - Improved logic to determine the responsible user: - Default to the activity type's `default_user_id` if they belong to the appropriate group and company. - Fallback to the last relevant `mail.message` for identifying a responsible user. - Enhanced activity scheduling to use the identified activity type and responsible user, improving traceability and accountability. This change improves error handling in the GSTR-1 process and ensures better alignment with user responsibilities. Forward-Port-Of: odoo/enterprise#77002
This commit ensures that the websocket connection is established when receiving a connect or initialized event. This can happen in multitab use of Odoo. Forward-Port-Of: odoo/enterprise#77477 Forward-Port-Of: odoo/enterprise#77416
Original PR description
This commit ensures that the websocket connection is established when receiving a connect or initialized event. This can happen in multitab use of Odoo. Forward-Port-Of: odoo/enterprise#77477 Forward-Port-Of: odoo/enterprise#77416
The test breaks https://github.com/odoo/odoo/pull/184482 In 18.0, partner ledger is used for the followup. Keep the test as it still assess we recover the lines correctly. Forward-Port-Of: odoo/enterprise#73668
Original PR description
The test breaks https://github.com/odoo/odoo/pull/184482 In 18.0, partner ledger is used for the followup. Keep the test as it still assess we recover the lines correctly. Forward-Port-Of: odoo/enterprise#73668
This is a rework of the mexican localisation to make it compliant with the local authorities. Task: 3673251 Forward-Port-Of: odoo/enterprise#73381
Original PR description
This is a rework of the mexican localisation to make it compliant with the local authorities. Task: 3673251 Forward-Port-Of: odoo/enterprise#73381
[FIX] documents: clean portal action We disable action that portal user cannot perform: In the preview: - hide Split Pdf in the preview In the cog menu: - remove "Move to Trash" as portal user can't archive document (and can't create folder nor access to the trash anyway) - Info&Tags as it opens the chatter which is disabled for portal user In action: - Info&Tags as it opens the chatter which is disabled for portal user - Duplicate only present if it doesn't lead to an error (ca
Original PR description
[FIX] documents: clean portal action We disable action that portal user cannot perform: In the preview: - hide Split Pdf in the preview In the cog menu: - remove "Move to Trash" as portal user can't…
[FIX] documents: clean portal action We disable action that portal user cannot perform: In the preview: - hide Split Pdf in the preview In the cog menu: - remove "Move to Trash" as portal user can't archive document (and can't create folder nor access to the trash anyway) - Info&Tags as it opens the chatter which is disabled for portal user In action: - Info&Tags as it opens the chatter which is disabled for portal user - Duplicate only present if it doesn't lead to an error (canDuplicateSelection method). We also remove the line separator in the action if the user is not internal otherwise it leads sometimes to an empty section. In the "New" drop down button: - hide "Folder" (create Folder) - hide "Link" (create link): fails because of (users | folders.owner_id).fetch(['partner_id']) in _prepare_create_values (no access to user) Hide share button for portal user: Although the portal users could share any documents they have access to (by sending them by email for example), we remove the share action (for document and folder) for them as the only thing they could do was to change the rights for user that had already a link to that document. [FIX] documents: fix attachment not pointing to the copied document When copying a document, the copied attachment still points to the orginal record: - if it is a document with an attachment associated to an other record (ex.: hr.expense). The attachment of the copied document is pointing to the same record as the orginal document. Ex.: for an expense, the expense has now 2 attachments linked (one linked to the original document and one linked to the copied one). - if it is a pure document, the attachment points to the orginal document We solve that problem here by always making the copied attachment to the copied document. How to reproduce case 1: - Install documents_hr_expense - Upload a document in the Document App - Create an expense from that document - Duplicate that document - Open the expense App - The expense related to the document has now 2 attachments instead of one How to reproduce case 2: - Install documents - Log in as admin and open Documents App - In Marketing -> Brand 1, duplicate "LA landscape.jpg" - Move "LA landscape.jpg" to the Trash and delete it (from the Trash) - Return to Marketing -> Brand 1 The copy has disappeared as well and shoudln't. It means that deleting the original document deletes all copies. It works also if we delete the copy (it deletes the original). [IMP] documents: allow portal user to delete their own documents Instead of enabling the Trash for the portal user, we add the delete action for their own documents only so that a user that have uploaded a document by mistake can delete it. Indeed, as portal user don't have access to the Trash, moving a document to the Trash like an internal user would do is no use. Task-4221258 Forward-Port-Of: odoo/enterprise#77281
The tool tip is being replaced with a more concise message. task-4437887 Forward-Port-Of: odoo/enterprise#77486 Forward-Port-Of: odoo/enterprise#76474
Original PR description
The tool tip is being replaced with a more concise message. task-4437887 Forward-Port-Of: odoo/enterprise#77486 Forward-Port-Of: odoo/enterprise#76474
The issue: The delivered qty is not reflected on the order line after creating the first recurring invoice by the cron job. Steps to reproduce: 1. Create a product with the following configuration: Product Type: Service Create on Order: Nothing Invoicing Policy: Based on Timesheets Product Category: Sellable and Subscription Product 2. Set up a recurring subscription plan for the product 3. Create a Sales Order (SO) for the product and confirm it 4. Add hours to a task linked to
Original PR description
The issue: The delivered qty is not reflected on the order line after creating the first recurring invoice by the cron job. Steps to reproduce: 1. Create a product with the following configuration:…
The issue: The delivered qty is not reflected on the order line after creating the first recurring invoice by the cron job. Steps to reproduce: 1. Create a product with the following configuration: Product Type: Service Create on Order: Nothing Invoicing Policy: Based on Timesheets Product Category: Sellable and Subscription Product 2. Set up a recurring subscription plan for the product 3. Create a Sales Order (SO) for the product and confirm it 4. Add hours to a task linked to the SO 5. From Settings > Technical > Automation > Scheduled Actions, manually trigger the cron job "Sale Subscription: generate recurring invoices and payments" to update the `next_invoice_date`. Observed behavior: On the SO page, the smart button of the tasks reflects the hours added correctly. However, the delivered quantity field in the SO line does not update based on the added hours. The reason: The delivered quantity for timesheet based services is computed taking into account the current period [1], however, `next_invoice_date` was not added as a dependency to the compute method of `qty_delivered`, causing this latter to have a stale value when `next_invoice_date` gets updated when creating the first recurring invoice by `_create_recurring_invoice` [2]. The fix: Added `next_invoice_date` as a dependency for the compute function of `qty_deliverd`. [1]: https://github.com/odoo/enterprise/blob/e990d101cce90311f3e2c5d9be4d480b329f9f2a/sale_subscription_timesheet/models/sale_order_line.py#L39 [2]: https://github.com/odoo/enterprise/blob/07f01f39cb46f1763637b50e628dfb613b0d2266/sale_subscription/models/sale_order.py#L1168 opw-4378914 opw-4426787 opw-4463512 Forward-Port-Of: odoo/enterprise#77059
- add `alert alert-warning` as classes instead of adding style color to unify the warning visual Task: 4432816 Forward-Port-Of: odoo/enterprise#77596 Forward-Port-Of: odoo/enterprise#77161
Original PR description
- add `alert alert-warning` as classes instead of adding style color to unify the warning visual Task: 4432816 Forward-Port-Of: odoo/enterprise#77596 Forward-Port-Of: odoo/enterprise#77161
**Steps to reproduce:** - Install Accounting - Go to "Accounting / Configuration / Management / Asset Models" - Create an asset model **Issue:** Upon save, the following UserError is raised: "You cannot add or remove bills when the asset is already running or closed." **Cause:** A check has been added to prevent adding bills to a running asset. The check is excluding draft assets but not asset models that are assets in "model" state. **Issue:** Exclude asset models from the chec
Original PR description
**Steps to reproduce:** - Install Accounting - Go to "Accounting / Configuration / Management / Asset Models" - Create an asset model **Issue:** Upon save, the following UserError is raised: "You cannot add or remove bills when the asset is already running or closed." **Cause:** A check has been added to prevent adding bills to a running asset. The check is excluding draft assets but not asset models that are assets in "model" state. **Issue:** Exclude asset models from the check. opw-4479698 Forward-Port-Of: odoo/enterprise#77603 Forward-Port-Of: odoo/enterprise#77472