Commit Graph
161789 Commits
Author SHA1 Message Date
tsm-odoo 0e30e15ff1 [FIX] im_livechat: font face set not iterable
This commit fixes a traceback that occurs on the frontend
on firefox only. The issue is that the `FontFaceSet.values()`
return value is considered as non iterable while it is an iterator.

This commit solves this issue by using directly `document.fonts`
which is considered an iterator even by firefox.

closes odoo/odoo#123672

See: https://bugzilla.mozilla.org/show_bug.cgi?id=1780657
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-05 16:17:00 +02:00
Olivier Dony 3db7956b4c [IMP] assets: switch to optimized rjsmin minification
The C implementation of the JS minification gives speedups between 6
and 55 times faster than the regex-based Python port, depending on
how compressed the input it (which is what our default implementation
does).

This is measurable when generating compiled assets bundle from scratch,
e.g. after installing/updating modules or source code.

As an illustration, the minification of a 2MB JS bundle can be 50x
faster:

```py
import rjsmin
from odoo.addons.base.models.assetsbundle import rjsmin as rjsm
js_source = open("web.assets_common_lazy.js").read() # 2MB JS
%timeit rjsm(js_source)
 # -> 339 ms ± 495 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit rjsmin.jsmin(js_source)
 # -> 6.88 ms ± 213 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
```

It's also a drop-in replacement, as long as you rjsmin 1.1.0 or better
is available (to support format strings properly, a.o.).

See also the documentation of rjsmin: http://opensource.perlig.de/rjsmin/

closes odoo/odoo#104283

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-06-05 16:16:57 +02:00
Benoit Socias f6814d9c6e [IMP] website: add test about website-specific assets
The build does not break if the `with_context(active_test=False)` is
removed from `ir.asset`'s `_get_related_assets`. This access to inactive
assets is actually needed to be able to disable assets on a specific
website, similarly to what is done for `ir.ui.view`.

This commit adds a test to ensures that this feature is not accidentally
lost.

task-3326887

closes odoo/odoo#123662

X-original-commit: fced70f840c98e29675ff41812e76c1883d1d57f
Signed-off-by: Dieleman Guillaume (gdi) <gdi@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-06-05 14:50:25 +02:00
Benoit Socias 3c2ee4bb6a [FIX] website: close HTML/CSS editor when leaving website preview
When leaving the `website` application, the HTML/CSS editor keeps its
open/closed state. Because of this, when returning to the website
preview, the HTML/CSS editor is being mounted immediately if it was
left opened when leaving the `website` application.

This commit closes the HTML/CSS editor upon leaving the website
preview, or navigating to another page.

Steps to reproduce:
- Open HTML/CSS editor.
- Go to the Discuss application.
- Go to the Website application.

=> Error dialog was displayed.

task-3302981

closes odoo/odoo#123661

X-original-commit: 45fd54f15689e2a749666059f9d2b99aa80f6c88
Signed-off-by: Bojabza Soukéina (sobo) <sobo@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-06-05 14:50:23 +02:00
niyasraphy 086dcefbc8 [FIX] google_gmail, microsoft_outlook : move UserError to ir_mail_server
The orginal PR and it's forward ports https://github.com/odoo/odoo/pull/121048
intorduced an unexpected AttributeError when using OAuth for incoming
mail servers (fetchmail.server). Since `smtp_user` is not a defined field
in fetchmail.server (it uses the field `user` instead), we had to change
the approach.

To prevent this error, we move the UserError call into the respective
ir_mail_server models, which should check the contrains at that level.
This means that before the form gets saved, trying to connect using an
OAuth account, should prompt the user to first specify an smtp_user before
proceeding.

X-original-commit: fcfd72a5e5663fa6b08c80a8a22ec15c8a09456f
Original author: niyasraphy <niyasraphyk@gmail.com>
Conflict resolution for saas-15.2, 16.0, saas-16.2, saas-16.3

closes odoo/odoo#123660

X-original-commit: b0749e430847d2f49e07b119915e8dee0c4e7f00
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-06-05 14:50:20 +02:00
Romain Derie 755ab30619 [FIX] website: prevent traceback when iframe has no src
Commit [1] introduced an cleaning of the iframefallback on page unload,
which was removing the `autoplay` attribute of the iframe `src` URL.
It was done to prevent video/music to keep playing in the invisible
iframe.
The fix was not generic and purposely targetted the elements which we
identified as problematic.

