Skip to content

Syncing from upstream odoo/odoo (staging.saas-17.4) #32598

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

Open
wants to merge 430 commits into
base: staging.saas-17.4
Choose a base branch
from

Conversation

bt-admin
Copy link
Collaborator

@bt-admin bt-admin commented Apr 7, 2025

bt_gitbot

@robodoo robodoo force-pushed the staging.saas-17.4 branch 18 times, most recently from f0e95da to 891004d Compare April 14, 2025 08:51
@robodoo robodoo force-pushed the staging.saas-17.4 branch 11 times, most recently from fb51cdd to a3eb173 Compare April 17, 2025 02:06
@robodoo robodoo force-pushed the staging.saas-17.4 branch from 00333c3 to 29ba3a7 Compare May 20, 2025 05:52
JonathanStein and others added 2 commits May 20, 2025 07:22
closes #210640

X-original-commit: da7d56b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Versions
--------
- saas-17.4+

Steps
-----
1. Go to Website / Settings;
2. scroll to Shop - Checkout Process;
3. assign portal user as salesperson for online orders.

Issue
-----
Portal user shouldn't be allowed as a salesperson.

Cause
-----
The `salesperson_id` field of `res.config.settings` is set to be related
to `website_id.salesperson_id`. The `salesperson_id` field for `website`
does have a domain configured, but because the domain is a string, it
does not get re-used for related fields[^1].

[^1]: https://github.com/odoo/odoo/blob/87381d316/odoo/fields.py#L3009-L3021

Solution
--------
Provide the domain as a list.

opw-4801697

closes #210612

Signed-off-by: Levi Siuzdak <sile@odoo.com>
@robodoo robodoo force-pushed the staging.saas-17.4 branch from 29ba3a7 to 8c5341e Compare May 20, 2025 07:22
aab-odoo and others added 15 commits May 20, 2025 08:55
The usecase occurs in x2many lists in form views. The total width
of the table's parent div may change, for instance if a scrollbar
appears on the sheet at some point. When this happens, the widths
must be recomputed, to properly fit with the new available space.
Before this commit, we only listened to window resize, not to the
parent div itself.

This could lead to an horizontal scrollbar being sometimes
displayed, for instance:
 - with the chatter below the form view, as it is loaded
  asynchronously, when it contains messages such that there's no
  (vertical) scrollbar before it is loaded, and there's one after.
 - with the document previewer, as its width changes when it is
  loaded.

This commit fixes the issue by using a resize observer to listen
to the parent div directly, instead of on a window, which is more
accurate.

Bug reported by our cto

closes #210366

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
### Contains the following commits:

odoo/o-spreadsheet@fabd93141 [REL] 17.4.36 [Task: 0](https://www.odoo.com/odoo/2328/tasks/0)
odoo/o-spreadsheet@82ddf50a2 [FIX] pivot: `month` granularity sorting [Task: 4781810](https://www.odoo.com/odoo/2328/tasks/4781810)

closes #210731

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Co-authored-by: Anthony Hendrickx (anhe) <anhe@odoo.com>
Co-authored-by: Alexis Lacroix (laa) <laa@odoo.com>
Co-authored-by: Lucas Lefèvre (lul) <lul@odoo.com>
Co-authored-by: Dhrutik Patel (dhrp) <dhrp@odoo.com>
Co-authored-by: Adrien Minne (adrm) <adrm@odoo.com>
Co-authored-by: Mehdi Rachico (mera) <mera@odoo.com>
Co-authored-by: Florian Damhaut (flda) <flda@odoo.com>
Co-authored-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Pierre Rousseau (pro) <pro@odoo.com>
Co-authored-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Steps to reproduce:
- create a new journal with foreign currency
- create an invoice (amount:100)  with this journal and set it "to check"
- Go to dashboard

Issue:
check balance is in company currency amount but the symbol is the one from the currency of the journal

Solution:
~~Chkl: Misc and Sales/Purchase Journals should display all amounts in company currency≃~
Eventually, we decided that it would be better for the stable versions to keep the currency displayed as the one from the journals.
We therefore use the same logic as for the bill/invoices

opw-4349684

closes #208444

X-original-commit: a3da560
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
**Problem:**
when doing a refund from pos of an avco (or fifo) product, with the option
"ship later" the cost of the product does not appear on the pos order line

**Steps to reproduce:**
- Enable Settings "Allow Ship Later", "Automatic Accounting"
- Navigate to Sales/Configuration/Product Categories
- Create a new category with Inventory Valuation field as "Automated"
and the Costing Method field as "Average Cost (AVCO)"
- Open Point of Sale/Product
- Create a new storable product
- In the general information tab set a cost and select your new
category for the product category field
- In the Sales tab, make sure that "Available in POS" is checked
and select a category
- Set an on Hand quantity
- Open a point of sale from the Point of Sale Dashboard
- Select your product and click on Payment
- On the top right of the screen select a customer with an adress,
click on Invoice and on Ship later
- Select a payment method and validate
- Navigate to Point of Sale/Orders
- click on the last order created, and click on the "Pickings" smart button
- validate the picking
- come back to the store in point of sale
- select the three horizontal lines on the top right and click on Orders
- filter by paid orders
- select the last order created and click on refund and then on payment
- check Invoice and Ship Later on the top right, select a payment method and validate
- Navigate back to Point of Sale/orders and select the last order created

**Current behavior:**
 The total cost is zero on the pos order line
 Even if the delivery is validated via the Picking smart button
 the total cost is still zero

**Expected behavior:**
 It should reflect the cost of the product (depending on the costing method)

**Cause of the issue:**

When the pos order is created from Point of Sale, the process_saved_order method is called
this method calls (1)create_order_picking and then (2)compute_total_cost.
https://github.com/odoo/odoo/blob/504ef7cdeb1600b86feefbe8668144da9cd5a70b/addons/point_of_sale/models/pos_order.py#L183-L184

**Scenario A** Inside (1) create_order_picking, if the PosOrder doesn't have
a shipping_date the if statement is False
https://github.com/odoo/odoo/blob/504ef7cdeb1600b86feefbe8668144da9cd5a70b/addons/point_of_sale/models/pos_order.py#L1017
and the method _create_picking_from_pos_order_lines is called.
This method then calls _action_done.
https://github.com/odoo/odoo/blob/504ef7cdeb1600b86feefbe8668144da9cd5a70b/addons/point_of_sale/models/stock_picking.py#L70
Inside the stock_account override of _action_done, _create_in_svl is called.
https://github.com/odoo/odoo/blob/504ef7cdeb1600b86feefbe8668144da9cd5a70b/addons/stock_account/models/stock_move.py#L289
This method sets the value of the stock_valuation_layer_ids attribute
of the stock move to a new stock valuation layer.

**Scenario B** Inside (1) create_order_picking, if the PosOrder has a
shipping_date (in the case where we selected "Ship Later") the
method _launch_stock_rule_from_pos_order_lines is called.
https://github.com/odoo/odoo/blob/504ef7cdeb1600b86feefbe8668144da9cd5a70b/addons/point_of_sale/models/pos_order.py#L1017-L1018
and nowhere inside this method is _action_done called.
This makes sense because the stock move hasn't been validated.

When (2) compute_total_cost is then called by process_saved_oder, if the product category is avco, _compute_average_price will be called.
If we are in Scenario B there is no stock valuation layer for this stock move.
Consequently there will be no candidates and the price will not be computed.
https://github.com/odoo/odoo/blob/504ef7cdeb1600b86feefbe8668144da9cd5a70b/addons/stock_account/models/product.py#L795-L798

opw-4614503

closes #210459

X-original-commit: 89361ba
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
Signed-off-by: Pierre-Louis Hance (plha) <plha@odoo.com>
Steps to reproduce:
	1. Create a portal user.
	2. Create an automation rule to send an email as a message.
	Example:
	https://drive.google.com/file/d/1mIa4R7a2Z2fnkngOMD7zN2t9Z2XHhGY7/view
	3. Now, add the portal user as a follower on a task.
	4. Change the state of a task to execute an automation rule.
	5. Email will be received by a portal user but it will not be visible on the messaging history on the portal.

Cause:
This is happening because when running an automation rule that will send
an email we set the 'mail.message' state as System notification by default
which leads that this mail will be sent normally to every follower of the
record but will be only shown in the chat history for internal users not portal
as we are just showing 'comment', 'incoming_email' and 'outgoing_email' messages.

Fix:
Checking if the server action that is being run is sending an email we will
set the state of the 'mail.message' as 'auto_comment' and add 'auto_comment'
to the domain of the field website_message_id which is for the messages
shown to the portal user in his view

opw-4459754

closes #210807

X-original-commit: 02201f1
Related: odoo/enterprise#85969
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Youssef Bashandy (yoba) <yoba@odoo.com>
Steps to reproduce:
	- Navigate to Recruitment > Job Position > Any job position > Job applications (smart button)
	- Create an applicant
	- Set a recruiter for the application
	- Move the stage to 'Contract Signed'
	- Click on 'Create Employee'
	- Notice a validation error that the opertion cannot be completed

Cause:
This is happening as the 'Job applications' smart button has default value
for the user_id in context

https://github.com/odoo/odoo/blob/889f25f1322f00dff7cacad95236d6f045c30d64/addons/hr_recruitment/views/hr_job_views.xml#L207-L211

so when creating an employee it will add the missing fields from defaults
and it will get the default value in the context which for an existing
user so when creating the employee with this user_id it will trigger
the sql constraint

https://github.com/odoo/odoo/blob/889f25f1322f00dff7cacad95236d6f045c30d64/addons/hr/models/hr_employee.py#L145-L148

Fix:
clean the context before creating the partner and the employee corresponding
to this applicant

opw-4629219

closes #210806

X-original-commit: 434139c
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
Signed-off-by: Youssef Bashandy (yoba) <yoba@odoo.com>
Currently, the `Invoice report` is hidden when the user tries to select
the invoice report for 'account.move'.

With PR [1], we added the invisible attribute to the `is_invoice_report` field
to hide it when the model is not 'account.move'. However, due to mistake, we
used `'model'` instead of `model`, which caused the field to always be hidden.

This commit fixes the above issue by using `model` instead of `'model'`, so
the is_invoice_report field is visible only when the model is 'account.move'.

[1] #207635

closes #210832

Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
--
Issue:

When converting a lead to an opportunity, a wizard
(`crm.lead2opportunity.partner`) is shown. This allows merging
duplicated leads.

However, if the most recently created lead is selected as the primary,
the wizard record may be deleted unexpectedly. This usually goes
unnoticed in the UI, as the wizard disappears after the operation.

The issue becomes critical when overriding the conversion flow via a
custom module or in future changes to the core logic. In those cases,
the deletion of the wizard can lead to empty recordsets and errors.

--
Affected versions: 16.0 and later.

--
Explanation:

The `crm.lead2opportunity.partner` model has a `Many2one` field
`lead_id` that is being deleting on cascade which is the default
for m2o fields on transient models.

During lead conversion, action_apply() calls _action_merge() or
_action_convert(). In _action_merge(), non-primary leads are
unlinked. If the primary lead is the last created one, it differs
from the one referenced by the wizard. This causes lead_id to be
unset, triggering the cascade and deleting the wizard.

--
Impact:

If a custom module overrides action_apply() or _action_merge() and
calls super() first, it may operate on an empty recordset, leading
to failures when trying to access data or call methods.

--
To reproduce:

With debugger:

- Set a breakpoint on the unlink call inside _action_merge
- After unlink, calling self.exists() on the wizard will return
an empty recordset

With a custom module:

- Override action_apply() or _action_merge()
- Call super() first
- Try to merge leads and select the most recent one as primary
- The wizard record will be deleted before your custom logic executes,
and will raise a "Record does not exist or has been deleted."

closes #210916

X-original-commit: 5e192ba
Signed-off-by: Jérémy Hennecart (jeh) <jeh@odoo.com>
Signed-off-by: Victor Miguel Armenta Carrillo (vmac) <vmac@odoo.com>
…onfirmation

Steps to reproduce:
- Create a quotation in the Sales app.
- Apply a coupon with any discount.
- Modify the description of the discount SO line.
- Confirm the sale order.
- The discount line's description is reset.

Root Cause:
- `_get_reward_values_discount` recomputes discount line values, resetting the
  description.

Fix:
- Preserve the manually set name field to prevent unintended recomputation.

Affected versions: 17.0
opw-4653070

closes #210774

X-original-commit: e97f3ae
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
Signed-off-by: Nisarg Patel (nipl) <nipl@odoo.com>
Steps to reproduce:
1. Go to the blog page.
2. Enable the sidebar.
3. Select any category (e.g., Travel).
   - A subscribe button appears in the 'Follow Us' section.

Expected Behavior:
The input field should be visible whether the user is logged in or not.

Current Behavior:
Currently, the input field is only shown to public users. This happens
because the input element is restricted by the `base.groups_public`
group in the XML code.

Fix:
Since this is an XML change in v17.0 (stable version), we need to
implement the fix in JS instead. After that, we will adapt the code
from the master branch.

task-4546888

Part-of: #210641
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Steps to reproduce:
1. Have a blog post in a category (e.g., Astronomy) published in
   Feb-2025.
2. In another category (e.g., Travel), have blog posts in both Jan-2025
   and Feb-2025.
3. When selecting the Astronomy category, the sidebar `Archives` filter
   shows all months, even if no blog post exists in Jan 2025.

Expected behavior:
The archives dropdown should only display months that have blog posts
in the selected category.

This commit removes unnecessary months from the Archives dropdown. It
will now show only months that have blog posts for the selected
category.

task-4546888

closes #210641

Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Problem:
In `getAdjacentCharacter`, accessing `focusNode.textContent[focusOffset - 1]`
directly fails when there are child nodes between text nodes.

Example:
Given `<p>ab<span>\u0009</span>\u200B[]</p>`:
- `focusNode.childNodes` → [text("ab"), span, text("\u200B")]
- `focusNode.textContent` → ["a", "b", "/TAB/", "/ZWS/"]
- `focusOffset` → 3 (nodes offset not text offset)
- Accessing `focusNode.textContent[2]` is wrong because `focusOffset`
  counts nodes, not characters, it should return `/ZWS/` not `/TAB/`.

Solution:
Align with 18.0+ behavior by calling `getDeepestPosition(focusNode, focusOffset)`
inside `getAdjacentCharacter`.

Steps to reproduce:
1. Type `ab`
2. Press `Tab`
3. Press `Arrow Left`
→ Caret does not move left as expected.

opw-4720904

closes #209568

X-original-commit: d5cb6fa
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Walid Sahli (wasa) <wasa@odoo.com>
Before this commit, the interval and priority field in ir.cron were
aggregated when a group by operation was applied by getting
summed up. However, we do not get any useful information from
the sum of priorities so this so this commit removes it. It also partly
addresses an issue where the Scheduled Actions list view would
clip the grouped field's label when displaying the aggregated sum
of priorities as the first column.

opw-4536133

closes #209786

X-original-commit: 4da3317
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
…or Mobile

Steps to Reproduce:
1. Install Sales module
2. Create a new quotation in mobile view

Issue:
- The input field of contact is displayed twice due to a missing `t-else`
  condition, causing both fields to appear simultaneously.

Solution:
- Added the missing `t-else` condition to ensure that only one input field is
  displayed as intended.

opw-4767186

closes #210909

X-original-commit: c032778
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
Signed-off-by: Dhwani Patel (dwa) <dwa@odoo.com>
@robodoo robodoo force-pushed the staging.saas-17.4 branch from 6d4040d to 3b609d8 Compare May 21, 2025 07:51
arpr-odoo and others added 8 commits May 21, 2025 09:14
In this commit, we have addressed a crucial issue related to
translation. We discovered that certain key
terms in our application were not properly marked for
translation, resulting in a lack of support for different
languages. To rectify this, we have implemented the necessary
changes to make these terms translatable. By doing so, we have
successfully resolved the language compatibility problem and
improved the overall internationalization of our application.
This commit ensures that all terms, previously overlooked or
untranslatable, are now fully accessible for translation,
enhancing the localization experience for our users across the globe.

task:3358438

closes #210805

X-original-commit: ea44a8c
Related: odoo/enterprise#85968
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
…er language

closes #210927

X-original-commit: 659ca7b
Signed-off-by: Khushi Srivastava (khsr) <khsr@odoo.com>
Default code 'OO99999999999' should only be used if no VAT number
is present.

task-4724520

closes #210942

X-original-commit: 7e2a3f7
Signed-off-by: Thomas Becquevort (thbe) <thbe@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
The failing step is creating a new website, which could take a long
time. Increasing the timeout for the next step should prevent the error.

runbot-error-104332

closes #210935

X-original-commit: 247a1cd
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
Run any test of the `TestAnalyticAccount` class in single app: analytic.
> Error in the single app setup.

Cause of the issue:

Since neither `account.account` nor the `hr_timesheet` is installed,
these lines will crash:https://github.com/odoo/odoo/blob/786cc72a58079dd87f536cedf5c8b9098ff2b885/addons/analytic/tests/test_analytic_account.py#L76-L78
because `core_group_ids` is cls.env['ir.rule'] and
`cls.env.user.groups_id` is a `res.groups` record set.

runbot-223137 and 223138

closes #210847

X-original-commit: 5e4d321
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
closes #210908

X-original-commit: 77b59ab
Related: odoo/enterprise#86019
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
Doing asynchronous things in the onWillStart can be tricky.
Methods that come from services are usually protected against those, and hang up
if the component was destroyed during the call, but other calls aren't protected.

This commit fixes a race condition where a protected call is done after a component is destroyed and crashes.

runbot-error-135245

closes #211009

X-original-commit: bfaa23d
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Steps to Reproduce :

- Drag and drop text snippet / or select some text.
- Apply the back-ground color to the text.
- Click on the Animate button.
- You will notice that the background got removed/misplaced.

The issue was caused because the animated text is wrapped in an element
with "display: inline-block". To fix the bug, we moved the element with
the background color inside the wrapper of the animated text, instead of
keeping it outside.

This fix works as long as the animated text is exactly the same as the
one with the background color. If only a portion of the text with a
background color is animated, the fix doesn’t work. That case was too
complex to handle, and in any case, the most common user scenarios are
now fixed.

task-4690318

closes #210953

X-original-commit: d6f0f07
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
@robodoo robodoo deleted the branch brain-tec:staging.saas-17.4 May 21, 2025 13:22
@robodoo robodoo deleted the staging.saas-17.4 branch May 21, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment