Skip to content

Syncing from upstream odoo/odoo (saas-18.4) #34204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Jul 10, 2025
Merged

Conversation

bt-admin
Copy link
Collaborator

bt_gitbot

DjamelTouati and others added 30 commits July 9, 2025 02:53
bug introduced in: ea48070

Steps to reproduce the bug:
- Go to "Inventory" → "Operations" menu → "Replenishment"
- Click "New" to create a new replenishment rule

Problem:
Traceback is triggered:
```
in _float_check_precision assert precision_rounding > 0,\
^^^^^^^^^^^^^^^^^^^^^^ AssertionError: precision_rounding must be
positive, got 0.0
```

As the product is not set, the `product_uom` is not set either,
which leads to a `product_uom.rounding` of 0.0.

Opw-4925719
Opw-4928957
Opw-4926504
Opw-4925919
Opw-4928684
Opw-4925080
Opw-4928788
Opw-4926719
Opw-4927440
opw-4928540

closes #217962

X-original-commit: 6218559
Signed-off-by: Quentin Wolfs (quwo) <[email protected]>
Signed-off-by: Djamel Touati (otd) <[email protected]>
Steps to reproduce:
	- Navigate to a Project > View (Timesheets)
	- Open studio and add x_plan2_id for example to the view
	- Try creating a new timesheet and set a value for the field we added using studio
	- Save and notice the field doesn't keep its value

Cause:
This is mainly happening because when getting the plan_ids for
the account we are gonna fill we just get the account in the distribution
and ignore if the user is setting another value

Fix:
We check the create vals_list if a plan has value we set
it before setting the account in the distribution

opw-4716041

closes #217826

X-original-commit: b817ad8
Signed-off-by: Xavier Bol (xbo) <[email protected]>
Description
-----------
The test `.test_enforce_index_on_one2many_inverse` was added to fail
upon a missing index, so developers could add them during
development, before merging.

One of the criteria used to ignore the field for indexing was if it
belongs to a `test` model in some test module. The best-effort
heuristic used for this is to see if there is some `ir.model.
data` associated with the model in question and if all module's
names associated with these data entries have `test`, then we can
ignore the field for indexing.

But due to the semantics of `all` for empty collections:
```py
assert all([]) is True
```
models that had *no* `ir.model.data` associated at all, e.g. install
`--without-demo` and no master data, the field would be ignored for
indexing, leading to a passing test.

But on nightly, where the CI is run with demo data also, the field
isn't ignored anymore and is caught by the test's assertion for
indexing suggestion as expected.

This leads to errors that are never addressed by the developer that
added the fields in question.

This commits corrects the test and add the missing indexes that
were raised from the CI's false-positive that were missed.

Reference
---------
runbot-227546

closes #217892

X-original-commit: c7c3e4a
Related: odoo/enterprise#89732
Signed-off-by: Rémy Voet (ryv) <[email protected]>
Signed-off-by: Piryns Victor (pivi) <[email protected]>
Before, the previous document chaining was not sent in the
XML because with the t-if, if the variable name is unknown,
it will not complain and just see it as False. (like for the
first invoice that has no previous)

Now, passing the correct variable name, the previous document
will be included

opw-4814241

closes #217930

X-original-commit: 4aa87ad
Signed-off-by: Ruben Gomes (rugo) <[email protected]>
Signed-off-by: Josse Colpaert (jco) <[email protected]>
Before this commit:
When calculating the `price_unit` for stock moves from purchase order lines,
the `remaining_qty` and `remaining_value` could be imprecise. Standard float
comparisons for these remaining amounts could lead to incorrect `price_unit`
calculations if, for example, `remaining_qty` was a very small float near zero.
This could result in inaccurate stock valuations, particularly when currency
conversions were involved or when landed costs were applied.

For example, 70.00000003 is rounded **up** to 70.00001 (with 5 digits),
resulting in a quantity difference of 0.00001, which incorrectly
inflates the unit cost.

After this commit:
Change the rounding method to 'HALF-UP' instead of the default 'UP' to improve
precise result for quantities.

Steps to reproduce:
1. Configure a product with AVCO real time. Set decimal precision for price
   and UoM to 5 digits.