Commit [2] then made that cleaning generic, catching all iframe.
Doing so, it was actually catching too many iframes and led to traceback
on iframe not having a set `src`.
This is the case for every database having a configured reCaptcha, among
other things.
For reCaptcha, it's because it's adding the following iframe dynamically
through their third party script:
`<iframe style="display: none;"></iframe>`

This commit ensures we only target iframe having an URL attribute being
set to something.

Step to reproduce (with reCaptcha):
- Enable and configure reCaptcha
- Go to /contactus
- Leave the iframe page, eg click on "Contactus" menu to refresh it
-> Traceback

[1]: https://github.com/odoo/odoo/commit/ad78585cd514f5ff16647572d34937c18a112529
[2]: https://github.com/odoo/odoo/commit/6be8af36726d750065972e122e8f4a0aa0f56a17

opw-3343450

closes odoo/odoo#123621

X-original-commit: 463d4ee0c8000f948463772b7c96c8d111bcbc8e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-06-05 14:50:13 +02:00
Khushi Vakil 304af5b844 [FIX] l10n_in_edi_ewaybill: nil rated outside a state
Before this commit:
1.Create an Invoice in the demo company "E-Waybill Company" outside of the
  state (state other than set in the company)
2.Set the tax as nil rated and send e-way bill
E-Way Bill will not send.
Error message:
 [236]Tax rates for Inter state transaction is blank

After this commit:
E-Way Bill can be sent with nil rated tax for demo company 'E-Waybill Company'
outside of the state(state other than set in the company) 
task id:3304875

closes odoo/odoo#123616

X-original-commit: 2dc0bd3c7415e55c77c83f98e4c7088e0eaf82fc
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-06-05 14:50:11 +02:00
Chrysanthe (chgo) d0940ae7d0 [FIX] web: revamp superuser navbar
This commit introduces a revamp of the superuser navbar. The element
was using some unnecessary styling that could be removed.

Instead of using a gradient as background, we now use a transparent box
with a gradient as border.

task-3337789
part of task-332626

closes odoo/odoo#123613

X-original-commit: 98183ae2e9e3207a64f6438edf1027b6a708dbdd
Related: odoo/enterprise#41916
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-05 14:50:05 +02:00
Abdelouahab (abla) d10a40b14d [FIX] fields: read unstored one2many field without search function
> The bug is not present in 16.2+, but we keep the test

To Reproduce:
=============

- on a contact add a one2many field using studio
- in related field choose a field that is not stored and doesn't have a search function implemented
- close studio and notice all the lines of the selected field are listed on the contact even if are not linked to it

Problem:
========
- when searching a field that is not stored and doesn't have a search function, all the lines are returned

Solution:
=========
in this usecase filter the returned lines and only keep the ones linked to the record

opw-3265982

closes odoo/odoo#123563

X-original-commit: 7b29e9dff1d5ef97c5fb2a2ae0709bb21fd3fa3a
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2023-06-05 14:50:03 +02:00
Alexandre Kühn f85a4366b0 [FIX] mail: away im status should be yellow in discuss sidebar
Follow-up of https://github.com/odoo/odoo/pull/123143

This is the same fix applied to discus sidebar, which used another
component that had the exact same issue.

This omission comes from code duplication as a consequence of
added technical debt during a recent refactoring of Discuss code.

We will avoid making this mistake again in master, by cleaning and
properly sharing code for all showing of im status in Discuss.

closes odoo/odoo#123526

X-original-commit: 576e3caa50f6e23525b49fc3790ab29647903ed1
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-05 14:49:57 +02:00
Alexandre Kühn cd4e453c01 [FIX] mail: fully show message action list in chat window
Before this commit, squashed messages in chat window had part of
the action list being cut by the message above.

This comes from `overflow-auto` on the message content, which was
defined to make content shrink, but had the unintended side-effect
of cutting the message action list for squashed messages in chat
window.

This commit fixes the solution by using `min-width: 0;` instead to
shrink flex item to lower of content width. This style-rule works
like setting `overflow-auto` without actually affecting overflow.

X-original-commit: 3e4b32361ade567d8d4fde37f0ed2542a3e2e215
Part-of: odoo/odoo#123526
2023-06-05 14:49:57 +02:00
Benoit Socias 5c80b66d0e [FIX] website_payment: adjust size of donation's custom amount button
With some fonts (e.g. Roboto), the placeholder inside the "Custom
Amount" button of the Donation snippet does not fit within the button.

