Skip to content

Syncing from upstream odoo/odoo (tmp.18.0) #34197

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 25 commits into from
Jul 9, 2025
Merged

Conversation

bt-admin
Copy link
Collaborator

@bt-admin bt-admin commented Jul 9, 2025

bt_gitbot

antoine162 and others added 25 commits July 8, 2025 08:05
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 #217731

Signed-off-by: Laurent Smet (las) <[email protected]>
Before this commit:

1. Create an expense paid by company
2. Create an empty expense report (not through the expense form view)
3. Add the expense to the report (Updates the payment_method and
   payment_method_line_id but not the journal_id)
4. Try to move forward to create the move
5. Error (The selected payment method is not available for this
   payment, please select the payment method again.)

After this commit:

The right journal_id is set when adding an expense to an empty
expense report.

task-4804970

closes #217815

X-original-commit: 7a93e28
Signed-off-by: Julien Alardot (jual) <[email protected]>
Signed-off-by: Léo Leclerc (leol) <[email protected]>
This PR adds the detection of different error states of the Mettler
Toledo 8217 protocol.
When the scale is in an error state we need to make sure that the PoS
user doesn't get any wrong scale data sent to the PoS.

closes #217674

Related: odoo/enterprise#89602
Signed-off-by: Max Whale (mawh) <[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 #217042

Signed-off-by: Ruben Gomes (rugo) <[email protected]>
Before this commit:

- Visually empty <div> elements could be inserted during paste.
- These empty blocks created invisible spacing in the editor.
- External styles inside pasted <div> elements were not removed.
- The placeholder (`Type '/' for commands`) could not render correctly
  in those areas.

This regression was introduced in commit `#196481`, which stopped replacing
blacklisted tags like <div> with <p>. As a result, cleanForPaste no longer
stripped inline styles from <div> elements.

After this commit:

- Non-empty <div> elements are now replaced with a valid baseContainer element.
- Empty <div> elements are automatically removed from pasted content.
- This restores the expected cleaning behavior and removes unwanted styles.

task-4805536

closes #210797

Signed-off-by: David Monjoie (dmo) <[email protected]>
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 #217889

Signed-off-by: Quentin Wolfs (quwo) <[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: #217688
Related: odoo/enterprise#89613
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: #217688
Related: odoo/enterprise#89613
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: #217688
Related: odoo/enterprise#89613
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: #217688
Related: odoo/enterprise#89613
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: #217688
Related: odoo/enterprise#89613
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: #217688
Related: odoo/enterprise#89613
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 #217688

Forward-port-of: #156731
Related: odoo/enterprise#89613
Signed-off-by: Thibault Delavallee (tde) <[email protected]>
Since PR #204507, the move name is reset whenever a payment
with a `move_id` is modified, which was intended to allow
changing the journal. However, this also resets the journal
entry name unnecessarily when unrelated fields (e.g. amount)
are updated.

This causes confusion for users, especially when the payment
is re-posted and a new sequence is generated, leading to gaps
in the journal entry numbering without any apparent reason.

This fix ensures the journal entry name is only reset when
the `journal_id` field is updated.

Steps to reproduce:
1. Create a payment and post it
2. Reset it to draft
3. Change the amount
4. Check the journal entry name → it is reset to '/'
4. Repost the payment, and a new sequence is generated

opw-4886466

closes #216214

Signed-off-by: Paolo Gatti (pgi) <[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 #215401

Signed-off-by: David Monjoie (dmo) <[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 #214545

Related: odoo/enterprise#87852
Signed-off-by: William Henrotin (whe) <[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 #214308

Signed-off-by: William André (wan) <[email protected]>
closes #217908

Task: 4930419
Signed-off-by: Lucas Lefèvre (lul) <[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 #217905

Task: 4903713
X-original-commit: 1d9ef67
Signed-off-by: Pierre Rousseau (pro) <[email protected]>
Signed-off-by: Ronakkumar Mukeshbhai Bharadiya (rmbh) <[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 #215377

Signed-off-by: Colin Louis (loco) <[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 #213634

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

Signed-off-by: Rémy Voet (ryv) <[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 #199020

Signed-off-by: William André (wan) <[email protected]>
In this commit, we change the login page step by a step with isActive
property. So this step is only active when the input#login is not on
the page and then expectUnloadPage will be only listen when this step
is active.

closes #217972

Signed-off-by: Mathieu Duckerts-Antoine (dam) <[email protected]>
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 #217864

X-original-commit: b87c896
Signed-off-by: Nicolas Viseur (vin) <[email protected]>
@bt-admin bt-admin merged commit c31a5b7 into brain-tec:tmp.18.0 Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.