2. Create a Purchase Order (e.g., 190 units @ $110/unit).
3. Receive 70 units and create a backorder
4. Create and post a bill for the initially received quantity.
5. Apply a landed cost to the picking of the first 70 units.
6. Create a draft bill for the remaining quantity on the PO.
7. Receive the remaining 120 units from the backorder.
8. The product's cost explodes

opw-4705224

closes #218011

X-original-commit: 60a5ba0
Signed-off-by: Tiffany Chang (tic) <[email protected]>
Signed-off-by: Walravens Mathieu (wama) <[email protected]>
Steps to reproduce:
- Install l10n_it_edi
- Switch to an Italian company (e.g. IT Company)

- In Accounting settings, activate "Fattura Elettronica (FatturaPA)"
- When saving the settings, the system tries to create an EDI proxy
user if there is no existing EDI proxy user in "test" or "prod" mode

- Neutralize the database with the following command:
odoo-bin neutralize -d [db_name]

- Go the settings and save

Issue:
Upon save, the system will try to create an EDI proxy user in "prod"
mode (or "test" mode if "l10n_it_edi.proxy_user_edi_mode" system
parameter is set to "test").
The database is neutralized.
It should not create an EDI proxy user in "prod" mode by default.

Cause:
An EDI proxy user is created in "prod" mode automatically when there
is no existing proxy user in that mode and "FatturaPA" is activated.
During the neutralization of the database, all proxy users are
switched to "demo" mode, but "FatturaPA" is not deactivated.
Therefore, the configuration is set to create a "prod" EDI proxy user.

Solution:
As we want to create an EDI proxy user in "prod" mode by default on a
non-neutralized database, we can deactivate "FatturaPA" option during
the neutralization to prevent the creation of an EDI proxy user on a
neutralized database when saving the settings.

opw-4795396

closes #218008

X-original-commit: c337710
Signed-off-by: Paolo Gatti (pgi) <[email protected]>
Signed-off-by: Anh Thao Pham (pta) <[email protected]>
Steps to reproduce
===============
1. Create a company called Acme.
2. Create a child contact of type Invoicing address but do not give it any name.
3. Go to Sales.
4. Open the dropdown to select customer
---> Recipient without name will show False after the parent name

From [Commit 1], formatted display name was added.
After this commit, add a fallback as customer's type to the name.

[Commit 1]: 4f59494

Task-4812554

closes #217995

X-original-commit: 1980762
Signed-off-by: Warnon Aurélien (awa) <[email protected]>
Signed-off-by: Kadam Darji (kmdi) <[email protected]>
…of int

The system will crash when we get the `category` as `str` and we try to evaluate
`int(category)` in `_validate_and_get_category` method.

Root Cause:-
- At [1] and [2], we are passing an object in the arguments for the
  category. If we manually provide a category, it may result in a 'not found'
  error instead of a regular error.
- However, at point [3], Since the category is received from a query parameter,
  it can be easily tampered with, so it should be properly validated before use.
- This controller makes the older controller (used before V14) compatible
  with the new one.

[1]
https://github.com/odoo/odoo/blob/1df0feb3dc1b0ac34227683337eca4d95fa986b5/addons/website_sale/controllers/main.py#L470

[2]
https://github.com/odoo/odoo/blob/1df0feb3dc1b0ac34227683337eca4d95fa986b5/addons/website_sale/controllers/main.py#L247

[3]
https://github.com/odoo/odoo/blob/1df0feb3dc1b0ac34227683337eca4d95fa986b5/addons/website_sale/controllers/main.py#L546

Error:-
`ValueError: invalid literal for int() with base 10: 'duffle-bags'`

Solution:-
- We added a validation to ensure the category parameter is a valid integer
  before using it.
- This prevents crashes when users manually input invalid or tampered
  category values in the URL.

Sentry - 6658317828

closes #217996

X-original-commit: 7c5de68
Signed-off-by: Louis Tinel (loti) <[email protected]>
Signed-off-by: Krishna Arvindkumar Patel (krip) <[email protected]>
Otherwise, it causes it fails to assign value to certain records, which is unadvised.

closes #218080