This commit adjusts the maximum width of the button to make it fit
according to the used font and the placeholder text.
The width has to be set from JavaScript because the same issue
arises with different length of translations of the placeholder.

Steps to reproduce:
- Drop a Donation snippet.
- Increase the button text size (change button font, change large
button font size...)

=> Text is not fully drawn inside custom button.

opw-3283549

closes odoo/odoo#123443

X-original-commit: 1ff46591fb8a28d747ea89e711849c079d993ab6
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-06-05 14:49:48 +02:00
Touati Djamel (otd) a1213accd6 [FIX] mrp_subcontracting: fix traceback in bom overview
Steps to reproduce the bug:
- Enable subcontracting in mrp settings
- Create a storable product:
    - add “azure interior “ as supplier
    - Create a BoM:
        - Type: subcontracting
        - subcontractor: azure interior
        - save
- Click on BoM overview

Problem:
Traceback is triggered: “OwlError: Invalid props for component
'BomOverviewSpecialLine': 'precision' is missing (should be a number)”

opw-3321346

closes odoo/odoo#123435

X-original-commit: 60eca5439e72786bb0e913d7ac643697376205c9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-06-05 14:49:46 +02:00
Mahdi cheikh rouhou (macr) 45387e5974 [FIX] website_slides : hide email share without template
When the channel share template isn't set , trying to share the course on the website via email will result in error.

Steps to reproduce the error:
1- Activate developer mode
2- Create a new course Test
3- Leavy Channel share Template  empty
4- Go to website via smart button
5- Click share and enter an email and send email
6- You will get an error

The error was happening because there was no check if the object has an
email template available

opw-3266197

closes odoo/odoo#123412

X-original-commit: c8e1bef559c64d6087492f05214606be7e48ef12
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2023-06-05 14:49:43 +02:00
Ahmed Khalaf f8cb7d15ef [FIX] stock: delivery address in picking reports
Before this commit, when printing a The picking operation or delivery slip
reports for outgoing transfers, both the delivery and customer address are displayed
showing the same address.

The expected behavior is to have customer address only of there is a commercial
partner behind the delivery address, thus the customer address is hidden
if its not the case.

opw-3289441

closes odoo/odoo#123365

X-original-commit: 5802295f3935648c4f2c5f9a45f223dcb1f7a7b8
Signed-off-by: Ahmed Khalaf (ahkh) <ahkh@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-05 14:49:40 +02:00
Mathieu Duckerts-Antoine d2637f617d [IMP] web: search model: merge =, in values in facet descriptions
A domain of the form ["|", ("foo", "=", "a"), ("foo", "in", ["b", "c"])]
created via the domain selector will be presented in the search bar as
"Foo in ( a , b , c )". That is we make the fusion of some
conditions and use parenthesis and commas to separate the values in order
to get shorter facet descriptions.

closes odoo/odoo#123352

X-original-commit: 3d2580db3225382ab745250b28845f6cb95cbd27
Related: odoo/enterprise#41814
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-06-05 13:31:48 +02:00
Mathieu Duckerts-Antoine 1d77694b95 [IMP] web: domain selector: add a 'New Rule' button
In edit mode, we add a 'New Rule' button at the bottom of the domain
selector to make easier to add a new condition.

X-original-commit: 2e761f8965909e4b11d3319c48bd5416c414961f
Part-of: odoo/odoo#123352
2023-06-05 13:31:48 +02:00
Mathieu Duckerts-Antoine 2860156adf [FIX] web: domain selector: always show connectors
When a domain with a single condition is displayed in a domain selector,
the implicit connector "&" or "|" is not displayed. This makes the
operation 'Add node' less obvious in that case since it is not known how
the new condition will be combined with the others.
Here we always display the connector to solve that problem.
As a by-product, we get another problem solved: a domain of the form
["!", ("foo", "=", "abc")] was incorrectly displayed.

X-original-commit: bd57f20980734641ce405bd34d8b17dc780adb17
Part-of: odoo/odoo#123352
2023-06-05 13:31:48 +02:00
Mathieu Duckerts-Antoine 606bc349e9 [FIX] web: search model: remove quotes in facet description
When a new search bar facet is created via the domain selector dialog,
quotes are sometimes put around some parts of its description, e.g.
Country = "Belgium". We make the facet description more readable by
removing those quotes.

