Thursday, April 3, 2025
30 changes · saas-18.1
Miscellaneous changes
Prior to this commit, using a `/banner` block would create elements that always have `contenteditable` attributes when saving, that are always different from the server value which removes these `contenteditable` attributes, resulting in a new `Wysiwyg` instance being constructed after each `save`. Resolution: 1- Introduce new classes to handle the `contenteditable` attribute: `o-contenteditable-true` and `o-contenteditable-false` to avoid a namespace conflict with `website` specifi
Original PR description
Prior to this commit, using a `/banner` block would create elements that always have `contenteditable` attributes when saving, that are always different from the server value which removes these…
Prior to this commit, using a `/banner` block would create elements that always have `contenteditable` attributes when saving, that are always different from the server value which removes these `contenteditable` attributes, resulting in a new `Wysiwyg` instance being constructed after each `save`. Resolution: 1- Introduce new classes to handle the `contenteditable` attribute: `o-contenteditable-true` and `o-contenteditable-false` to avoid a namespace conflict with `website` specific features. They replace `o_editable` and `o_not_editable` for the `banner` block. 2- Ensure that `contenteditable` attribute handled by these classes are removed during `cleanForSave`, to create a value comparable to the server value. This is because the server sanitizes the `contenteditable` attribute. If both compared values are not equal, the current `Wysiwyg` and `Editor` instances would be fully replaced after each save, resulting in a loss of edition history. This should ideally never happen. 3- Ensure the attributes `role` and `aria-label` which are also sanitized by the server are removed during `cleanForSave` and maintained during `normalize` through `data-oe-role` and `data-oe-aria-label`. 4- Introduce a `o_editor_banner_content` class for the `banner` content, for ease of selector creation. 5- Ensure that the `baseContainer` created before the `banner` if it is the first element in the `editable` has the proper `tagName` based on the `HtmlField` configuration. A `html_migrations` version is added to adjust existing `banners` to the new classes usage. task-4640490 Forward-Port-Of: odoo/odoo#201139
This commit orders the stock valuation layer of multiple stock moves by product to make sure the assert targets the right layer index in the loop. runbot: 99086 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#201435
Original PR description
This commit orders the stock valuation layer of multiple stock moves by product to make sure the assert targets the right layer index in the loop. runbot: 99086 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#201435
In a previous commit 4a6af867dd2eb13659c93e553d5e553cacb3048d, price was intended to be hidden when prevent zero sale is enabled. However the fix wrongly removed the outer div containing also the editable price that can be updated from the editor. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#204524
Original PR description
In a previous commit 4a6af867dd2eb13659c93e553d5e553cacb3048d, price was intended to be hidden when prevent zero sale is enabled. However the fix wrongly removed the outer div containing also the editable price that can be updated from the editor. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#204524
Versions -------- - 18.0+ Steps ----- 1. Have a promo code that applies a 50% discount; 2. have a fixed price delivery method; 3. apply code on an order with said delivery method. Issue ----- The 50% discount is applied to the shipping costs. Cause ----- When calculating the discountable amount in `_discountable_amount`, it uses the `_get_no_effect_on_threshold_lines` method to filter out sale order lines that shouldn't impact the amount discounted. This value gets stored in t
Original PR description
Versions -------- - 18.0+ Steps ----- 1. Have a promo code that applies a 50% discount; 2. have a fixed price delivery method; 3. apply code on an order with said delivery method. Issue ----- The 50% discount is applied to the shipping costs. Cause ----- When calculating the discountable amount in `_discountable_amount`, it uses the `_get_no_effect_on_threshold_lines` method to filter out sale order lines that shouldn't impact the amount discounted. This value gets stored in the `lines` recordset. Commit d0e7be7832672 overlooked the existence of this variable when modifying the `_discountable_amount` method, and instead used `self.order_line`, using all lines to calculate the discountable amount. Solution -------- Use the filtered recordset to calculate the discountable amount. opw-4658702 Forward-Port-Of: odoo/odoo#202519
**Current behavior before PR:** prior to this PR ellipsis was overlapping the leave warning dialog-box. **Desired behavior after PR is merged:** now issue was resolved by adding z-index to dialog-box higher then ellipsis. task-4630702 before PR:  after PR:  --- I confirm I have signed the CLA and re
Original PR description
**Current behavior before PR:** prior to this PR ellipsis was overlapping the leave warning dialog-box. **Desired behavior after PR is merged:** now issue was resolved by adding z-index to dialog-box higher then ellipsis. task-4630702 before PR:  after PR:  --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#200649
- adding a field to set the coretax UoM code from UoM form view - raise error when country is not set on the customer - use the main customer's address in invoice as address in e-Faktur instead of the main customer's - fix calculation for tax incde in price configuration - adding CustomDocMonthYear to the XML by parsing month and year from invoice_date ticket-4622364 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#20
Original PR description
- adding a field to set the coretax UoM code from UoM form view - raise error when country is not set on the customer - use the main customer's address in invoice as address in e-Faktur instead of the main customer's - fix calculation for tax incde in price configuration - adding CustomDocMonthYear to the XML by parsing month and year from invoice_date ticket-4622364 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#204448 Forward-Port-Of: odoo/odoo#203203
**Current behavior:** Adding a product which is invoiced based on delivered quantities to the delivery of a sale which has already been confirmed, then validating the delivery, does not reflect the change in price (which will be invoiced) on the sale order. **Expected behavior:** The sale order should show the actual amount of money to be charged to the orderer. **Steps to reproduce:** 1. Create a stored product with some price and change its invoicing policy to 'delivery' 2. Cr
Original PR description
**Current behavior:** Adding a product which is invoiced based on delivered quantities to the delivery of a sale which has already been confirmed, then validating the delivery, does not reflect the…
**Current behavior:** Adding a product which is invoiced based on delivered quantities to the delivery of a sale which has already been confirmed, then validating the delivery, does not reflect the change in price (which will be invoiced) on the sale order. **Expected behavior:** The sale order should show the actual amount of money to be charged to the orderer. **Steps to reproduce:** 1. Create a stored product with some price and change its invoicing policy to 'delivery' 2. Create a new sale order, add 1 of the created product, then confirm it 3. Open the delivery, add another line to it for the same created product, fill in the quantities for each move, then validate the picking 4. Check the sale order line to see that, while the price unit is populated with the product's price, the subtotal/total fields are not **Cause of the issue:** Order lines added in this manner have `product_uom_qty == 0` which will zero-out the price computation. **Fix:** First, `_compute_purchase_price` is modified such that lines for standard cost product will have a value computed (where previously they were skipped). Then for `_compute_margin`: use `qty_delivered` and an on-the-fly calculated `price_subtotal` to find a margin value for a SOL added from a delivery (which is determined when `product_uom_qty == 0` and `qty_delivered != 0` opw-4210056 Forward-Port-Of: odoo/odoo#186236
Steps to reproduce: 1. Drop the website_form snippet. 2. Select name field & change with the many2one field having no record. 3. Switch the type: "dropdown list" => "radio" --> It will throw a traceback : This commit, fix the uncaught promise by adding validation before using variable. task-3932086 Forward-Port-Of: odoo/odoo#166108
Original PR description
Steps to reproduce: 1. Drop the website_form snippet. 2. Select name field & change with the many2one field having no record. 3. Switch the type: "dropdown list" => "radio" --> It will throw a traceback : This commit, fix the uncaught promise by adding validation before using variable. task-3932086 Forward-Port-Of: odoo/odoo#166108
**Problem**: When the text is long, the switch for "Autoconvert to Relative Link" is not visible. **Solution**: Adjust CSS to properly display the switch when the text is long. **Before**:  **After**:  **Steps to Reproduce**: 1. Change language to **Dutch**. 2. Open the **website editor**. 3. Click on
Original PR description
**Problem**: When the text is long, the switch for "Autoconvert to Relative Link" is not visible. **Solution**: Adjust CSS to properly display the switch when the text is long. **Before**:  **After**:  **Steps to Reproduce**: 1. Change language to **Dutch**. 2. Open the **website editor**. 3. Click on any **link**. 4. Copy your current link and paste it into the link input to trigger the "Autoconvert to Relative Link" switch. - **Issue**: The switch is not visible. **opw-4558476** --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#204286 Forward-Port-Of: odoo/odoo#204244
**Current behavior before PR:** - Rotating a cropped image reset the cropper to cover the entire image. - When saving the record, all attributes not in the safe_attrs list were sanitized. As a result, if the record contained a cropped image, its crop-related attributes were also sanitized. Consequently, when the cropper was reopened, the container displayed the entire image instead of the cropped version. **Desired behavior after PR is merged:** - The cropper now retains
Original PR description
**Current behavior before PR:** - Rotating a cropped image reset the cropper to cover the entire image. - When saving the record, all attributes not in the safe_attrs list were sanitized. As a result, if the record contained a cropped image, its crop-related attributes were also sanitized. Consequently, when the cropper was reopened, the container displayed the entire image instead of the cropped version. **Desired behavior after PR is merged:** - The cropper now retains its size when rotating a cropped image, maintaining the original crop area. - Image attributes such as data-width, data-height, data-scale-x, data-scale-y, data-x, and data-y are no longer sanitized during the save process. This ensures that when the cropper is reopened for a cropped image, the container correctly displays only the cropped portion of the image, rather than the entire image. task-4290693 Forward-Port-Of: odoo/odoo#204000 Forward-Port-Of: odoo/odoo#186864
Steps to reproduce: - go to a blog post with several paragraph - edit translations Issue 1: - select several paragraph completely and use the translate tool - insert the translation => the translation are not inserted Issue 2: - select 3 paragraphs but don't start at the beginning or end of the text - insert translation - see that all translations is inserted at end of paragraph 1, paragraph 2 is emptied and paragraph 3 selected part is removed - save => paragraph 1 and 2 a
Original PR description
Steps to reproduce: - go to a blog post with several paragraph - edit translations Issue 1: - select several paragraph completely and use the translate tool - insert the translation => the…
Steps to reproduce: - go to a blog post with several paragraph - edit translations Issue 1: - select several paragraph completely and use the translate tool - insert the translation => the translation are not inserted Issue 2: - select 3 paragraphs but don't start at the beginning or end of the text - insert translation - see that all translations is inserted at end of paragraph 1, paragraph 2 is emptied and paragraph 3 selected part is removed - save => paragraph 1 and 2 are deleted (so we show original lang value), selected part of paragraph 3 is removed Why: In the blog post content, we are inside a "blog.post().content" editable field, this allows the editor to select several translations nodes which will work wrongly with the editor because translation mode only expect to change the content of translation nodes. The first paragraph translation is saved empty because the editor is cloning the node with the same "data-oe-translation-source-sha" because we are inserting several paragraphs inside it. Fix: in translation mode, make the editable node of html fields around translation nodes uneditable so we can't select several translation nodes thanks to how browser handle selection and content editable. Note: the added test step is very light, because in javascript it is programmatically possible to select 2 separate content editable. At the step that is added in the tour, with the fix it is not possible to select both the H1 and P nodes. opw-4221993 opw-4482717 pr note: opw-4221993 could possibly solved by this fix too (the video reproduction seemed to be about a bulleted list but I could not reproduce, and the original report video is deleted) Forward-Port-Of: odoo/odoo#204188 Forward-Port-Of: odoo/odoo#197511
LazyTranslate objects cannot be used directly in the `Markup.format()` function as it won't be able to find the lang to use. We have to explicitly use `self.env._()`. Runbot build error: https://runbot.odoo.com/odoo/runbot.build.error/98431 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#
Original PR description
LazyTranslate objects cannot be used directly in the `Markup.format()` function as it won't be able to find the lang to use. We have to explicitly use `self.env._()`. Runbot build error: https://runbot.odoo.com/odoo/runbot.build.error/98431 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#200930
**Problem:** In the purchase app, when selecting 2 Purchase Orders that have different currencies, and clicking Action then Accrued Expense Entry, a traceback will appear. It works as intended if the two Purchase Orders have the same currency, but if there is more than one currency, the traceback will be displayed. **Steps to reproduce:** - Go to the purchase app and select two Purchase Orders that have different currencies (you can make a group by Currencies). - Click on Action then
Original PR description
**Problem:** In the purchase app, when selecting 2 Purchase Orders that have different currencies, and clicking Action then Accrued Expense Entry, a traceback will appear. It works as intended if the…
**Problem:** In the purchase app, when selecting 2 Purchase Orders that have different currencies, and clicking Action then Accrued Expense Entry, a traceback will appear. It works as intended if the two Purchase Orders have the same currency, but if there is more than one currency, the traceback will be displayed. **Steps to reproduce:** - Go to the purchase app and select two Purchase Orders that have different currencies (you can make a group by Currencies). - Click on Action then Accrued Expense Entry. - The traceback appears. **Cause of the issue:** https://github.com/odoo/odoo/blob/a07a8589a8cb391a801ef1ffd60e02d83fc963f8/addons/account/wizard/accrued_orders.py#L246 The currency is given as a parameter to a function that requires only one parameter. With this code, if there are multiple currencies in orders, all of them will be given, which creates a traceback. **Fix:** After checking with a PO, the multiple currency use case is not supported. Hence make sure that there is only one currency in the quotations we are trying to work with. If there is more than one, we throw an error telling the user to only pick quotations with the same currency. opw-4562933 Forward-Port-Of: odoo/odoo#204007 Forward-Port-Of: odoo/odoo#202733
* stock{,_barcode, _barcode_quality_control}, quality_control ### Issue: Quality checks per operation and per product are generated by an override of the action confirm of the move. However, if a move line is created on a non draft picking, it will end up in a move that will never be confirmed. This happends because the move is created with a state to match its already existing picking and hence is not confirmed at creation and since only draft pickings are confirmed at the start of the bu
Original PR description
* stock{,_barcode, _barcode_quality_control}, quality_control ### Issue: Quality checks per operation and per product are generated by an override of the action confirm of the move. However, if a…
* stock{,_barcode, _barcode_quality_control}, quality_control
### Issue:
Quality checks per operation and per product are generated by an override of the action confirm of the move. However, if a move line is created on a non draft picking, it will end up in a move that will never be confirmed. This happends because the move is created with a state to match its already existing picking and hence is not confirmed at creation and since only draft pickings are confirmed at the start of the button validate. As a result, we will not create the quality checks related to these additional moves.
The above issue can be triggered in many situations. Here are the two major ones:
### Use case I:
Creating a delivery or an internal transfer on the fly from the barcode app.
### Steps to reproduce:
- Create a storable product P with a barcode: XXX
- Go to Quality > Quality Control > Quality Points > New
- Create a new quality point for your product: Control per: "Operation" Operations: "Delivery"
- Go to the barcode app > Operations > Delivery > New
- Scan your product
- Validate the Delivery
#### > the picking is done but no QC was created nor processed.
### Cause of the issue:
The `save_barcode_data` will launch the creation of the move line related to the barcode line you edited from the barcode app. During the create of this 'stock.move.line', an associated move will be created and its initial "state" will be the current state of the picking: https://github.com/odoo/odoo/blob/ba799a020dd2b07c9d6c379e23acee1e6fcc5e0a/addons/stock/models/stock_move_line.py#L354-L356 https://github.com/odoo/odoo/blob/ba799a020dd2b07c9d6c379e23acee1e6fcc5e0a/addons/stock/models/stock_move_line.py#L942 At this point the picking state is "draft" and the move will be correctly created in draft. However, just a few lines after its creation, we will check if a reservation should be done with that move and if its state should be recomputed:
https://github.com/odoo/odoo/blob/ba799a020dd2b07c9d6c379e23acee1e6fcc5e0a/addons/stock/models/stock_move_line.py#L379-L396 the discrepancy is caused by the fact that `move._should_bypass_reservation` will be true if the picking is a receipt and false for the other types because you should bypass reservation for moves whose source is not an internal location but you should not for others. This will leave the moves and picking in draft state if its a receipt and update it for other types. However, only draft pickings are confirmed at the beginning of the button validate: https://github.com/odoo/odoo/blob/b0cfeecacfc6b95659778dfe4d62435556aaa92c/addons/stock/models/stock_picking.py#L1131-L1133
### Use case II:
Create and confirm a picking of any type so that it ends up being assigned. Add manually a move line via the detailled operations.
### Steps to reproduce:
- Create two storable product P1 and P2 put 10 units of both in stock
- Go to Quality > Quality Control > Quality Points > New
- Create a new quality point for your product P2: Control per: "Operation" Operations: "Delivery"
- Create and confirm a Delivery for 1 unit P1
- Go to Detailed Operations > create a new line for 1 unit of P2
- Validate the Delivery
#### > the picking is done but no QC was created nor processed.
### Cause of the issue:
For the same reasons as above, the newly created move is assigned as it mimics the state of the current picking which is assigned since we have already reserved the already existing move.
### Fix:
We ensure the creation of quality checks for moves that end up being created but will never be confirmed.
### Technical limitation:
Unfortunately, it is not possible to manage the use case of quality checks related the component of a kit product without disrupting the barcode flows. Indeed, in barcode flows, the move line as well as its related move is created by a `save_barcode_data`. If we were to confirm the newly created moves rather than just trying to create the QC, it would indeed first explode the bom and then create the related QC for each component. However, the barcode data would not coincide anymore with the back end data since the line we just saved would have been exploded at backend creation. For that reason we do not yet support the above use cases for kit products.
Enterprise: https://github.com/odoo/enterprise/pull/81850
opw-4480104
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#203662
Forward-Port-Of: odoo/odoo#202725Currently when the user upload an e-invoice in compatible format, accounting information will be extracted to automatically create the bill and associated records. While creating the parnter, however, only basic information is filled in (name, vat, email, phone, country), leaving out the address Steps to reproduce: - Import an xml bill with complete partner info Issue: Only some partner fields are imported opw-4488308 Forward-Port-Of: odoo/odoo#203973 Forward-Port-Of: odoo/odoo#2017
Original PR description
Currently when the user upload an e-invoice in compatible format, accounting information will be extracted to automatically create the bill and associated records. While creating the parnter, however, only basic information is filled in (name, vat, email, phone, country), leaving out the address Steps to reproduce: - Import an xml bill with complete partner info Issue: Only some partner fields are imported opw-4488308 Forward-Port-Of: odoo/odoo#203973 Forward-Port-Of: odoo/odoo#201760
Steps to reproduce: - Install the Website. - Enter edit mode. - Click on the "Add to Cart Button" snippet in the snippet menu. - Bug: The message displayed in the dialog is "Do you want to install the Add to Cart Button app?". This is incorrect; the app name should be the module name instead of the snippet name. This commit displays the module name as expected and slightly enhances the design of the dialog (line break before the link + add an arrow icon before the link to the app info).
Original PR description
Steps to reproduce: - Install the Website. - Enter edit mode. - Click on the "Add to Cart Button" snippet in the snippet menu. - Bug: The message displayed in the dialog is "Do you want to install the Add to Cart Button app?". This is incorrect; the app name should be the module name instead of the snippet name. This commit displays the module name as expected and slightly enhances the design of the dialog (line break before the link + add an arrow icon before the link to the app info). #### Preview | Before | |--------| |  | | After | |--------| |  | task-4434981 Forward-Port-Of: odoo/odoo#202158 Forward-Port-Of: odoo/odoo#201757
Steps to reproduce: 1. Create a survey with 'multiple choice: only one answer' question no.1 2. Go to the question's options Tab > enable these three options 'Show comment field' & 'Comment is an answer' & 'Mandatory answer'. (For question no.1) 3. Add a second question to that survey. (any type) 4. Test the survey. 5. Click on the continue button without selecting the answer. 6. The error message overlaps the comment field Technical reason: The height of the `<div>` containing the <te
Original PR description
Steps to reproduce: 1. Create a survey with 'multiple choice: only one answer' question no.1 2. Go to the question's options Tab > enable these three options 'Show comment field' & 'Comment is an answer' & 'Mandatory answer'. (For question no.1) 3. Add a second question to that survey. (any type) 4. Test the survey. 5. Click on the continue button without selecting the answer. 6. The error message overlaps the comment field Technical reason: The height of the `<div>` containing the <textarea> was not properly set. After this commit: The alert message should be displayed below the comment field. Task-4663115 Forward-Port-Of: odoo/odoo#203209
We encountered an error when trying to open `Furniture` or `Clothes` from the `Dashboard` if the Administrator has been assigned Admin rights to a new user. Step to Reproduce: - Install the Point of Sale module without demo data. - Navigate to `Settings` > `Users` and `create` a new user with `Admin rights` of POS. - Log in with the newly created admin user. - Try to load sample data for `Furniture` or `Clothes`. Traceback: ``` while parsing /home/odoo/src/odoo/saas-18.1/addons/pro
Original PR description
We encountered an error when trying to open `Furniture` or `Clothes` from the `Dashboard` if the Administrator has been assigned Admin rights to a new user. Step to Reproduce: - Install the Point of…
We encountered an error when trying to open `Furniture` or `Clothes` from the
`Dashboard` if the Administrator has been assigned Admin rights to a new user.
Step to Reproduce:
- Install the Point of Sale module without demo data.
- Navigate to `Settings` > `Users` and `create` a new user with `Admin rights` of POS.
- Log in with the newly created admin user.
- Try to load sample data for `Furniture` or `Clothes`.
Traceback:
```
while parsing /home/odoo/src/odoo/saas-18.1/addons/product/data/product_demo.xml:5, somewhere inside
<record id="base.group_user" model="res.groups">
<field name="implied_ids" eval="[(4, ref('product.group_product_variant'))]"/>
</record>
```
Error[2] generated when solving above problem :
Traceback :
```
while parsing /home/odoo/odoo/community/addons/point_of_sale/data/orders_demo.xml:86,
somewhere inside <function model="pos.session" name="update_closing_control_state_session" eval="[[ref('pos_closed_session_1')], '']"/>
```
This issue was occuring since new users does not have access right of `res.groups`.
This commit will fix the above errors by using Superuser environment to load data..
sentry-6239966848
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#195374Dynamically use the latest `html_migrations` version in the `knowledge_history_tour` to avoid having to update the test every time a new html version is deployed. task-4640490 Forward-Port-Of: odoo/enterprise#81344
Original PR description
Dynamically use the latest `html_migrations` version in the `knowledge_history_tour` to avoid having to update the test every time a new html version is deployed. task-4640490 Forward-Port-Of: odoo/enterprise#81344
Following a change of behaviour of the library, hidden headers are not considered in a chart data, and the pie chart of Cost Repartition was stripped of its data. Task-4687551 Forward-Port-Of: odoo/enterprise#82673
Original PR description
Following a change of behaviour of the library, hidden headers are not considered in a chart data, and the pie chart of Cost Repartition was stripped of its data. Task-4687551 Forward-Port-Of: odoo/enterprise#82673
Relocated the get_fiscal_year_start_date method from l10n_in_reports_gstr to l10n_in_reports to ensure availability even if the GSTR module is uninstalled. This improves modularity and prevents dependency issues. Trace-back: ```RPC_ERROR Odoo Server Error Occured on 77578514-18-0-all.runbot143.odoo.com on model account.report and id 10 on 2025-04-01 13:02:27 GMT Traceback (most recent call last): File "/data/build/odoo/odoo/http.py", line 1962, in _transactioning return s
Original PR description
Relocated the get_fiscal_year_start_date method from l10n_in_reports_gstr to l10n_in_reports to ensure availability even if the GSTR module is uninstalled. This improves modularity and prevents…
Relocated the get_fiscal_year_start_date method from l10n_in_reports_gstr to l10n_in_reports to ensure availability even if the GSTR module is uninstalled.
This improves modularity and prevents dependency issues.
Trace-back:
```RPC_ERROR
Odoo Server Error
Occured on 77578514-18-0-all.runbot143.odoo.com on model account.report and id 10 on 2025-04-01 13:02:27 GMT
Traceback (most recent call last):
File "/data/build/odoo/odoo/http.py", line 1962, in _transactioning
return service_model.retrying(func, env=self.env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/odoo/odoo/service/model.py", line 156, in retrying
result = func()
^^^^^^
File "/data/build/odoo/odoo/http.py", line 1929, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/odoo/odoo/http.py", line 2177, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/odoo/odoo/addons/base/models/ir_http.py", line 333, in _dispatch
result = endpoint(**request.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/odoo/odoo/http.py", line 727, in route_wrapper
result = endpoint(self, *args, **params_ok)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/odoo/addons/web/controllers/dataset.py", line 36, in call_kw
return call_kw(request.env[model], method, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/odoo/odoo/api.py", line 533, in call_kw
result = getattr(recs, name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/enterprise/account_reports/models/account_report.py", line 5225, in get_report_information_readonly
return self.get_report_information(options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/enterprise/account_reports_cash_basis/models/account_report.py", line 17, in get_report_information
info = super().get_report_information(options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/enterprise/account_reports/models/account_report.py", line 5209, in get_report_information
'lines': self._get_lines(options, all_column_groups_expression_totals=all_column_groups_expression_totals, warnings=warnings),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/enterprise/account_reports/models/account_report.py", line 2544, in _get_lines
dynamic_lines = self._get_dynamic_lines(options, all_column_groups_expression_totals, warnings=warnings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/enterprise/account_reports/models/account_report.py", line 2996, in _get_dynamic_lines
rslt = self.env[self.custom_handler_model_name]._dynamic_lines_generator(self, options, all_column_groups_expression_totals, warnings=warnings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/build/enterprise/l10n_in_reports/models/l10n_in_report_handler.py", line 173, in _dynamic_lines_generator
self._get_out_of_fiscal_year_reversed_moves(options)
File "/data/build/enterprise/l10n_in_reports/models/l10n_in_report_handler.py", line 146, in _get_out_of_fiscal_year_reversed_moves
('reversed_entry_id.invoice_date', '<', AccountMove.get_fiscal_year_start_date(self.env.company, datetime.strptime(options['date']['date_to'], '%Y-%m-%d')))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'account.move' object has no attribute 'get_fiscal_year_start_date'
The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
RPC_ERROR
at makeErrorFromResponse (https://77578514-18-0-all.runbot143.odoo.com/web/assets/3b85f28/web.assets_web.min.js:3153:163)
at XMLHttpRequest.<anonymous> (https://77578514-18-0-all.runbot143.odoo.com/web/assets/3b85f28/web.assets_web.min.js:3158:13)```
Forward-Port-Of: odoo/enterprise#82775
Forward-Port-Of: odoo/enterprise#82681We need to use the payment method linked to the biggest paid amount, not the payment method linked to the biggest order. Forward-Port-Of: odoo/enterprise#82693
Original PR description
We need to use the payment method linked to the biggest paid amount, not the payment method linked to the biggest order. Forward-Port-Of: odoo/enterprise#82693
Description ----------- The non-stored field `user_has_access` is the primary `ir.rule` used for a `knowledge.article` and is included in every query. As a result, the method `_search_user_has_access` is frequently called and quickly becomes a performance bottleneck. This is particularly noticeable when opening the Knowledge app, as it involves reading the displayed article along with loading the sidebar. This update optimizes the method as follows: - For generic article access, the opti
Original PR description
Description ----------- The non-stored field `user_has_access` is the primary `ir.rule` used for a `knowledge.article` and is included in every query. As a result, the method…
Description
-----------
The non-stored field `user_has_access` is the primary `ir.rule` used for a `knowledge.article` and is included in every query. As a result, the method `_search_user_has_access` is frequently called and quickly becomes a performance bottleneck. This is particularly noticeable when opening the Knowledge app, as it involves reading the displayed article along with loading the sidebar.
This update optimizes the method as follows:
- For generic article access, the optimization leverages the field `inherited_permission`, which already contains the propagated `internal_permission` of the article along the hierarchy. This removes the need to recompute these permissions dynamically with a complex query since the data has already been precomputed.
- For member access, the query logic has been revised while maintaining the same outcome: Previously, the process involved: `for all articles, append the member and their permission, recurse into child articles for all in-sync and permissionless articles, and propagate the member's permission. Finally, discard all articles without any set permission.`, The new approach reverses the logic to avoid the need for discarding at the end and iterating through all articles: `for the articles the member belongs to, propagate the member's permission to its child articles, provided the child is in-sync, has no explicit permission, and the partner is not already a member of that article.` Although the last condition may seem counterintuitive, the initial set of articles considered encompasses those the member is linked to already. This also avoids cases where a parent article's member permission would overwrite differing permissions on its child articles.
- Additionally, `set` manipulations are used to handle IDs, thereby preventing the injection of large ID lists into multiple domain leaves. This improves query parsing and avoids poor query execution plans that could be caused by excessively large ID lists.
Benchmark
---------
On odoo.com, opening the Knowledge app from the Apps dashboard:
| Request | Before | After | Speed-up |
|----------------------|--------|-------|----------|
| web_read | 1.69s | 160ms | **10x** |
| get_sidebar_articles | 1.64s | 160ms | **10x** |
In a shell, searching articles with `[('user_has_access', '=', True)]`:
| User Type | Before | After | Speed-up |
|-----------------------|--------|-------|----------|
| `sudo` | 251ms | 35ms | **7x** |
| regular internal user | 577ms | 58ms | **10x** |
Reference
---------
task-4633813
Notice
------
⚠️ Note to clients/partners that might read this: For the full benefits of the patch, deploy the indexes that were added in this PR. This can be done by Upgrading the module `knowledge`, or creating the indexes manually in database. The patch should still be a net-benefit even for database without the indexes deployed.
Forward-Port-Of: odoo/enterprise#80971Currently, an exception is generated when the system tries to find the 'Out of Contract' work_entry_type after it has been deleted. Steps to Reproduce: 1 - Install hr_payroll module without demo data 2 - Navigate to hr payroll -> configuration -> work entry types 3 - delete the 'Out of contract' work entry type 4 - Navigate to hr payroll -> Contracts -> Contract 5 - Create a contract with a start date next to the current. 6 - Navigate to hr payroll -> payslips -> To pay 7 - Try
Original PR description
Currently, an exception is generated when the system tries to find the 'Out of Contract' work_entry_type after it has been deleted. Steps to Reproduce: 1 - Install hr_payroll module without demo data…
Currently, an exception is generated when the system tries to find the 'Out of Contract' work_entry_type after it has been deleted. Steps to Reproduce: 1 - Install hr_payroll module without demo data 2 - Navigate to hr payroll -> configuration -> work entry types 3 - delete the 'Out of contract' work entry type 4 - Navigate to hr payroll -> Contracts -> Contract 5 - Create a contract with a start date next to the current. 6 - Navigate to hr payroll -> payslips -> To pay 7 - Try to create Payslips To Pay for created contract 8 - an error occurs Error: ```ValueError External ID not found in the system: hr_payroll.hr_work_entry_type_out_of_contract ``` This issue[1] occurs because when the system tries to reference the missing 'Out of Contract' work entry type it results in a ValueError due to a missing required record. The same issue [2] occurs in the `l10n_hk_hr_payroll` module. [1] - https://github.com/odoo/enterprise/blob/265177dfd281f3aa1d61db6587ddfa37790570fe/hr_payroll/models/hr_payslip.py#L597 [2] -https://github.com/odoo/enterprise/blob/31e56779f8e0011ddc5c1a2821f68c8f041efbe4/l10n_hk_hr_payroll/models/hr_payslip.py#L180 This fix resolves the issue by ensuring that if the `Out of Contract` work entry type is missing, it returns a false value. A similar fix has been applied in `l10n_hk_hr_payroll`. Additionally, code has been added to prevent the deletion of any work entry type using @api.ondelete. sentry-6277939517 Forward-Port-Of: odoo/enterprise#82659 Forward-Port-Of: odoo/enterprise#79053
Steps to reproduce ================== - Install knowledge,contacts,web_studio - Open a contact record - Open studio - Add a many2many pointing to a knowledge article - Save and exit studio - Link an article and open it => this.env.ensureArticleName is not a function Cause of the issue ================== The knowledge article view uses a js_class and contains widgets that except the custom subenv from the controller. As the js_class isn't used in x2many views, the view crashe
Original PR description
Steps to reproduce ================== - Install knowledge,contacts,web_studio - Open a contact record - Open studio - Add a many2many pointing to a knowledge article - Save and exit studio - Link an article and open it => this.env.ensureArticleName is not a function Cause of the issue ================== The knowledge article view uses a js_class and contains widgets that except the custom subenv from the controller. As the js_class isn't used in x2many views, the view crashes. Solution ======== We can simply blacklist that model when searching for relations to add opw-4513295 Forward-Port-Of: odoo/enterprise#81068
After the refactor by https://github.com/odoo/enterprise/commit/84cc09959d82dbceb4fe673b85464ef3d8630606 the noCertificado field in the COA (Chart of Accounts) report became invalid. - On a Mexican company, generate the COA report from the Trial Balance. - In the generated XML, the noCertificado tag exceeds 20 characters. This tag should contain exactly 20 characters and match the noCertificado from the CFDI report. This commit applies the same string manipulation for the COA repoart a
Original PR description
After the refactor by https://github.com/odoo/enterprise/commit/84cc09959d82dbceb4fe673b85464ef3d8630606 the noCertificado field in the COA (Chart of Accounts) report became invalid. - On a Mexican company, generate the COA report from the Trial Balance. - In the generated XML, the noCertificado tag exceeds 20 characters. This tag should contain exactly 20 characters and match the noCertificado from the CFDI report. This commit applies the same string manipulation for the COA repoart as the cfdi report (in the _add_certificate_cfdi_values method in the l10n_mx_edi module) source: http://www.sat.gob.mx/esquemas/ContabilidadE/1_1/BalanzaComprobacion/BalanzaComprobacion_1_1.xsd opw-4644489 Forward-Port-Of: odoo/enterprise#82430
Previously, POL did not have a `discount` field which meant that the `discount` of a SOL was transferred in the `price_unit` of the POL. For example, the following SO: Product | Unit Price | Discount | Tax Excl. ------------|------------|----------|---------- Product A | $1000.0 | 10.0% | $900.0 Would be converted into the following PO Product | Unit Price | Tax Excl. ------------|------------|---------- Product A | $900.0 | $900.0 However, as of V17, it
Original PR description
Previously, POL did not have a `discount` field which meant that the `discount` of a SOL was transferred in the `price_unit` of the POL. For example, the following SO: Product | Unit Price | Discount | Tax Excl. ------------|------------|----------|---------- Product A | $1000.0 | 10.0% | $900.0 Would be converted into the following PO Product | Unit Price | Tax Excl. ------------|------------|---------- Product A | $900.0 | $900.0 However, as of V17, it is possible to add discount on POL, but are not taken into account when converting into SOL. With this commit, the discounts are now synchronized when going from SOL->POL and inversely. opw-4446288 Forward-Port-Of: odoo/enterprise#82346 Forward-Port-Of: odoo/enterprise#82079
When the fulfilment channel changes from Amazon, the user currently must delete the offer to create a new one, as they can't change the amazon_feed_ref. (Please note that due to an API change, this field does in fact include a JSON containing the product type, fulfilment channel, and the feed reference.) Indeed, when the listing is changed, Amazon doesn't get the information. This means we will continue to update the inventory if that offer was in FBM. Or not updating the inventory of a no
Original PR description
When the fulfilment channel changes from Amazon, the user currently must delete the offer to create a new one, as they can't change the amazon_feed_ref. (Please note that due to an API change, this…
When the fulfilment channel changes from Amazon, the user currently must delete the offer to create a new one, as they can't change the amazon_feed_ref. (Please note that due to an API change, this field does in fact include a JSON containing the product type, fulfilment channel, and the feed reference.) Indeed, when the listing is changed, Amazon doesn't get the information. This means we will continue to update the inventory if that offer was in FBM. Or not updating the inventory of a now FBM offer. While that second case would only require the user to delete and recreate a new offer (which would be a bother but not that problematic), sending a quantity to a FBA offer would trigger a well known problem of ghost listing on Amazon, where Amazon will consider having both channels, and randomly set an order as either FBA or FBM, until that ghost listing quantity drop down to 0. When catching a discrepancy, we'll thus reset the value of the amazon_feed_ref, so that it'd be pulled again later if needed by the sync inventory with, this time, the correct value. This would also stop the inventory synchronization of a potentially FBA offer. As for any stock synchronization that might happen between the listing changes from Amazon side and the first order received in FBA, we decided against forcing the FBM quantity to 0 on all FBA offer every time, to avoid sending too many useless calls for a corner case. As the product was until now sold in FBM, in most cases, it can still be until the end of the ghost listing. If not, our support is aware of it and can force the quantity to 0 again. opw-4681035 Forward-Port-Of: odoo/enterprise#82754
* stock{,_barcode, _barcode_quality_control}, quality_control ### Issue: Quality checks per operation and per product are generated by an override of the action confirm of the move. However, if a move line is created on a non draft picking, it will end up in a move that will never be confirmed. This happends because the move is created with a state to match its already existing picking and hence is not confirmed at creation and since only draft pickings are confirmed at the start of the bu
Original PR description
* stock{,_barcode, _barcode_quality_control}, quality_control ### Issue: Quality checks per operation and per product are generated by an override of the action confirm of the move. However, if a…
* stock{,_barcode, _barcode_quality_control}, quality_control
### Issue:
Quality checks per operation and per product are generated by an override of the action confirm of the move. However, if a move line is created on a non draft picking, it will end up in a move that will never be confirmed. This happends because the move is created with a state to match its already existing picking and hence is not confirmed at creation and since only draft pickings are confirmed at the start of the button validate. As a result, we will not create the quality checks related to these additional moves.
The above issue can be triggered in many situations. Here are the two major ones:
### Use case I:
Creating a delivery or an internal transfer on the fly from the barcode app.
### Steps to reproduce:
- Create a storable product P with a barcode: XXX
- Go to Quality > Quality Control > Quality Points > New
- Create a new quality point for your product: Control per: "Operation" Operations: "Delivery"
- Go to the barcode app > Operations > Delivery > New
- Scan your product
- Validate the Delivery
#### > the picking is done but no QC was created nor processed.
### Cause of the issue:
The `save_barcode_data` will launch the creation of the move line related to the barcode line you edited from the barcode app. During the create of this 'stock.move.line', an associated move will be created and its initial "state" will be the current state of the picking: https://github.com/odoo/odoo/blob/ba799a020dd2b07c9d6c379e23acee1e6fcc5e0a/addons/stock/models/stock_move_line.py#L354-L356 https://github.com/odoo/odoo/blob/ba799a020dd2b07c9d6c379e23acee1e6fcc5e0a/addons/stock/models/stock_move_line.py#L942 At this point the picking state is "draft" and the move will be correctly created in draft. However, just a few lines after its creation, we will check if a reservation should be done with that move and if its state should be recomputed:
https://github.com/odoo/odoo/blob/ba799a020dd2b07c9d6c379e23acee1e6fcc5e0a/addons/stock/models/stock_move_line.py#L379-L396 the discrepancy is caused by the fact that `move._should_bypass_reservation` will be true if the picking is a receipt and false for the other types because you should bypass reservation for moves whose source is not an internal location but you should not for others. This will leave the moves and picking in draft state if its a receipt and update it for other types. However, only draft pickings are confirmed at the beginning of the button validate: https://github.com/odoo/odoo/blob/b0cfeecacfc6b95659778dfe4d62435556aaa92c/addons/stock/models/stock_picking.py#L1131-L1133
### Use case II:
Create and confirm a picking of any type so that it ends up being assigned. Add manually a move line via the detailed operations.
### Steps to reproduce:
- Create two storable product P1 and P2 put 10 units of both in stock
- Go to Quality > Quality Control > Quality Points > New
- Create a new quality point for your product P2: Control per: "Operation" Operations: "Delivery"
- Create and confirm a Delivery for 1 unit P1
- Go to Detailed Operations > create a new line for 1 unit of P2
- Validate the Delivery
#### > the picking is done but no QC was created nor processed.
### Cause of the issue:
For the same reasons as above, the newly created move is assigned as it mimics the state of the current picking which is assigned since we have already reserved the already existing move.
### Fix:
We ensure the creation of quality checks for moves that end up being created but will never be confirmed.
### Technical limitation:
Unfortunately, it is not possible to manage the use case of quality checks related the component of a kit product without disrupting the barcode flows. Indeed, in barcode flows, the move line as well as its related move is created by a `save_barcode_data`. If we were to confirm the newly created moves rather than just trying to create the QC, it would indeed first explode the bom and then create the related QC for each component. However, the barcode data would not coincide anymore with the back end data since the line we just saved would have been exploded at backend creation. For that reason we do not yet support the above use cases for kit products.
Community: https://github.com/odoo/odoo/pull/202725
opw-4480104
Forward-Port-Of: odoo/enterprise#82291
Forward-Port-Of: odoo/enterprise#81850Isuue: - When on a relatively slower network, if we double click the comments icon present on the social media post, the comments dialog box opens up twice. - Can be spotted easily on the runbot as well. Video of the issue https://drive.google.com/file/d/1abe7Cq3otsVNH4hGRHFV34jC3uIGHY6m/view?usp=drive_link Reason: - There is no existing mechanism present to prevent this kind of scenario. Fix: - We simply use a flag to prevent this. We set/reset the value as we desire. Task-418
Original PR description
Isuue: - When on a relatively slower network, if we double click the comments icon present on the social media post, the comments dialog box opens up twice. - Can be spotted easily on the runbot as well. Video of the issue https://drive.google.com/file/d/1abe7Cq3otsVNH4hGRHFV34jC3uIGHY6m/view?usp=drive_link Reason: - There is no existing mechanism present to prevent this kind of scenario. Fix: - We simply use a flag to prevent this. We set/reset the value as we desire. Task-4184968 Forward-Port-Of: odoo/enterprise#82717 Forward-Port-Of: odoo/enterprise#82411