X-original-commit: ce487c4
Signed-off-by: Nicolas Viseur (vin) <[email protected]>
Problem:
When a user rotates an image, certain image sizes can cause the
editable area to become scrollable. This triggers `resetHandlers`
from `usePositionHook`, resulting in loss of focus on the rotate
controller.

Solution:
Add a flag to detect when the user is actively transforming
(`mousedown`). Delay the reset until interaction ends (`mouseup`),
preventing premature handler reset.

Steps to reproduce:
- Add a long image
- Transform > Rotate until a scrollbar appears
- You lose focus on the rotate controller

opw-4890029

closes #218046

X-original-commit: 1b5b239
Signed-off-by: David Monjoie (dmo) <[email protected]>
Signed-off-by: Walid Sahli (wasa) <[email protected]>
This commit fixes a typo in the name of the compute method of the is_future field.

closes #218088

Signed-off-by: Jurgen Gjini (jugj) <[email protected]>
In order to satisfy certification requirements from the LNE, we
implement the following:
- A product is weighed at e.g. 200g and added to the order
- Another product is weighed. The weight must change from 200g before
  the user is allowed to add the item.
- This should also happen even if another non-weighed product is added
  in-between.

task-4859589

closes #217957

X-original-commit: 8ea3661
Related: odoo/enterprise#89763
Signed-off-by: Yaroslav Soroko (yaso) <[email protected]>
Signed-off-by: Max Whale (mawh) <[email protected]>
The previous hashCode algorithm produced was distribution-dependent results,
causing errors in the Runbot's nightly tests for different distributions.

The new hashCode algorithm is the same as the one used in Hoot [1], and this
algorithm produces non-distribution-dependent results.

[1]: https://github.com/odoo/odoo/blob/4d7e941939b2d8b644cbf0d9a5a0aa2bb8d4c9e8/addons/web/static/lib/hoot/hoot_utils.js#L941

runbot-error : 227626

closes #217937

Signed-off-by: Lucas Perais (lpe) <[email protected]>
Steps to reproduce
===============
1. Create a company called Acme.
2. Create a child contact of type Invoicing address but do not give it any name.
3. Go to Sales.
4. Open send mail composer and add this partner as a recipient.
---> The recipient tag will show Unnamed.

From [Commit 1], the fallback for partner without name and email was unnamed.

After this commit, consider display_name for the tag's text before falling back
to the `Unnamed`.

[Commit 1]: cba81ac

Task-4812554

closes #218097

X-original-commit: 6a80886
Signed-off-by: Warnon Aurélien (awa) <[email protected]>
Before this commit:
If a tax detail of an invoice line has the None tax grouping key, there
is a traceback when generating the UBL InvoiceLine/ClassifiedTaxCategory

After this commit:
We exclude tax details that have the None grouping key when generating
the InvoiceLine/ClassifiedTaxCategory.

task-none

closes #218000

X-original-commit: 2c2e86d
Signed-off-by: Laurent Smet (las) <[email protected]>
Signed-off-by: Antoine Dupuis (andu) <[email protected]>
Since this commit: 0ecaa6e
The props noSearchMore was removed but was kept in the FieldMany2ManyTagsBanks
widget.
When being in debug mode and going to the customer -> accounting tab, we have a
props validation error.

This commit will remove the noSearchMore options and props. Also, correcting
some small linter issue

no task id

closes #215154

Signed-off-by: Florian Gilbert (flg) <[email protected]>
**PROBLEM**
When changing the vat label associated to the country of the user's company, it should change the label of the `vat` field. The cached partners views are not invalidated as they should and the old views with the old label  are presented to the user instead of the new ones. This can be confusing to the user, because while their change had an effect on the database, it doesn't reflect on the views showed to them.

**STEP TO REPRODUCE**
1. On a fresh database, install the contact app.
2. From the contact app, Configuration->Countries, select United States which should be the country of the demo company.
3. Change the Vat Label field value.
4. Go on any contact form view, and notice the label of the `vat` field wasn't updated.
5. You can refresh the pages, and sometimes the new value will be there, sometimes not.

**CAUSE**
https://github.com/odoo/odoo/blob/ac106704f3c2d3e3fa94415134b9d5522b325378/odoo/addons/base/models/res_partner.py#L41C1-L55C1
In the mixin `FormatVATLabelMixin` we modify the form view, changing the label of the vat field accordingly. However, the `_get_view_cache_key` override that would add the field used to make the change (`self.env.company.country_id.vat_label`) to the cache key is missing. Which means the cache isn't invalidated when it should.