X-original-commit: 2c12980e129acf9ffe5e1e474d3dee6abb7adfe4
Part-of: odoo/odoo#123352
2023-06-05 13:31:48 +02:00
JF Aubert 1bd1b5018b [FIX] purchase_requisition: make report translatable
Allow printing of the purchase requisition in the vendor's language.

closes odoo/odoo#123256

Opw: 3277229
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-05 13:31:43 +02:00
vlst e69dbd3203 [FIX] point_of_sale: fix improperly formatted value
Currently, the `Counted` value in the closing popup is improperly formatted.

Steps to reproduce:
1. Open a new session and create an order';
2. Pay 5.06 dollars with `Bank` and the rest with `Cash`;
3. Close the session;
4. Observe the value `5.0600000000000005` instead of the expected `5.06` in the `Counted` field for the `Bank Payment Method`

This PR addresses the issue by correctly formatting the value.

closes odoo/odoo#123234

Taskid: #3332861
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-06-05 13:31:40 +02:00
Sébastien Theys 04bdf6dc5a [FIX] mail: restore public discuss display on small screen
All features are not working as intended (examples: side panels should
be full screen instead of on the right, missing user rename/avatar
change) but at least something is shown with this commit.

closes odoo/odoo#123030

X-original-commit: 35a87c21230613852e1536eb0d717ad3f5753b5e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-05 13:31:38 +02:00
Pulinckx Pierre (PIPU) f2a8e6bd51 [REF] web: Remove underscore.js
Underscore.js has been removed from legacy qweb engine
and from web manifest.py
range and uniqueId functions has been added to qweb
engine to replace usages of them in xml templates.
Underscore usages has been remove from xml templates.
taskId : 3246238

closes odoo/odoo#123018

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-06-05 13:31:35 +02:00
Bruno Boi 4e3f84f394 [FIX] web: correct small KanbanConfigMenu position
**Before this commit**
Since afbdce664 the kanban group's config menu is not contained
into its kanban-group element but in the kanban-header element.

This lead to a wrong placement when the dropdown only has one item.

As this case is rare, it had not been noticed.

**To reproduce**
Steps:
- Install project_enterprise app.
- Share an editable project with Joel Willis
- Make sure in the project's settings than its visibility
is set to public (selection value: 'portal')
- Log in as portal user
- Access http://your-odoo-db/my/projects/1
- Open a kanban group's config dropdown menu.

Issue:
- If it has only one item to display, it will be placed on the left of
  its toggler instead of the bottom.

**After this commit**
It is now contained with the same element as originally intended.
The menu is now properly placed in the bottom.

**Note**
Not tested as this was (and still is) a workaround for
a stacking context issue.
The core Dropdown component is being refactored and
its "container" prop will become useless:
meaning this piece of code will disappear.

task-3293310

closes odoo/odoo#122944

X-original-commit: 1de541db9c6b02830615f078d4d44fd785146d35
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-06-05 13:31:32 +02:00
Bruno Boi 4034e5909b [FIX] web: ignore iframe offset for some poppers
Since d6afa9f usePosition hook allows to position
elements (a.k.a. poppers):
- that are outside of an iframe
- that target an element within an iframe

But there are also use cases where the popper is
within the same iframe than its target.
Therefore, in those cases, we should not offset the position
with the iframe box values.

**Before this commit**
The positioning hook always offsets the position if the target
is within an iframe.

**After this commit**
The positioning hook will offsets the position with the target's iframe
(if there is one, obviously) ONLY if the popper is within another
document.

**Observable use-case (steps to reproduce)**
Steps:
    - Install project_enterprise app.
    - Share an editable project with Joel Willis
    - Make sure in the project's settings than its visibility
      is set to public (selection value: 'portal')
    - Log in as portal user
    - Access http://your-odoo-db/my/projects/1
    - Click on search bar.

Issue:
    - The search dropdown is far away from its input.

task-3293310

X-original-commit: 208a1277750d63eef31079935e041730bc7204d5
Part-of: odoo/odoo#122944
2023-06-05 13:31:32 +02:00
Khushi Vakil 4e7f4bad71 [FIX] stock_account: prevent AttributeError on clicking valuation button
Steps to reproduce
==================
- Create purchase order and confirm it.
- Receive the product and validate the done quantities.
- Click on valuation button. It will raise traceback

Error caused by commit: https://github.com/odoo/odoo/commit/a080337d7e8bf515018d9cfb7996461adf717224

