Skip to content

Syncing from upstream odoo/odoo (saas-18.1) #34201

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 29 commits into from
Jul 10, 2025
Merged

Conversation

bt-admin
Copy link
Collaborator

bt_gitbot

daiduongnguyen-odoo and others added 29 commits July 9, 2025 02:07
The current validation uses stdnum.vn.mst.validate(), which only accepts
10- or 13-digit MST with legacy checksum logic. It does not support the
12-digit CCCD format now required for individuals from 01/07/2025
(per Circular 86/2024/TT-BTC).

* This patch introduces a separate format-level validator for:
  • 10-digit enterprise VAT
  • 13-digit branch VAT (10-digit + suffix)
  • 12-digit CCCD (from 01/07/2025)

* References:
  • Circular 86/2024/TT-BTC (tax registration & CCCD admin):
https://thuvienphapluat.vn/van-ban/Thue-Phi-Le-Phi/Thong-tu-86-2024-TT-BTC-dang-ky-thue-565309.aspx
  • CCCD replacing tax ID from 01 Jul 2025:
https://thuvienphapluat.vn/ma-so-thue/bai-viet/cach-doi-ma-so-thue-sang-ma-so-dinh-danh-ca-nhan-tu-0172025-200926.html
  • VAT ID structure 10/13 digits (Law, TT 105/2020):
https://thuvienphapluat.vn/phap-luat/cau-truc-ma-so-thue-la-10-chu-so-hay-13-chu-so-phan-loai-cau-truc-ma-so-thue-nhu-the-nao-theo-quy-d-796465-178397.html

closes #217880

X-original-commit: b87c896
Signed-off-by: Nicolas Viseur (vin) <[email protected]>
We have recently introduced several new versions of the delivery
connectors, based on the newer REST APIs introduced by the shipping
companies (USPS, FedEx, UPS, DHL).

However, in the settings we still link with installation checkboxes to
the old modules.

To avoid confusion for the user, we remove these checkboxes and refer
the user to the Apps menu instead for manual installation of the
preferred shipping connector. In the apps menu, we clarify that these
new modules are only compatible with the new REST APIs, and we also hide
the legacy modules by default by making them application: False.

X-original-commit: 0832d9ee3cb821254b4ce30eedc05e32adc96332
[FIX] delivery_*_rest: update settings for delivery connectors

We have recently introduced several new versions of the delivery
connectors, based on the newer REST APIs introduced by the shipping
companies (USPS, FedEx, UPS, DHL).

However, in the settings we still link with installation checkboxes to
the old modules.

To avoid confusion for the user, we remove these checkboxes and refer
the user to the Apps menu instead for manual installation of the
preferred shipping connector. In the apps menu, we clarify that these
new modules are only compatible with the new REST APIs, and we also hide
the legacy modules by default by making them application: False.

closes #218028