**FIX**
Invalidating cache when writing on `vat_label`

opw-4825749

closes #218051

X-original-commit: 7c21830
Signed-off-by: Rémy Voet (ryv) <[email protected]>
Signed-off-by: Léo Gizard (legi) <[email protected]>
This commit fix the props validation issue.here `activeForm` props
should be optional props.

runbot-227681

closes #217890

Signed-off-by: Francois Georis (fge) <[email protected]>
Currently, an error occurs when a pre-formatted text is directly
pasted into the product description using the website editor.

Steps to reproduce:
1. Install the eCommerce app.
2. Open the web editor on any product's detail page.
3. Add product description by copy-pasting preformatted text like:
 **Amazing Features**
 stability, durability, consistency
4. Save the changes.

Error:
KeyError - None

Cause:
The issue is caused by an invalid HTML structure.
When preformatted/nested block elements are pasted, they get wrapped
inside <p> block, which is not valid HTML. This leads to missing
data-oe-model attributes on sub-elements, resulting in an error.

Before saas-18.4, the text block used a <div> tag to wrap content.
After [this] commit, the wrapper was changed to a <p> tag.
[this]: bbb2d98

Fix:
This commit replaces the wrapper tag with a <div> to ensure that
preformatted and block-level content can be added and saved.

sentry-6731261789

closes #217928

Signed-off-by: Géry Debongnie <[email protected]>
When modifying or deleting an Analytic Account on an Analytic Item, it
is not reflected on the Analytic Distribution of the Journal Item.
The user can be mislead, given on the business objects (invoice lines),
he sees the initial Analytic Distribution but there is no guarantee
that the related Analytic Item remains consistent.

task-4378407

closes #218055

X-original-commit: 4124783
Signed-off-by: William André (wan) <[email protected]>
Steps to reproduce:
- Create a custom snippet.
- Switch website and enter in edit mode.

-> Problem: the custom snippet is present in edit mode on the second
website while it should only be available on the first one.

The commit adds back the `website_id` information when loading the
snippets. The information was missing since [the website refactoring].

Related to task-4367641

[the website refactoring]: 9fe45e2

closes #218134

Signed-off-by: Francois Georis (fge) <[email protected]>
Since [1], #207974 websocket timeout
has been increased during test. Fetching notification only returns the
notifications of the last 50 seconds initially. When runbot is under
high load, this can lead to non deterministic failures.

This commit patches the cursor date to bypass this issue.

[1]: #207974

fixes rubot-223126,223758

closes #218133

X-original-commit: f192176
Signed-off-by: Matthieu Stockbauer (tsm) <[email protected]>
Before this commit in some snippets background overlay wouldn't have
proper height and/or width because of the snippets `h-{}, w-{}` classes.
This commit overrides it with `!important`.
To reproduce the issue:
- open website and start editing
- drop columns snippet, add background image to one of the cards, click
on it
- Click on the background position option to change it(the one with
a crosshair icon)
- the overlay isn't shown properly, which also breaks the tooltip
position

task-4930050

closes #218107

X-original-commit: 85dde1d
Signed-off-by: Colin Louis (loco) <[email protected]>
Versions
--------
- 17.0+

Steps
-----
1. Configure website to display prices tax-included;
2. disable selling out-of-stock products;
3. go to an out-of-stock product page;
4. request a reminder email;
5. replenish product stock;
6. run the `_send_availability_email` action;
7. check email that was sent.

Issue
-----
The price display in the email does not include taxes.

Cause
-----
The email only checks the `list_price` defined on the product.

Solution
--------
Don't include the price in the email:
  - On stable: hide the element to avoid breaking xpaths
  - On master: remove the element from the template

opw-4712613

closes #218140

X-original-commit: 22c333d
Signed-off-by: Levi Siuzdak <[email protected]>
…ncy on expense report

When generating an expense report for an expense recorded in a currency different from the company's, the totals were shown with the symbol of the expense's currency, even though the amounts were actually in the company's currency.

opw-4807756

closes #215671