closes odoo/odoo#122886

Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-05 13:31:29 +02:00
zel-odoo ec57f8d7ff [IMP] mail: user searching by most recent chat
task-2622887

closes odoo/odoo#122486

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-05 13:31:23 +02:00
Prakash Prajapati 81be16f275 [IMP] website_hr_recruitment: rename Job URL in the recruitment
In this commit we renamed jobs/detail/job_position route
to jobs/job_position.

task-3339118

closes odoo/odoo#122460

Related: odoo/enterprise#41771
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-05 13:31:18 +02:00
Maximilien (malb) 0d0ee1c40a [FIX] account: payment view
The payment form for customer or vendor are very similar. To make it more clear
for user we have made a few changes.

- The breadcrumbs are renamed from "Payments" to "Customer Payments" or "Vendor
Payments"
- Remove warning and put it next to the checkbox instead
- Add placeholder for destination_journal_id
- Cancel button is only displayed when the payment is saved

closes odoo/odoo#121601

Task-id: 3326704
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-05 13:31:15 +02:00
niyasraphy 527766a0af [CLN] website_forum: clean moderation_queue temporary fix
Follow-up of [1] fixing an undesired override of the env user
 when rendering other users' details.

This cleans up the temporary patch in stable in favor of simply
renaming the variable defined in the template.

[1] https://github.com/odoo/odoo/commit/5f2a0bea54a4daca565d3ba3be32ce5582253cca

closes odoo/odoo#115006

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-05 13:31:10 +02:00
Florian Damhaut 373321d062 [IMP] sale: flatten template
- Flatten the group list in sale's SO for cleaner UI.
- Modify wording to reflect changes in enterprise PR.

related to odoo/enterprise#36968

closes odoo/odoo#112433

Task-id: 2877341
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-06-05 13:31:04 +02:00
Adesh Jolhe 57f95e1a17 [IMP] sale_(project,hr)_timesheet: bring generic improvements for project
The purpose of this PR is to improve the generic usage of the project app.

So in this PR done following changes:
 - switched Sales Orders button and planning, document button from their place in
   the project kanban card burger menu
 - In milestone form view added decoration-danger on quantity % if it is equal
   to 0 and there is an SOL set
 - On milestone creation the SOL of the project set default if it is of
   milestone type
 - In the product form view Uom is set as 'hours' if the service is either
   prepaid or invoiced based on timesheets.
- In project.milestone list view changed quantity_percentage label to
   to Quantity(%).
- Added product_uom_qty field in project.milestone list view .
 - In project.sharing improved remaining hours widget now only the frame is
   displayed in orange/red, not the background (as in the back-end)
 - project.update right-side panel added the ref of the SO in the nameget
   of the SOL
 - In project.update right-side panel added Confirmation when trying to delete
   a milestone
 - Reduced the size of project and task sharing wizard

task-2989828

closes odoo/odoo#106284

Related: odoo/upgrade#4198
Related: odoo/enterprise#34322
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-05 13:31:01 +02:00
Raouf a35e8fb67a [IMP] project: improve ux
Before this commit:
- When a project is created on SO confirmation,
the new project (assuming there is no project template
set on the product) is added with one stage with name=New
- When portal users drag & drop columns from the kanban view
of project.task, an access rights error is displayed.

After this commit:
- When a project is created on SO confirmation,
set the following stages for the new project
(assuming there is no project template set on the product):
to do - in progress - done (folded) - canceled (folded).
- Disable dragging and dropping project tasks for portal
user.

task-2929871

closes odoo/odoo#97220

Related: odoo/enterprise#29911
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-05 13:30:52 +02:00
pedrambiria ae17a588a7 [FIX] point_of_sale: correctly add Global Discount with fiscal position
Previously, it was not possible to apply the Global Discount in cases
where there was a fiscal position with tax included in the price. This
was because of using in the `get_taxes` function, which do not return
taxes after fiscal position.

opw-3267243

closes odoo/odoo#123612

X-original-commit: cb5a1eae7502c140fed09a9471f4d5a97429df74
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-06-05 11:49:58 +02:00
Pratik Raval (PRRA) ea35602ff2 [FIX] survey: hide limit attempt field when survey_type is live_session
fix-up of https://github.com/odoo/odoo/commit/a0a78f807abd15cb64994aa626a48a0589e16570

