Monday, June 17, 2024
36 changes
19 changes
Resolved issues and error corrections
This fix ensures that opening older-format Odoo links no longer removes the previous record from the browser history. It also makes internal links work more smoothly when pasted links use a different http/https protocol, reducing navigation disruption for users.
Original PR description
- On a record A; - Click on a link to open a record B (with an old style URL); - The record B is open; Before this commit, the record A is missing on the browser history. This occurs because, when an old style URL is converted into a canonical URL, a replacement of the current URL is done. This replacement was done to update the old URL when the URL was copy/paste on the browser. In this particular case, the replacement is not necessary, because the current URL is the one of the record A. Doing the replacement, will remove the record A from the browser history. Now, the URL retro-compatibility will only update the URL, if the URL in the browser is the one with the old style.
This fixes an issue in Odoo's web testing mock server so it correctly checks the expected override registry when falling back to a parent call. The change helps prevent inaccurate automated test behavior, improving confidence in future updates without affecting day-to-day users.
This fix improves the internal web testing framework so test callbacks can correctly pass control to earlier registered handlers. It helps Odoo's automated tests better mirror expected behavior and reduces the risk of false failures during development.
Original PR description
Before this PR, only model-defined methods could be called by the `parent` helper function given to callbacks of `onRpc` in tests. This meant that callbacks registered through the `mock_rpc` registry couldn't use this inheritance system (i.e a callback defined after another couldn't call the previous one). This PR makes it so that all listeners are aligned in a queue and a call to `parent` will simply call the next callback (eventually falling back to the model-defined methods), allowing registry-defined methods to be called in between. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
Steps to reproduce: ------------------- - in settings, activate "Recurring Tasks" - create a recurring task with a dateline to today and a recurrence every "1 Days Until tomorrow" - save - change the state to "Done" - on the new created task, change the state to "Done" Issue: ------ Steps can be repeated indefinitely, creating an infinite number of recurring tasks with a specific end date for the recurrence. Cause: ------ There is no check with the `repeat_until` field when creat
Original PR description
Steps to reproduce: ------------------- - in settings, activate "Recurring Tasks" - create a recurring task with a dateline to today and a recurrence every "1 Days Until tomorrow" - save - change the state to "Done" - on the new created task, change the state to "Done" Issue: ------ Steps can be repeated indefinitely, creating an infinite number of recurring tasks with a specific end date for the recurrence. Cause: ------ There is no check with the `repeat_until` field when creating a recurring task. opw-3941688 Forward-Port-Of: odoo/odoo#168003
6 changes
Code cleanup and technical improvements
This update streamlines how chat, WhatsApp, VoIP, documents, and helpdesk live chat data is prepared before being sent to the browser. It reduces repeated information, which can improve responsiveness and make future performance improvements easier.
Original PR description
This will reduce data transferred to the client and processed in JS when the same member was appearing multiple times. This also makes more clear what is transferred by avoiding nested values. Note: this is a first step, many format methods still have to be converted, in particular the one from member, which will then allow converting the one from partner, which will significantly reduce duplicate data send for the current partner (one duplicate per open channel). Formatting code eventually becomes simpler too, by always adding data to the store rather than updating pre-existing dict manually. Part of task-3605717 https://github.com/odoo/odoo/pull/169484
Live chat displays a welcome message when the visitor opens the chat. However, when an operator sends a chat request, the welcome message is not necessary as the first operator message will act as a welcome message. Before [1], chat requests data were inserted directly into the JS and the information about who opend the chat was given. However, the data is now fetched from the server and this information is missing. This PR adds this information so that the client can decide whether to
Original PR description
Live chat displays a welcome message when the visitor opens the chat. However, when an operator sends a chat request, the welcome message is not necessary as the first operator message will act as a…
Live chat displays a welcome message when the visitor opens the chat. However, when an operator sends a chat request, the welcome message is not necessary as the first operator message will act as a welcome message. Before [1], chat requests data were inserted directly into the JS and the information about who opend the chat was given. However, the data is now fetched from the server and this information is missing. This PR adds this information so that the client can decide whether to display this message. Steps to reproduce this issue: - Go on the website as a visitor - Send a chat request from admin, send a first message - Navigate to another page with the visitor - The welcome message appears in addition to the operator message. [1]: https://github.com/odoo/odoo/pull/142155 Before:  After:  Forward-Port-Of: odoo/odoo#169476
`to_recheck_leaves` stores every leave that is not yet taken into account by the "allocation_leaves_consumed" dictionary. now for some leave type, it's allocation contain False value as key of this `allocation_leaves_consumed` dictionary. because when leave_type with requires_allocation Is not yes then we pass leave type data with False as allocation. see: https://github.com/odoo/odoo/blob/7363d568df6e82119eed1cec55b3ae67a3816a1a/addons/hr_holidays/models/hr_employee.py#L565 and this wi
Original PR description
`to_recheck_leaves` stores every leave that is not yet taken into account by the "allocation_leaves_consumed" dictionary. now for some leave type, it's allocation contain False value as key of this…
`to_recheck_leaves` stores every leave that is not yet taken into account by the "allocation_leaves_consumed" dictionary. now for some leave type, it's allocation contain
False value as key of this `allocation_leaves_consumed` dictionary.
because when leave_type with requires_allocation
Is not yes then we pass leave type data with False as allocation.
see:
https://github.com/odoo/odoo/blob/7363d568df6e82119eed1cec55b3ae67a3816a1a/addons/hr_holidays/models/hr_employee.py#L565
and this will create issue when we try to calculate `latest_accrual_bonus` value by iterating consumed_content which call `_get_future_leaves_on` function but as we got allocation as False will get error :
```
File "/home/odoo/src/odoo/17.0/addons/hr_holidays/models/hr_employee.py", line 105, in _compute_allocation_remaining_display
leaves_taken = self._get_consumed_leaves(allocations.holiday_status_id)[0]
File "/home/odoo/src/odoo/17.0/addons/hr_holidays/models/hr_employee.py", line 582, in _get_consumed_leaves
latest_accrual_bonus += allocation._get_future_leaves_on(date_to_simulate)
AttributeError: 'bool' object has no attribute '_get_future_leaves_on'
```
Generated during upgrade.
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#169208Display IoTBox connected devices on its display. Task: 3960101 Forward-Port-Of: odoo/odoo#168833
Original PR description
Display IoTBox connected devices on its display. Task: 3960101 Forward-Port-Of: odoo/odoo#168833
In this commit, we changed the way the addresses were displayed in accounting. https://github.com/odoo/odoo/commit/28fdcaabda9dc61b352e58e692bc5adf15a08a1e We now want the same behavior with the sale orders. task-3951205 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#166877
Original PR description
In this commit, we changed the way the addresses were displayed in accounting. https://github.com/odoo/odoo/commit/28fdcaabda9dc61b352e58e692bc5adf15a08a1e We now want the same behavior with the sale orders. task-3951205 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#166877
Issue: At some point we added the daterange widget to select the dates for the resource leaves without taking into account certain cases, the most relevant is that we have a compute_date_to which depends on the date_from, the duty of this compute is that whenever we select a date_from, we will get the date_to to allocate exactly 1 day, which is the most common use, the problem is that with this widget we will always modify both date_from and date_to at the same time, making the compute to be
Original PR description
Issue: At some point we added the daterange widget to select the dates for the resource leaves without taking into account certain cases, the most relevant is that we have a compute_date_to which…
Issue: At some point we added the daterange widget to select the dates for the resource leaves without taking into account certain cases, the most relevant is that we have a compute_date_to which depends on the date_from, the duty of this compute is that whenever we select a date_from, we will get the date_to to allocate exactly 1 day, which is the most common use, the problem is that with this widget we will always modify both date_from and date_to at the same time, making the compute to be called everytime which will not allow us to select a further date for date_to. Steps to reproduce: 1. Install Appointments. 2. Go to Configuration > Resource Leaves > New 3. Try to allocate more than 1 day for the Resource Time Off Solution: We should, at least for the moment, keep it as it was before, where we can select both dates separetely, this way whenever we select our date_from we will get the date_to updated automatically to make things easier for the most common case, but we will still be able to change the date_to without triggering the compute. opw-3861325 Forward-Port-Of: odoo/odoo#161715
Current behaviour: --- When scheduled_date is not set, we get a traceback Steps to reproduce: --- 1. Create Product FNS storable 2. Create Product CMP storable 3. Create quant for 10 units of CMP 4. Set CMP tracking to 'Lot' and 'Use expiration date' to True 5. Create MO for 1 unit of FNS using 1 unit of CMP 6. Try to Confirm: Traceback Cause of the issue: --- Caused by: https://github.com/odoo/odoo/commit/f1d4a727a84672d974151f681e43768abd3ac7cc opw-3981689 --- I confirm
Original PR description
Current behaviour: --- When scheduled_date is not set, we get a traceback Steps to reproduce: --- 1. Create Product FNS storable 2. Create Product CMP storable 3. Create quant for 10 units of CMP 4. Set CMP tracking to 'Lot' and 'Use expiration date' to True 5. Create MO for 1 unit of FNS using 1 unit of CMP 6. Try to Confirm: Traceback Cause of the issue: --- Caused by: https://github.com/odoo/odoo/commit/f1d4a727a84672d974151f681e43768abd3ac7cc opw-3981689 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#169052
Back Porting commit - https://github.com/odoo/odoo/pull/147812/commits/5bd0d647094d00f93d73a4498e571e84a6317446 and https://github.com/odoo/odoo/pull/147812/commits/5c755e4148399d80717d0047c55a7833f7bdfdde Commit merged in PR - https://github.com/odoo/odoo/pull/147812 (in saas-17.3) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#169502 Forward-Port-Of: odoo/odoo#169224
Original PR description
Back Porting commit - https://github.com/odoo/odoo/pull/147812/commits/5bd0d647094d00f93d73a4498e571e84a6317446 and https://github.com/odoo/odoo/pull/147812/commits/5c755e4148399d80717d0047c55a7833f7bdfdde Commit merged in PR - https://github.com/odoo/odoo/pull/147812 (in saas-17.3) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#169502 Forward-Port-Of: odoo/odoo#169224
Steps to reproduce: 1. As a frontend user, add a product to the cart 2. As a backend user, add a note line to the created order 3. As a frontend user, open the cart Before this commit: The note line in the order is deleted After this commit: The note line in the order is still there The note line deletion was introduced long ago with ee0199cac4f58bc8aefd0ea1410d16fb6b9f4e31, as a side-effect of deleting lines with inactive products. This commit also makes sure that notes/section
Original PR description
Steps to reproduce: 1. As a frontend user, add a product to the cart 2. As a backend user, add a note line to the created order 3. As a frontend user, open the cart Before this commit: The note line in the order is deleted After this commit: The note line in the order is still there The note line deletion was introduced long ago with ee0199cac4f58bc8aefd0ea1410d16fb6b9f4e31, as a side-effect of deleting lines with inactive products. This commit also makes sure that notes/section lines are not shown in the cart, as the current template and code are not designed to handle lines without products (it raises while trying to fetch the combination info of the soline product). Forward-Port-Of: odoo/odoo#169275 Forward-Port-Of: odoo/odoo#168521
The "Reload Chart Template" button currently doesn't work with the argentinian localization. It is due to some python constrains that don't allow to modify some fields if there are accounting entries. The issue is that the constrains will be raised, when any writing on those fields is done, even if the new value is the same as the old one. When reloading the chart template it is re-writing the values, but they are not different, so no exception should be raised. The fix here is
Original PR description
The "Reload Chart Template" button currently doesn't work with the argentinian localization. It is due to some python constrains that don't allow to modify some fields if there are accounting entries. The issue is that the constrains will be raised, when any writing on those fields is done, even if the new value is the same as the old one. When reloading the chart template it is re-writing the values, but they are not different, so no exception should be raised. The fix here is to move those constrains into the `def write` override, where there's more control (as we have the new values as argument). task-3878511 Forward-Port-Of: odoo/odoo#166537
## Issue: - The stock valuation for discounted purchase orders is incorrectly based on the original unit price instead of the price. ## Steps To Reproduce: - Create a storable product with AVCO costing method. - In its purchase tab set control policy "On ordered quantities". - Create RFQ for a product 10 qty with 10 unit price and add a 10% discount. - Create a vendor bill and confirm it. - Receive the product. - See the valuation, it will show 100 instead of 90. ## Solution: - I f
Original PR description
## Issue: - The stock valuation for discounted purchase orders is incorrectly based on the original unit price instead of the price. ## Steps To Reproduce: - Create a storable product with AVCO costing method. - In its purchase tab set control policy "On ordered quantities". - Create RFQ for a product 10 qty with 10 unit price and add a 10% discount. - Create a vendor bill and confirm it. - Receive the product. - See the valuation, it will show 100 instead of 90. ## Solution: - I fixed the issue by updating the `_get_price_unit` method to consider discounts when calculating the invoiced value. opw-3895448 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#168619
### Steps to reproduce: 1. Create a BOM with 2 operations: op 1 and 2 2. Create and confirm an MO for 10 units using that BOM. 3. Put the quantity to 10 then start and done op 1 4. Put the quantity to 2 then start and done op 2 5. Produce and create a backorder 6. Put the quantity to 4 then start and done op 2 7. Produce and create a backorder #### > instead of 4 units remaining in op 2 we have 4 units remaining in op 1 ### Cause of the issue: The operations of a productions (`mr
Original PR description
### Steps to reproduce: 1. Create a BOM with 2 operations: op 1 and 2 2. Create and confirm an MO for 10 units using that BOM. 3. Put the quantity to 10 then start and done op 1 4. Put the quantity…
### Steps to reproduce: 1. Create a BOM with 2 operations: op 1 and 2 2. Create and confirm an MO for 10 units using that BOM. 3. Put the quantity to 10 then start and done op 1 4. Put the quantity to 2 then start and done op 2 5. Produce and create a backorder 6. Put the quantity to 4 then start and done op 2 7. Produce and create a backorder #### > instead of 4 units remaining in op 2 we have 4 units remaining in op 1 ### Cause of the issue: The operations of a productions (`mrp.workorder`'s) are ordered by `leave_id`, `date_start` and then `id`: https://github.com/odoo/odoo/blob/26239b2d0bdbc2f06d50f7739d61c490248b65bb/addons/mrp/models/mrp_workorder.py#L14-L17 Since, in the first backorder, the workorder corresponding to op 1 is cancelled it has an empty `leave_id` and `date_start`. On the other hand, once the partial operation of op 2 has been completed its associated `date_start` is not empty anymore and the order of both operations is therefore swaped. However, when a backorder is created, the quantity of the workorders is set by relying on the order of operations (which is not the same with and without `leave_id`, `date_start`): https://github.com/odoo/odoo/blob/d826c3782d737fc1724887692b71b27999bf846d/addons/mrp/models/mrp_production.py#L1973-L1983 So that the data is set on the wrong line. opw-3880963 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#166820
xlrd 2.0 removed xlsx support, and that's the version on Noble. So xlsx (the modern excel format) can't be imported on Noble. Aside from the error message being confusing (it says to install xlsx >= 1.0, which is already there) this would be fine, just no support for xlsx, except the only *export* formats are xlsx and csv, and xlsx is the default, and csv is kinda shit too. In fact when using the "Export All" quick action, the only thing you can get is xlsx. So losing xlsx support turns ou
Original PR description
xlrd 2.0 removed xlsx support, and that's the version on Noble. So xlsx (the modern excel format) can't be imported on Noble. Aside from the error message being confusing (it says to install xlsx >= 1.0, which is already there) this would be fine, just no support for xlsx, except the only *export* formats are xlsx and csv, and xlsx is the default, and csv is kinda shit too. In fact when using the "Export All" quick action, the only thing you can get is xlsx. So losing xlsx support turns out to be a concern. This can be resolved, kinda, by adding support for openpyxl. The API is pretty simple and similar to xlsx though not super well documented (especially when trying to do type dispatching). This here version seems to work with the (fairly limited) XLSX test case of base_import. Forward-Port-Of: odoo/odoo#169245
Before this fix, when grouping by a date filter that only had "false" value, the global filter matching was causing a traceback trying to split a non existant month/year value. This commit fixes this behavior by checking for "false" in date filter and setting the matching filter to "undefied" OPW: 3776544 OPW: 3952358 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#169453
Original PR description
Before this fix, when grouping by a date filter that only had "false" value, the global filter matching was causing a traceback trying to split a non existant month/year value. This commit fixes this behavior by checking for "false" in date filter and setting the matching filter to "undefied" OPW: 3776544 OPW: 3952358 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#169453
Since 17.0, message unread counter is not reliable. Indeed, it is computed on the client side which is aware of all messages. This PR fixes this issue by backporting the PR that made the unread counter rely on the server state instead. enterprise: https://github.com/odoo/enterprise/pull/63265 Forward-Port-Of: odoo/odoo#168648 Forward-Port-Of: odoo/odoo#165955
Original PR description
Since 17.0, message unread counter is not reliable. Indeed, it is computed on the client side which is aware of all messages. This PR fixes this issue by backporting the PR that made the unread counter rely on the server state instead. enterprise: https://github.com/odoo/enterprise/pull/63265 Forward-Port-Of: odoo/odoo#168648 Forward-Port-Of: odoo/odoo#165955
Description of the issue/feature this PR addresses: In the journal entry you can group by partner/date/journal/company, but in vendor bill or customer invoice you cannot. @qdp-odoo @oco-odoo --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#168339 Forward-Port-Of: odoo/odoo#161369
Original PR description
Description of the issue/feature this PR addresses: In the journal entry you can group by partner/date/journal/company, but in vendor bill or customer invoice you cannot. @qdp-odoo @oco-odoo --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#168339 Forward-Port-Of: odoo/odoo#161369
Miscellaneous changes
When using the new sparse gantt mode [1] users would get a crash if an appointment was visible. This is because there was an assumption the rows would always represent records of the model of the last grouping. In the sparse mode the rows represent the pill records, in this case events. So we find the parent group instead to find the relevant attendee, in that mode. `partner_id` on `calendar.event` in test models is also updated to use `.id` as `related` doesn't work well with relationa
Original PR description
When using the new sparse gantt mode [1] users would get a crash if an appointment was visible. This is because there was an assumption the rows would always represent records of the model of the last grouping. In the sparse mode the rows represent the pill records, in this case events. So we find the parent group instead to find the relevant attendee, in that mode. `partner_id` on `calendar.event` in test models is also updated to use `.id` as `related` doesn't work well with relational fields. task-3950682 [1] e5f9c54415d3ca10378fc5729b242508396b2316 Forward-Port-Of: odoo/enterprise#63417
When triggering the onchange method of the reconciliation widget, the `_get_invoice_matching_amls_candidates` method is executed. If there are both numerical and exact tokens, it produces a query with 6 subqueries (a general query with 6 UNION ALL). This can become quite slow on database with lots of amls. Because for each of these 6 "subqueries" the FROM, JOIN and WHERE clauses are the same, we can extract all of them in a single CTE. Thanks to that the CTE is executed only once and each UNI
Original PR description
When triggering the onchange method of the reconciliation widget, the `_get_invoice_matching_amls_candidates` method is executed. If there are both numerical and exact tokens, it produces a query…
When triggering the onchange method of the reconciliation widget, the `_get_invoice_matching_amls_candidates` method is executed. If there are both numerical and exact tokens, it produces a query with 6 subqueries (a general query with 6 UNION ALL). This can become quite slow on database with lots of amls. Because for each of these 6 "subqueries" the FROM, JOIN and WHERE clauses are the same, we can extract all of them in a single CTE. Thanks to that the CTE is executed only once and each UNION ALL simply scans the CTE to get the correct columns + performs an additional filtering. This reduces the average execution of the query by a factor of 3-4 on hot-cache. Since the onchange is triggered each time we do something in the reconciliation widget, on average the cache is expected to be hot so the average speedup boils down to the hot-cache scenario. #### speedup Customer 17.0 database with 7M account_move_lines and 8000 accounts, the query execution, given a st_line and with both numerical and exact tokens: 7.5s -> 2.3s ##### dalibo [Standard](https://explain.dalibo.com/plan/0a6fe16h503614e0) vs [CTE](https://explain.dalibo.com/plan/495a777ef95d2980) There is also a speedup achievable with a partial multicolumn index but that's more of a case by case index. opw-3938995 Forward-Port-Of: odoo/enterprise#64433
Revisions are technical records that are never supposed to be changed (except the `active` field). If any of `res_model`, `res_id`, `revision_uuid` is changed, the spreadsheet history will be broken. Changing field `commands` could also break the spreadsheet if the json is malformed or the command is made invalid. In this commit, we prevent the admin to make any changes. Forward-Port-Of: odoo/enterprise#64401 Forward-Port-Of: odoo/enterprise#64328
Original PR description
Revisions are technical records that are never supposed to be changed (except the `active` field). If any of `res_model`, `res_id`, `revision_uuid` is changed, the spreadsheet history will be broken. Changing field `commands` could also break the spreadsheet if the json is malformed or the command is made invalid. In this commit, we prevent the admin to make any changes. Forward-Port-Of: odoo/enterprise#64401 Forward-Port-Of: odoo/enterprise#64328
Create an asset Reverse an entry in the past => In depreciation schedule, if we take the current period, initial amount in Depreciation does not correspond to the cumulative depreciation in the Depreciation Board of the asset. The reversed entry are not taken into account, which was normal before, but now we take reversal entry into account so these should be too. opw-3890144 Forward-Port-Of: odoo/enterprise#64564 Forward-Port-Of: odoo/enterprise#63821
Original PR description
Create an asset Reverse an entry in the past => In depreciation schedule, if we take the current period, initial amount in Depreciation does not correspond to the cumulative depreciation in the Depreciation Board of the asset. The reversed entry are not taken into account, which was normal before, but now we take reversal entry into account so these should be too. opw-3890144 Forward-Port-Of: odoo/enterprise#64564 Forward-Port-Of: odoo/enterprise#63821
Steps to reproduce: - Install `documents_project` - Go to one of the task and add a document - Close it Issues: In the project update the number of documents is shown however it is wrong, as it compute it by retrieving all the tasks without taking into account the state of the tasks. When clicking on the documents button you don't see documents linked to task that are closed, the desired behaviour is to see all of them and not take into account the state of the tasks. The behaviour
Original PR description
Steps to reproduce: - Install `documents_project` - Go to one of the task and add a document - Close it Issues: In the project update the number of documents is shown however it is wrong, as it compute it by retrieving all the tasks without taking into account the state of the tasks. When clicking on the documents button you don't see documents linked to task that are closed, the desired behaviour is to see all of them and not take into account the state of the tasks. The behaviour was due to the way the domain is set on the `task_ids` in the project model. https://github.com/odoo/odoo/blob/174cb193592f12c7f4167eb34642665778deb208/addons/project/models/project.py#L332-L333 Because of this when we retrieved the documents we didn't have all the tasks. https://github.com/odoo/enterprise/blob/0e98a5fdf5e4f32eeae769552284297b9233088c/documents_project/models/project_project.py#L204 opw-3921156 Forward-Port-Of: odoo/enterprise#64603