X-original-commit: 54c7cd0
Related: odoo/enterprise#89803
Signed-off-by: Arnold Moyaux (arm) <[email protected]>
Signed-off-by: Claeys Pieter (clpi) <[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 #218003

X-original-commit: 1b5b239
Signed-off-by: David Monjoie (dmo) <[email protected]>
Signed-off-by: Walid Sahli (wasa) <[email protected]>
…sons

Steps to reproduce:
- In the settings enable by-products
- Create a product FP with a bill of material:
	- 1 operation: op 1
	- 1 By-product line: cost share 3.3%, produced in op 1
- Create aand confirm an MO for 1 unit of FP
- On the by product line produce 10 instead of 1
- Produce All
> 19 units of by products were produced: The initial by-product move
> was validated for 10 units and an extra move with a quantity of 9
> was automatically created and validated aswell.

Cause of the issue:

Since the quantity of the by-product move exceed its initial demand, its
validation will create an extra move that is expected to be merge into
the main move during its confirmation:
https://github.com/odoo/odoo/blob/474ac02d03c17af0274422ecb1e97ca14a3e80e7/addons/stock/models/stock_move.py#L1922
https://github.com/odoo/odoo/blob/474ac02d03c17af0274422ecb1e97ca14a3e80e7/addons/stock/models/stock_move.py#L1844-L1865
However, while `cost_share` value of the original move floats is
correctly encoded as 3.3, the copied value of the extra is
3.3000000000000003. This discrepency is a well known issue of the way
the orm handles float and convert them to cache as it calls the
`float_round` method, which can effectively change its value:
https://github.com/odoo/odoo/blob/8c22e358840f02c5b1596e1fbe0d6cf7315754f7/odoo/fields.py#L1553-L1557
In particular, the `cost_share` of both moves differs in terms of strict
equality and the move will not be merged with its extra move.

Note:

The issue should not be reproducible in saas17.4+ because the
float_round issues have been erased by
commit 784f151

opw-4846289

closes #217786

X-original-commit: 9f8c364
Signed-off-by: Quentin Wolfs (quwo) <[email protected]>
Signed-off-by: Lancelot Semal (lase) <[email protected]>
closes #218025

Task: 4930419
X-original-commit: 22debd3
Signed-off-by: Lucas Lefèvre (lul) <[email protected]>
Problem:
When printing the stock report, table headers are not bold in the
generated PDF despite being styled that way in the HTML template.

Cause:
The bold styling is applied via CSS on the `thead` element, which
doesn't render properly in the PDF output.

Solution:
Use `<strong>` tags inside table headers to apply bold formatting,
as done in version 17.0. Also remove `font-weight` rules from CSS
for `thead` to avoid conflicts and ensure consistent output.

Steps to reproduce:
1. Go to Inventory > Inventory Overview.
2. Select any inventory record.
3. Print the report.
→ Table headers are not bold as expected, despite formatting.

opw-4840380

closes #218004

X-original-commit: c2600f5
Related: odoo/enterprise#89792
Signed-off-by: William Henrotin (whe) <[email protected]>
Signed-off-by: Walid Sahli (wasa) <[email protected]>
Otherwise, it causes it fails to assign value to certain records, which is unadvised.

closes #217783

X-original-commit: ce487c4
Signed-off-by: Nicolas Viseur (vin) <[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 #217894

X-original-commit: 2c2e86d
Signed-off-by: Laurent Smet (las) <[email protected]>
Signed-off-by: Antoine Dupuis (andu) <[email protected]>
Step to reproduce
1. Createdb with account and contact module install
   in 18.0 version.
2. create 2 company A and B
3. create partner with both company A and B seperate
4. create a user that have only rights of company B and rights
   of Accounting/setting groups
5. create a Bank account(Contact->Configuration->Bank Account)
   with partner A in company A
6. Now login with user B and create a bank account number with same
  account number. Access error will come.

For resolve the access error fetching the correct result according to
company so it won't fetch other company result the changes merged
last week
ad6c900#diff-22e97cf61c6826e67cd9a3276bdb292e997cb1117ca44c1749c69d5d01931787R69

```
Access Error

Uh-oh! Looks like you have stumbled upon some top-secret records.

Sorry, Test B (id=7) doesn't have 'read' access to:
- Contact, A (res.partner: 8)

Blame the following rules:
- res.partner company

If you really, really need access, perhaps you can win over your friendly administrator with a batch of freshly baked cookies.

This seems to be a multi-company issue, but you do not have access to the proper company to access the record anyhow.
```

upg-2986193
opw-4876839
tbg-2093

closes #217935

X-original-commit: 333fcb9
Signed-off-by: Ruben Gomes (rugo) <[email protected]>
Signed-off-by: Sanchit Gupta (sagu) <[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 #218005

X-original-commit: 2d486fb
Signed-off-by: William André (wan) <[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 #218027

X-original-commit: 85dde1d
Signed-off-by: Colin Louis (loco) <[email protected]>
Signed-off-by: Serhii Rubanskyi (seru) <[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 #218029

X-original-commit: 7c21830
Signed-off-by: Rémy Voet (ryv) <[email protected]>
Signed-off-by: Léo Gizard (legi) <[email protected]>
…rated

Currently, an error occurs when users print the E-Waybill without generating it.

Steps to replicate:
- Install `l10n_in_ewaybill` and switch to IN company.
- Change the `Zipcode` on IN company to `aa`.
- Go to `Invoicing > Customer > Invoices`.
- Create an invoice, confirm and click Send E-WayBill.
- Click on the Gear icon and Click on the report `Ewaybill`.

Error:
`ValueError: invalid literal for int() with base 10: ''
QWebException: Error while render the template
ValueError: invalid literal for int() with base 10: ''
Template: ir.ui.view(2614,)
Path: /t/t/t/t/div/t[3]
Node: <t t-if='doc.state in ewaybill_states'/>`

The error occurs because the report printing is available even when the
`E-Waybill` is not yet generated. This causes the execution flow to skip
all the necessary validations, leading to a `ValueError` at line [1].

[1] - https://github.com/odoo/odoo/blob/aa7dac87a3eebce1b300e1e3d04398d680325b5d/addons/l10n_in_ewaybill/models/l10n_in_ewaybill.py#L640

This commit solves this issue by adding a domain to the report, so that it
appears only after the EwayBill is generated.

sentry-6695761066

closes #215515

Signed-off-by: Ricardo Gomes Rodrigues (rigr) <[email protected]>
…data

In general, be defensive with activity types: avoid crash when activity
type has been removed, try to gracefully recover from non existing
data, protect types linked to business code that should not be unlinked
or changed from model.

Introduce a generic way to mark some activity types as master data
 * model is fixed and should not be modified, because it is linked
   to specific flows e.g. todo should be generic;
 * data should not be unlinked, because it is used in automated flows
   like plans, business code, ... and cannot easily be replaced;

Mail: make "Call", "Meeting" and "Todo" activity types master data users
cannot remove as they are required in various flows: fleet, plans,
voip, ... Also force their model to be False (aka be cross model).

Mail: make "Warning" and "Upload document" activity types in addition
to "Call" and "Todo", always cross model. As they are used in various
apps it should not be specific to a model.

Hr holidays: prevent from modifying leave activity types, as they are
used in business flows and in automated code.

Fleet: prevent from modifying contract activity type (same reason).

Task-3777606

X-original-commit: 10d1634
Part-of: #218001
Related: odoo/enterprise#89790
Signed-off-by: Thibault Delavallee (tde) <[email protected]>
When creating several activities linked to the same record you may
encouter a crash due to several followers being inserted for the
same record. Indeed everything is done at the same time and all
data is not already flushed.

It is actually better to uniquify list of records to subscribe, so that
subscription is done once / user.

Task-3777606

X-original-commit: 717ea8d
Part-of: #218001
Related: odoo/enterprise#89790
Signed-off-by: Thibault Delavallee (tde) <[email protected]>
When model does not match, raise a warning and fallback on default
activity type.

Task-3777606

X-original-commit: cd79b47
Part-of: #218001
Related: odoo/enterprise#89790
Signed-off-by: Thibault Delavallee (tde) <[email protected]>
Just make tests from 00f2a6a a bit clearer about
expected behavior when creating with default activities in context.

Task-3777606

X-original-commit: 8d544b1
Part-of: #218001
Related: odoo/enterprise#89790
Signed-off-by: Thibault Delavallee (tde) <[email protected]>
Current event creation tries to create activities. However code coming
from #72043 seems quite broken: it tries to find if the
target model accepts activities, but does not by browsing the wrong
model with wrong ids ... which globally turns off activity creation.

This fix rewrites a bit code creating activities when creating an event so
that
  * check activity support on the right model;
  * it uses the right model on activity type: otherwise you may end up with
    models that do not match between record and activity type;
  * remove useless (or wrong) code trying to browse 'model ids' on a given
    model;
  * we now correctly check for activity inheritance using 'is_mail_activity'
    field on IrModel;

Task-3777606

X-original-commit: 2d8d34e
Part-of: #218001
Related: odoo/enterprise#89790
Signed-off-by: Thibault Delavallee (tde) <[email protected]>
Avoid calling '_sync_activities' when activities are anyway created
directly from event itself.

Task-3777606

X-original-commit: 0b0d5de
Part-of: #218001
Related: odoo/enterprise#89790
Signed-off-by: Thibault Delavallee (tde) <[email protected]>
Master data protection
======================

In general, be defensive with activity types: avoid crash when activity
type has been removed, try to gracefully recover from non existing
data, protect types linked to business code that should not be unlinked
or changed from model.

Introduce a generic way to mark some activity types as master data
 * model is fixed and should not be modified, because it is linked
   to specific flows e.g. todo should be generic;
 * data should not be unlinked, because it is used in automated flows
   like plans, business code, ... and cannot easily be replaced;

Mail: make "Call", "Meeting" and "Todo" activity types master data users
cannot remove as they are required in various flows: fleet, plans,
voip, ... Also force their model to be False (aka be cross model).

Mail: make "Warning" and "Upload document" activity types in addition
to "Call" and "Todo", always cross model. As they are used in various
apps it should not be specific to a model.

Hr holidays: prevent from modifying leave activity types, as they are
used in business flows and in automated code.

Fleet: prevent from modifying contract activity type (same reason).

Account Online Synchornization: make "Bank Synchronization" master
data as business behavior dependso on it. Also fix model used for
the type.

Account reports: make "Tax Closing" master data as business flow
depends on it.

Approvals: make "Approval" master data as business flow depends on it
and it is not easy to remove it in their usage.

Hr Payroll: make "Leaves to defer" master data as business flow
depends on it.

Voip: make "Call" activity type master data users cannot remove as it
is required in various flows of VOIP. Also force its model to be False
as it is used in various models and should not suddenly be limited to
a given model. Done in community, as activity is defined in 'mail'.

Studio: make "Approval" master data as approval flow depends on it.

Calendar: fix activities creation
=========================

Current event creation tries to create activities. However code coming
from #72043 seems quite broken: it tries to find if the
target model accepts activities, but does not by browsing the wrong
model with wrong ids ... which globally turns off activity creation.

This fix rewrites a bit code creating activities when creating an event so
that
  * check activity support on the right model;
  * it uses the right model on activity type: otherwise you may end up with
    models that do not match between record and activity type;
  * remove useless (or wrong) code trying to browse 'model ids' on a given
    model;
  * we now correctly check for activity inheritance using 'is_mail_activity'
    field on IrModel;

Task-3777606

closes #218001

Forward-port-of: #217688
Forward-port-of: #156731
Related: odoo/enterprise#89790
Signed-off-by: Thibault Delavallee (tde) <[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 #217980

X-original-commit: 22c333d
Signed-off-by: Levi Siuzdak <[email protected]>
Currently, with an MTSO rule, the smart button from the Sale Order
to the Manufacturing Order was available. However, the reverse link
(from the MO to the SO) was missing.

But they share the same link between object and people don't
understand. So we copy the condition to have the same SO<->MO
link.

It was missing the sale_id on the procurement group itself. Before
production.procurement_group_id.move_dest_ids.group_id.sale_id
was enough since mtso share move links but with the new MTSO it's
not the case anymore. But the sale_id is copied from a procurement
to the new ones.

Steps to reproduce:
- Enable multi-step routes in Inventory settings
- Unarchive the MTO route:
    - Select the rule with the production usage
        - Set its supply method to "MTSO"
- Create a storable product “P1”:
    - routes: MTO + Manufacture
- Create and confirm a Sale Order with one unit of P1
- Confirm the SO

Problem:
The smart button from the SO to the MO appears correctly,
but the reverse link from the MO to the SO is missing.

opw-4619136
opw-4557138
opw-4875937
opw-4854581
opw-4887746

closes #217782

X-original-commit: 77159d4
Signed-off-by: Steve Van Essche <[email protected]>
Signed-off-by: Djamel Touati (otd) <[email protected]>
…move to sale_order

Step to reproduce:
- Enable Analytic accounting in Accounting settings
- Create a sale order
- Show Analytic Distribution
- Create an expense and put this sale order in the "Customer to Reinvoice" field.
- Add an Analytic Distribution
- Create Report
- Submit to Manager
- Approve
- Post Journal Entries

Curent behavior:
- No analytic_distribution on the sale_order

Expected behavior:
- analytic_distribution form the expense should be copied to the sale_order

Cause:
analytic_distribution wasn't set at the creation of the sale order from the account_move

closes #217692

X-original-commit: 1a7bd8e
Signed-off-by: Xavier Bol (xbo) <[email protected]>
Signed-off-by: Corentin Lombard (clom) <[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 #218026

Task: 4903713
X-original-commit: b5c291a
Signed-off-by: Pierre Rousseau (pro) <[email protected]>
Signed-off-by: Ronakkumar Mukeshbhai Bharadiya (rmbh) <[email protected]>
Before this commit, test "Add the same reaction twice from the emoji
picker" may fail non-deterministically in 18.1 on last step: the
message reaction is sometimes kept, sometimes removed.

The feature in 18.0 was keeping the emoji, whereas in 18.1 it now
toggles the add / remove of reaction. This change of behaviour felt
best with the addition of QuickReactionMenu, and for consistency this
also works that way in emoji picker of message reaction.

The test was not adapted but passed because the bus notifications
were coming later than the burst of user actions to add emoji, thus
there's flicker of showing message reaction at end when it's only
temporarily and would be removed a fraction of seconds later.

This commit fixes the test with the newer behaviour that it should
toggle the reaction.

Fixes runbot error 229340

closes #218160

Signed-off-by: Matthieu Stockbauer (tsm) <[email protected]>
Before this commit, the `website_livechat_chatbot_flow_tour` tour
was sometimes failing. The intent it to ensure the chat bot stops
until the user fully wrote his answer. The flow is the following:
- User sends a message (first part of his answer)
- User starts typing: the chat bot waits
- After some time, the user didn't finish his answer afterall, the
chat bot continues.

The chat bot uses the `_processAnswerDebounced` function to delay
the processing of the step. However, the tour relies on `setTimeout`,
expecting to come after the debounce delay. However, multiple
messages are sent, and the debounce delay is postponed. As a result,
the assertion is made too early, making the test fail.

This commit fixes the issue by awaiting a deferred, resolved when
the chat bot actually executes the debounced function.

fixes runbot-113948,227675

closes #218153

Signed-off-by: Alexandre Kühn (aku) <[email protected]>
Fix issue where minimum rights employee were able to put negative orderline qty in the cart with the `+/-` button

closes #217774

Task-id: 4922318
Related: odoo/enterprise#89669
Signed-off-by: Stéphane Vanmeerhaeghe (stva) <[email protected]>
As saas-18.1 does not pip/apt install packages on checkout, a built image could
not connect to a db in an upper version if new packages were required.

closes #218124

Signed-off-by: Louis Travaux (lotr) <[email protected]>
We renamed the "Disconnect from current" button to "Disconnect", and removed the
possibility to configure a new database if one is already configured.
This eases user experience, by reducing the amount of information on the screen.

closes #217706

Task: 4922634
Signed-off-by: Yaroslav Soroko (yaso) <[email protected]>
@bt-admin bt-admin merged commit 83d5569 into brain-tec:saas-18.1 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.