Currently, When a user selects 'Live Survey' as the survey type, the
`is_attemps_limited` field is visible although it should be hidden.

This commit fixes this issue by hiding the field when the survey type
is set to 'Live survey'.

Along with that, this commit also removes the condition that hides the
`is_attemps_limited` field when there is/are conditional question(s) in the
survey.

TaskID-3326930

closes odoo/odoo#123596

X-original-commit: d5d0b97b9ada57f43b026da758a0f0044519f460
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-05 11:49:55 +02:00
Saurabh Choraria 5156b22072 [FIX] base_import: prevent traceback if image data contains non ASCII characters
When user tries to add non ascii characters in image field column in a file and
then when he tries to import it the error will occur.

Steps to reproduce:
1. Install contacts
2. export a contact and keep image field in fields to export.
3. Now in that file change the image data and add non ASCII characters
(for example: 'ô').
4. Now try to import this file in contacts.
5. The error will occur.

Applying this commit will fix this issue.

Currently, a ValueError is raised when we give non-ascii characters as input.
So I have reported an issue in python in which I have mentioned to edit the
documentation to note that it may raise ValueError for non-ascii content, or
to fix '_bytes_from_decode_data' function to raise binascii.Error instead of
ValueError.

To track the issue - https://github.com/python/cpython/issues/105193

sentry-4029823200

closes odoo/odoo#123572

X-original-commit: ceb67160e1747f0a886efb8ca0a60499e2b080d1
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-06-05 11:49:50 +02:00
dane@odoo.com a954eb3196 [FIX] mass_mailing: Fix when reply_model is Null
There exists edge case on `reply_model`. when value of
`mail_messages.model` in database is empty then `mail_messages.model`
returns False, hence `reply_model` becomes False which raises
an error because _get_id does not accept a falsy values.
(because query: `SELECT id FROM ir_model WHERE model=false` has to
be run and model is char). Because of the fact that this query never
runs and fails opportunity is lost.
task-3248489

closes odoo/odoo#123488

X-original-commit: 6c0d2d7a9d44459f3e09a38bd80ef9b018e8c946
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-06-05 11:49:47 +02:00
paso-odoo bafc5610b0 [FIX] product: fix negative rounding method for pricelist
If applied, this commit will solve the issue of the rounding method
AssertionError while configuring any negative value in pricelists.

Steps to produce:
- Open Sale > Products > Pricelists > Create/Open any Pricelist.
- Add a new line in Pricelist Rules.
- Set computation as 'Formula'.
- In the Rounding Method field configure any negative value i.e. -1.56.
- Error will be raised.

Fix this issue by preventing the user from entering the negative value in
Rounding Method.

Sentry-4208813474

closes odoo/odoo#123539

X-original-commit: f7b0eddf3124b15bb223379a513965fa2a017851
Signed-off-by: Parth Solanki (paso) <paso@odoo.com>
2023-06-05 07:04:50 +02:00
Rmi Rahir (rar) 8d551f9d32 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/059d66a1 [REL] 16.4.0-alpha.3
https://github.com/odoo/o-spreadsheet/commit/d39aaaf9 [IMP] highlight: support unbounded zone
https://github.com/odoo/o-spreadsheet/commit/98c8b592 [FIX] conditional_formatting: fix cf type checkboxes
https://github.com/odoo/o-spreadsheet/commit/b3848ec7 [FIX] XLSX: open exported .xlsx file containing images in Excel
https://github.com/odoo/o-spreadsheet/commit/a2a11450 [REF] tests: Use minimal setup for composer child components
https://github.com/odoo/o-spreadsheet/commit/dcb61744 [IMP] composer/CEH: Simplify composer flow
https://github.com/odoo/o-spreadsheet/commit/cf61a5f5 [IMP] selection: selecting row/col now add full unbounded range
https://github.com/odoo/o-spreadsheet/commit/98d40e17 [IMP] range: Fix getSelectionRangeString getter
https://github.com/odoo/o-spreadsheet/commit/88ab901f [IMP] tests: remove useless await nextTick() Task: 3344230
https://github.com/odoo/o-spreadsheet/commit/8f95190c [IMP] tests: test currency side panel in standalone Task: 3344230
https://github.com/odoo/o-spreadsheet/commit/61a2fb49 [IMP] tests: test CF side panel in standalone Task: 3344230
https://github.com/odoo/o-spreadsheet/commit/386f21cb [FIX] menu test: correctly await paste action
https://github.com/odoo/o-spreadsheet/commit/2c3fed33 [FIX] Chart Pannel: fixes updateChart process Task: 3323875

