Wednesday, October 30, 2024
12 changes · 18.0
Resolved issues and error corrections
Removed leftover records and assets for a module that no longer exists. This prevents obsolete module data from appearing or causing confusion during system maintenance and upgrades.
Original PR description
The module was removed in odoo/enterprise@53098e18 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Fixes an intermittent issue where manufacturing work orders could keep the wrong expected duration after producing serial-tracked items in batches. This helps production planning stay accurate and consistent for manufacturing teams.
Original PR description
This is a non-deterministic bug. Setup: - install mrp, enable workorders and serial numbers - create a storable product A with serial tracking - create a BOM with 1 operation for product A Steps: -…
This is a non-deterministic bug. Setup: - install mrp, enable workorders and serial numbers - create a storable product A with serial tracking - create a BOM with 1 operation for product A Steps: - create a MO for 2 units of product A -> the duration expected on the WO should be 120 minutes. - confirm then plan the MO - produce all -> you'll see a wizard for batch production (2nd wizard) - generate serials then produce or prepare MO (doesn't matter which) Issue: Sometimes the duration of the initial workorder is correctly computed -> 60 minutes, sometimes it is not (left as is). This is a mix of 2 'bugs': First, we have the `self.env['mrp.production'].browse` via a set(). Because it's a set, the productions received are not always in order, so the loop just after may process the last MO first. This triggers the 2nd 'bug'. Second, the first MO (that was planned) won't trigger `_compute_duration_expected` at https://github.com/odoo/odoo/blob/014ed907a2fab280e9fa6dd93b23a6a852700796/addons/mrp/wizard/mrp_batch_produce.py#L116 when changing `qty_producing` because of `is_planned`: https://github.com/odoo/odoo/blob/014ed907a2fab280e9fa6dd93b23a6a852700796/addons/mrp/models/mrp_production.py#L730-L731 instead, it will go through the compute later because the second MO (created in the split, but not planned) will trigger the compute for both ids via `recompute` because the original MO id was still in the pending transactions: https://github.com/odoo/odoo/blob/014ed907a2fab280e9fa6dd93b23a6a852700796/odoo/fields.py#L1413 However, the first workorder will already have its qty_producing set to 1 so won't pass in `_get_duration_expected`. Fix: Use `OrderedSet` instead of set along with `reversed()` so that the loop will process the last MO first. This way the pending compute for the original MO will correctly compute the duration because it's WO's qty_producing will still be zero. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Fixes an issue where previewing a canceled invoice with no invoice lines could show an error instead of opening the preview. The system now handles missing invoice line data safely, improving reliability for users reviewing incomplete or canceled invoices.
Original PR description
Currently, an error occurs when the user attempts to preview an invoice, and invoice has no invoice lines. Step to produce: - Install the ```account``` module. - Create a new invoice, add a customer name, and 'Cancel' this invoice. - Click on 'Preview' button(ensure that no invoice lines have been added). ```ValueError: Expected singleton: account.move()``` An error occurs when the system tries to get installment data from the move line at [1], and the move lines are not available in the invoice. Link [1]: https://github.com/odoo/odoo/blob/430656132044f8d675712d5b6cbfef807880d024/addons/account/models/account_move.py#L5411-L5412 To handle this issue, pass empty data for installments if the move line is not available in the invoice. Sentry-5978934688 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Fixed an issue where adding a down payment from purchase matching could reset a purchase order line back to the vendor’s default price. This preserves the price negotiated on the purchase order and helps avoid billing and reconciliation discrepancies.
Original PR description
### Steps to reproduce the issue: 1. Create a Product and add a Vendor Price under the Purchase tab 2. Create a Request for Quotation from the Vendor with the Product, change the Unit Price 3.…
### Steps to reproduce the issue: 1. Create a Product and add a Vendor Price under the Purchase tab 2. Create a Request for Quotation from the Vendor with the Product, change the Unit Price 3. Confirm Order 4. Create a Vendor Bill from the Vendor with one Invoice Line, click on "Purchase Matching" 5. Select the Invoice Line and click on "Add to PO" 6. Select the PO previously created and Add Down Payment 7. On the PO, the Unit Price on the Product Line has reverted to the Vendor Price ### Explanation: During `_create_downpayments`, `purchase.order.line` created from `account.move.line` are added to `purchase.order.order_line` through a concatenation operator (here a `+`, but `|` would have the same effect). With this operation, `purchase.order.order_line` is flagged as a modified value and needs to be totally recomputed. In the triggered recomputation methods is `_compute_price_unit_and_date_planned_and_name`, which affects multiple values including `unit_price` and uses `product_product.seller_ids`. https://github.com/odoo/odoo/blob/d0e7be7832672d476f1b289af52d3a425990d719/addons/purchase/models/purchase_order_line.py#L313-L318 https://github.com/odoo/odoo/blob/d0e7be7832672d476f1b289af52d3a425990d719/addons/purchase/models/purchase_order_line.py#L351-L358 ### Fix reasoning: With `Command.link`, only the added lines are flagged as new values and `purchase.order.order_line` is not recomputed. opw-4275163
This fixes a payroll/time off issue where changing an accrual allocation start date could leave old carryover expiration values in place, causing the displayed accrued days to become incorrect. Employees and HR teams will now see consistent, accurate time off balances when allocation dates are adjusted.
Original PR description
Steps to Reproduce: Create an accrual allocation: - Carryover date on allocation start date. - Has 1 level: * Start 0 days after allocation start date. * Accrues 1 day monthly on 1st day of the…
Steps to Reproduce:
Create an accrual allocation:
- Carryover date on allocation start date.
- Has 1 level:
* Start 0 days after allocation start date.
* Accrues 1 day monthly on 1st day of the month.
* Carryover policy all accrued time carried over.
* Carryover validity 1 month.
* Leave other options as is.
- Leave other options as is.
Create an allocation:
- Allocation type: accrual allocation.
- Accrual plan: use the one defined above.
- The following dates are in mm/dd/YYYY
- Set allocation start date 08/01/2023.
Number of days becomes 2 days (as expected).
- Set allocation start date 09/01/2023.
Number of day becomes 12 days (as expected).
- Set allocation start date 08/01/2023.
Number of days becomes 13 days (wrong).
The issue is that the expiration date of carried over days and the number of expiring days aren't reset when the start date of the allocation changes.
The fix is to reset these values when the start date of the allocation changes.
task-4208024This fix prevents an unexpected error screen when users save a customized view that contains an invalid context value. Instead of a technical traceback, the system can handle the invalid input more safely, improving reliability during view editing.
Original PR description
When the user edits the view and adds context with invalid syntax, a traceback will appear. Steps to reproduce the error: - Go to Settings > Technical > Views > Open any view - Add context = ``"[]"``…
When the user edits the view and adds context with invalid syntax,
a traceback will appear.
Steps to reproduce the error:
- Go to Settings > Technical > Views > Open any view
- Add context = ``"[]"`` or context = ``"{a}"`` like this in the view
- Save
Traceback:
```
UnboundLocalError: cannot access local variable 'err' where it is not associated with a value
File "odoo/http.py", line 2365, in __call__
response = request._serve_db()
File "odoo/http.py", line 1892, in _serve_db
return self._transactioning(
File "odoo/http.py", line 1955, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 137, in retrying
result = func()
File "odoo/http.py", line 1922, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2169, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 329, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 728, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "home/odoo/src/enterprise/18.0/industry_fsm_report/controllers/main.py", line 10, in edit_view
action = super().edit_view(view_id, studio_view_arch, operations, model, context)
File "odoo/http.py", line 728, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "home/odoo/src/enterprise/18.0/worksheet/controllers/main.py", line 10, in edit_view
action = super().edit_view(view_id, studio_view_arch, operations, model, context)
File "odoo/http.py", line 728, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "home/odoo/src/enterprise/18.0/web_studio/controllers/main.py", line 695, in edit_view
self._set_studio_view(view, new_arch)
File "home/odoo/src/enterprise/18.0/web_studio/controllers/main.py", line 456, in _set_studio_view
studio_view.arch_db = arch
File "odoo/fields.py", line 1402, in __set__
records.write({self.name: write_value})
File "home/odoo/src/enterprise/18.0/web_studio/models/studio_mixin.py", line 33, in write
res = super(StudioMixin, self).write(vals)
File "odoo/addons/base/models/ir_ui_view.py", line 535, in write
res = super(View, self).write(self._compute_defaults(vals))
File "odoo/models.py", line 4750, in write
real_recs._validate_fields(vals, inverse_fields)
File "odoo/models.py", line 1599, in _validate_fields
check(self)
File "odoo/addons/base/models/ir_ui_view.py", line 413, in _check_xml
elif err.__context__:
```
https://github.com/odoo/odoo/blob/69b404c7109ff689381f56520aad758424ec01aa/odoo/addons/base/models/ir_ui_view.py#L413-L418
Here, the ``err`` variable is referenced before the assignment,
So, it will lead to the above traceback.
sentry-5993638522
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prUnmerging multiple charts of accounts for the same company no longer fails with an unexpected error. This helps accounting users complete account structure changes reliably without manual workarounds.
Original PR description
Currently an error occurs when the user unmerges two or more charts of accounts with the same company. error: `ValueError: Expected singleton: account.account(1249, 1252, 163, 164, 165, 754)` This is because at [1] `self` used to display name here `self` contains multiple records. This commit will fix the above issue by looping records of self and using `display_name` of account, which is needed. [1]- https://github.com/odoo/odoo/blob/0bac60a7085c51ac8cb4f793b013dbea927d180c/addons/account/models/account_account.py#L1108 sentry-5985600163
Restoring a file from the trash now shows the correct error when its original folder was also moved to the trash. This helps users understand why the restore cannot be completed and keeps the message consistent with other document restore cases.
Original PR description
**Steps to reproduce:** Create a folder in 'My Drive' e.g: "New". Add 2 files in New folder. Open the folder and only select those 2 files and move them to trash. Now, go back to My drive, select that empty New folder and move it to Trash. Go to Trash workspace. Select one of the file and try to restore it. **Technical:** The folder whose parent has a folder_id 'False'. In the domain, we check the id and active status for the folder_id but since there is no folder_id, that record will not be considered as archived_top_parent_documents. **Specifications:** Show the appropriate error message when restoring from TRASH, consistent with the error for other documents. Task-4274176
The subscription customer portal now shows and uses the correct upcoming billing amount after an internal field name changed. This prevents customers from seeing an incorrect or missing next payment amount when managing subscription payments online.
Original PR description
Since #69952 the name of the final amount has been changed in the dict from `amount_total` to `total_amount` but not in the get. task-id: 4242134
Shared spreadsheet links now use the standard public documents page setup, preventing crashes when opened by viewers in debug mode or customized environments. This makes publicly shared spreadsheets more reliable and better aligned with other public document pages.
Original PR description
Steps to reproduce: - insert a pivot or a list in a spreadsheet - click on the Share button to share the spreadsheet - Choose "Viewer" for "Anyone with the link" - Copy the link and open it in an incognito window - in the URL, add ?debug=assets => boom This rendered page doesn't have `odoo.__session_info__` which crashes any code trying to read it. In standard, the view validation (only enabled in debug mode) reads it crash. On the saas, some custo also reads it and crashes. Two observations: - this page doesn't need the asset `documents.webclient` (in which is included the backend view stuff and the saas custo) - we can use the `documents.public_page_layout` which already includes `odoo.__session_info__` and the design is more aligned with the other documents public pages Note that I can't really write a test because nothing breaks in standard (except in debug mode) Task: 4297246
A test for Sendcloud delivery pickup locations now creates the required partner email information when demo data is not available. This prevents false test failures and helps keep delivery-related validation reliable across environments.
Original PR description
when running this test in no-demo mode, test was breaking as there was no email information created during test. Creating email information for partner fixes the issue. [link to runbot build errors](https://runbot.odoo.com/web#id=102115&menu_id=424&cids=1&action=573&model=runbot.build.error&view_type=form)
This fixes an issue where Odoo Studio could incorrectly combine two separate layout edits: adding a field in one group and removing another group. The change helps ensure Studio saves form customizations accurately, reducing the risk of unexpected layout changes for users.
Original PR description
…ifferent trees
Add a field at the end of the "left" subgroup and remove the "right" subgroup.
```xml
<form>
<group>
<group>
<field name="display_name" />
[ADD A FIELD]
</group>
[ REMOVE THIS GROUP
<group>
</group>
]
</group>
</form>
```
Before this commit, when "normalizing" the xpaths, the add field operation was aggregated with the remove operation because no unchanged node was found in between.
We were left with the inheriting view:
```xml
<xpath expr="[..]/group[2]" position="replace">
<field name="added_field" />
</xpath>
```
After this commit, this flow works and the two operations are independent.
part of task-4207793