X-original-commit: dc384e6
Signed-off-by: Olivier Colson (oco) <[email protected]>
This commit attempts to solve two race conditions.

Race Condition 1
----------------
When we open the website editor action, we start the website in the iframe. The
code inside the iframe will load `web.assets_frontend_lazy`. Then, when we click
on the Edit button, we open the builder and it loads inside the iframe the
bundle `website.website_builder_assets`.

So, if a tour or a test is very quick to click on the button, these 2 actions
can happen in a short succession.  Then if the website builder bundle arrives
first, it cannot load because it is missing code from `assets_frontend_lazy`,
so we have a crash (dependency error)

Race Condition 2
----------------
Inside the iframe, the `website_edit_service` is started, it puts a listener on
the main document (not the iframe) on an event `edit_interaction_plugin_loaded`.
Then, when we open the builder, we wait for the iframe to be loaded, then we
start the editor, and all its plugins. The `EditInteractionPlugin` dispatch the
`edit_interaction_plugin_loaded` to communicate with the edit service inside the
iframe.

So, if by bad luck, the `EditInteractionPlugin` dispatches the event before the
website edit service is loaded, it will fail to get an answer, and a reference
to the website edit service. This will lead to an error:
"website edit service not loaded"

Solution
--------
Race condition 1 can be solved by waiting for the iframe to be ready (so, the
assets_frontend code is loaded) before loading the edit assets inside the iframe.

Race condition 2 can be solved by waiting for the iframe to be ready (so the
website_edit service is started) before starting the editor (and the
EditInteractionPlugin)

closes #217923

Signed-off-by: Francois Georis (fge) <[email protected]>
*: website

Some tests trigger a link preview. The link preview causes issues in
tests with relative urls. The next commit changes the link tool to
preview relative urls without turning them to absolute urls. This commit
is kept separate to isolate the noise

task-4367641

Part-of: #216832
Signed-off-by: David Monjoie (dmo) <[email protected]>
Steps to reproduce:
- Open website builder
- Click on a link with a relative URL (there is `/contactus` in footer)
- Bug: the url shown is an absolute url (`https://.../contactus`)
- Click "Edit Link" (one of the icons)
- Click "Apply"
- Bug: the url in the dom has changed (it saved the absolute url)

The link popover used `HTMLAnchorElement.href` to get the url. This
getter returns an absolute url even if the `href` attribute is a
relative url.

task-4367641

closes #216832

Signed-off-by: David Monjoie (dmo) <[email protected]>
- Make `invoice_currency_rate` editable.
- Add a date picker widget that let the user apply the rate of a
certain date.
- Add a refresh button when the rate is not the expected one.

To that end, the computed field `expected_currency_rate` is added.

task-4378994

closes #218049

X-original-commit: 2d486fb
Signed-off-by: William André (wan) <[email protected]>
Signed-off-by: Arnaud Sibille (arsi) <[email protected]>
…rch panel

Before this commit:
- Long dashboard names were truncated in the search panel.
- There was no way for the user to see the full name.

After this commit:
- A tooltip has been added to display the full dashboard name on hover.

closes #218094

Task: 4903713
X-original-commit: b5c291a
Signed-off-by: Pierre Rousseau (pro) <[email protected]>
Signed-off-by: Ronakkumar Mukeshbhai Bharadiya (rmbh) <[email protected]>
fmdl and others added 10 commits July 9, 2025 15:47
Before this commit an error can appear if there two delivery line.
Use method in delivery module to compute delivery amont.
This method can compute if there are two line with delivery
https://github.com/odoo/odoo/blob/18.0/addons/delivery/models/sale_order.py#L27

closes #218166

X-original-commit: 173de20
Signed-off-by: Antoine Vandevenne (anv) <[email protected]>
This commit re-enables the test_website_text_highlights test, which was
broken and skipped due to the DOM changes introduced by the new Website
Builder. It also adapts the tour selectors accordingly.

Previously, the text highlight option was available in the option bar,
but in the new Website Builder, it has been moved to the overlay for
easier editing.

closes #214987

Signed-off-by: Francois Georis (fge) <[email protected]>
When [1] introduced a cached version of the form data to compute
visibility, it did not take into account the values that are completed
through `prefillValues`. Because of this, input events are required for
those to be taken into account.