closes odoo/odoo#123462

Related: odoo/enterprise#41900
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-06-03 10:36:00 +02:00
FrancoisGe 90ac1f58f5 [FIX] web: aggregate monetary in list
The goal of this commit is to display the correct number of digits for
aggregates of monetary and float fields using the monetary widget in
list view. The number of digits must match that of the currency.

The master commit e96566e already solves
the problem for monetary fields, so we're going to add support for
float fields with the monetary widget.
So we're going to backport this commit.

closes odoo/odoo#123614

X-original-commit: 505155753d6e05fbb4580ce74d9f5844a1fa45a9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-06-02 23:39:35 +02:00
Guillaume (guva) e2500e26df [FIX] hr_expense: expense name on pdf upload
When uploading a PDF, the expense name is showing
the 1st category of expense instead of the name
of the PDF.

opw-3339756

closes odoo/odoo#123608

X-original-commit: 7ec2bb68067e49ea5ab2bbd6598264ccb78cfd70
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-02 23:39:32 +02:00
Vincent Larcin 5b7d766fc3 [FIX] hr_timesheet: fix traceback on deleting tasks
Steps to reproduce
------------------

1. Install hr_timesheet.
2. Try deleting a task.

You will get a traceback.

Explanation
-----------

In https://github.com/odoo/odoo/pull/110737, the calls to `_read_group` were adapted to the new API,
but a slight mistake was introduced when adapting the code in `_unlink_except_contains_entries`.
This commit fixes it.

closes odoo/odoo#123597

X-original-commit: 83046fb1fd00ffde7568c35c76697ecf7f4db8fa
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-02 23:39:29 +02:00
Hubert Van de Walle (huvw) 708f15c9b1 [FIX] web: don't use the compileButton fn for bootstrap toggles
Steps to reproduce
==================

- Use a mobile (xs) viewport
- Go to sign
- Click on "Action"

-> InvalidButtonParamsError

Cause of the issue
==================

The bootstrap button should not be compiled as an action button

Solution
========

Don't call compileButton for button with the data-bs-toggle attribute
We also need to cancel the global click to let bootstrap handle the
action

opw-3278906

closes odoo/odoo#123579

X-original-commit: 5f569eedf9ed4e19b1fab1c83f7d315684097a7f
Related: odoo/enterprise#41906
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-06-02 23:39:24 +02:00
Jinane Maksoud 7426b89398 [FIX] website: fix upadting menu names when many langs are active
Postgfresql functions can only take a max of 100 arguments by default,
when using 'jsonb_build_object' to update translations in jsonb menus
each lang adds 2 args as key value pairs. The languages should be added
in batches of 50.

closes odoo/odoo#123562

X-original-commit: 7dfbbcf91baf796174b171e46c182b8eeb2423a9
Signed-off-by: Wang Chong (cwg) <cwg@odoo.com>
2023-06-02 23:39:22 +02:00
Romain Estievenart 34dc70ae5a [FIX] board: use single column layout on small screen
Steps to reproduce:

- Create My dashboard on PC with two views set one next to the other
- Open My dashboard on mobile devices, and you see the desktop view
  => bug

On small screens, we don't have enough available space on the screen to
allow other layout then "1".

opw-3145706

closes odoo/odoo#123561

X-original-commit: 9e1f79156e9440b953e9d476a608f9ce117c0d5b
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-02 23:39:19 +02:00
clesgow 7f8af8a84b [FIX] mrp: allow override for operation cost in MO Overview
Since employees can be assigned directly to a workorder, their hourly
cost must be added to the operations cost in the Overview.

Those changes allow further override in odoo/enterprise#40953

closes odoo/odoo#123551

X-original-commit: 8802907637b5d862aaa98a1828d29bc7890c53e3
Related: odoo/enterprise#41893
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-02 23:39:17 +02:00
Hubert Van de Walle (huvw) 2d4634df5f [FIX] web: use field digits in grouped list view
Steps to reproduce
==================

- Enable debug mode
- Go to Settings / Technical / Database Structure / Decimal Accuracy
- Set the "Product Unit of Measure" to 3 digits
- Go to Inventory / Reporting / Locations
- Group by company

-> The "On Hand Quantity" is formatted with 2 digits

Cause of the issue
==================

The field is declared as follows

```py
inventory_quantity_auto_apply = fields.Float(
    'Inventoried Quantity', digits='Product Unit of Measure',
    compute='_compute_inventory_quantity_auto_apply',
    inverse='_set_inventory_quantity', groups='stock.group_stock_manager'
)
```

Solution
========

We should fallback to the field digits if the digits are not set on the
arch, such as this

https://github.com/odoo/odoo/blob/1cd49304ef118e667bd14fd5fa78a0baba47bb4a/addons/web/static/src/views/utils.js#L152

opw-3328657

closes odoo/odoo#123543

X-original-commit: f4ecb7ff0c166c7e58ea99711868a30ea3a7fda7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-02 23:39:11 +02:00
Abdelouahab (abla) b994c8c516 [FIX] analytic: avoid popup overflow
To Reproduce
============
- create many analytic plans and link them to an analytic account
- create an invoice and add couple of lines, stop when the page
becomes scrollable
- on the last line click on Analytic, the popup is positioned under
the line and we can't reach last plans

Problem
=======
- according to [getBestPosition](https://github.com/odoo/odoo/blob/16.0/addons/web/static/src/core/position_hook.js#L83), we try different options to position the popup and we take the first one to mach.
- in this use-case, the different positions tried by `getBestPosition` are overflowing because of the height of the popup.

Solution
========
limit the height of the popup to half size of page

opw-3252165

closes odoo/odoo#123542

X-original-commit: 3a7aaa36a487d101a70cb24c3c720a61f50a33ef
Signed-off-by: abla001 <abla@odoo.com>
2023-06-02 23:39:06 +02:00
Maruan Aguerdouh (magm) ba444ee90f [FIX] web: z-index of properties field popup don't go below subtask form
Steps to reproduce:

- Install Project app and activate Sub-tasks.
- Go to any project > a task > go to subtasks and add a new line.
- In the next popup, create a whole new subtask, and try to add a new
property field to this subtask.

Issue:

The z-index of the properties field popup is lower than the subtask form
popup, so it goes below it.

Solution:

Changint the current the z-index from the `o_property_field_popover` for
the $zindex-popover which will make it go above the subtask form popup.

opw-3174888

closes odoo/odoo#123541

X-original-commit: 15e22367a290903c26c8c18d85ecaa2a708d99b0
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-02 23:39:01 +02:00
Alvaro FuentesandChong Wang f7fca3faf9 [FIX] core: do not udpate translation terms from text to xml
Steps to reproduce the issue:
* In a clean v16 db install base_setup
* Log in into DB, switch language to French (install and activate it)
* Upgrade to saas-16.1

Issue: The main settings page under Companies settings (Sociétés in Frech) shows
```
<span class="o_form_label">Mise en page du document</span> <span class="fa fa-lg fa-building-o" title="Les valeurs définies ici sont spécifiques à l'entreprise." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
```
instead of just
```
Mise en page du document
```

The issue comes from this difference, 16.0:
https://github.com/odoo/odoo/blob/fb02720aed0b0be00df8f5d0e1932b948c300b92/addons/base_setup/views/res_config_settings_views.xml#L78-L79
vs saas-16.1:
https://github.com/odoo/odoo/blob/80bc702ecfe6f704af05f9830d272b162018f2ad/addons/base_setup/views/res_config_settings_views.xml#L79

Note that `Document Layout` is used in two different contexts. In 16.0
it comes within an xml/html block containing a `<span>` tag, and more
importantly it is the **text** part of the xml tag. In saas-16.1 the
same `Document Layout` is used as an **attribute** of the `setting` tag.
Thus we cannot blindly assign the whole term (block with tags) to the
attribute when upgrading to saas-16.1, it is only safe to update the
translation from xml to text. Updating a text entry with something that
seems to have other xml elements is unsafe and can lead to the issue
showcased here.

For more context, at the time of updating the terms here is the
situation:
* `closest_matches` is `['Document Layout']`
* `closest_term` is `Document Layout`
* `old_term` is
  ```
  <span class="o_form_label">Document Layout</span>
                                        <span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
  ```

closes odoo/odoo#123540

X-original-commit: 6cd49293fe4d0d86fbbfa2476e113deadeba7348
Signed-off-by: Wang Chong (cwg) <cwg@odoo.com>
Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
Co-authored-by: Chong Wang(cwg) <cwg@odoo.com>
2023-06-02 23:38:58 +02:00