This commit fixes this by re-evaluating the form content after the
execution of `prefillValues`.

Steps to reproduce:
- Drop a "Form" snippet
- Make "Your Question" field visible only if "Your Email" is set.
- Save page.

=> Upon display, the email is populated with the user's email, but "Your
Question" did not become visible.

[1]: 027ce4e

task-jke

closes #218115

X-original-commit: 3682459
Signed-off-by: Francois Georis (fge) <[email protected]>
The 'translate_menu_name' tour was previously
broken due to DOM structure changes introduced by the new website
builder and was consequently disabled.

This commit updates the tour steps to align with the new DOM and
re-enables the associated test.

closes #211387

Signed-off-by: Francois Georis (fge) <[email protected]>
Steps to reproduce bug
- Add text snippet
- Add a separator
- Click on the separator
- Set color/style
- Click on the width
- Change the width either by inserting another number or with up/down
arrows
=> the color and style get reverted

After this commit the separator style does not get reverted

closes #218136

Signed-off-by: Géry Debongnie <[email protected]>
following tours were previously broken due to DOM structure changes
introduced by the new website builder and were consequently disabled.

- conditional_visibility_1
- conditional_visibility_2
- conditional_visibility_3
- conditional_visibility_4
- conditional_visibility_5

This commit updates the tour steps to align with the new DOM and
re-enables the associated test.

closes #211474

Signed-off-by: Francois Georis (fge) <[email protected]>
The goal of this commit is to ignore mutations generated by bootstrap.
For example, when opening a dropdown or an offcanvas.

closes #216812

Signed-off-by: Francois Georis (fge) <[email protected]>
Since [1], a crash occurs when the Custom Amount option for the
`s_donation` snippet is `None` and you use it.

Steps to reproduce:
- Drop `s_donation` snippet
- Set Custom Amount option as `None`
- Save and exit edit mode
- Click on `Donate Now` button
- A traceback occurs instead of showing an error to select an amount

[1]: 22e777c

closes #218197

X-original-commit: 00c0936
Signed-off-by: Benoit Socias (bso) <[email protected]>
Signed-off-by: Augustin Dupin (duau) <[email protected]>
moving test to pos enterprise as this field `account_tax_periodicity_journal_id`
is available in the saas-18.2 version of Odoo 18.2 enterprise version.

pos_enterprise commit : https://github.com/odoo/enterprise/pull/88742/commits/2acc7ab586485c50d49b8d1e21ff513041c328bc

build_error-227602

closes #218225

X-original-commit: 7ee9566
Signed-off-by: David Monnom (moda) <[email protected]>
Signed-off-by: Omar Sherif Ali Hassan (osah) <[email protected]>
Before this commit, tour "test_discuss_channel_public_page_as_guest"
would crash in test after posting a message in which we attempt to
add a reaction.

This happens because the step is a `hover && click 'Add a reaction'`,
so it hovers on selector `o-mail-Message:contains(cheese)` then
clicks on the 'Add a reaction' action.

In discuss channels, when sending a message, the message is
immediately shown on UI before there's a genuine message that is
created in DB. This optimistic behavior gives impression the app
is fast, but some actions require a genuine message like
'Add a reaction'. The problem of test is that selector
`.o-mail-Message:contains(cheese)` passes with temporary / transient
message of optimistic behavior, so the `hover` step would be
triggered on the temporary / transient message and 'Add a reaction'
action is awaited for click.

Problem is that when genuine message data is received, implementation
detail deletes the temporary / transient message and then shows the
genuine message. Because the genuine message is different, component
identity is different (it uses message.localId in `t-key`), thus
it awaits `Add a reaction` on UI but it's not visible because we
need to hover again, this time on genuine message.

This commit fixes the issue by awaiting message is shown on UI is
the persistent, i.e. non-temporary and non-transient, so that hover
and click on the 'Add a reaction' action works without issue.

fixes runbot errors 181660
fixes runbot errors 222093
fixes runbot errors 227756

closes #218250

X-original-commit: bdfb81e
Signed-off-by: Alexandre Kühn (aku) <[email protected]>
@bt-admin bt-admin merged commit 8280733 into brain-tec:saas-18.4 Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.