Commit Graph
170745 Commits
Author SHA1 Message Date
mhch-odoo 39df0141b9 [FIX] account_qr_code_emv: Improve Fallback error
At the moment, if EMV QR is selected on the invoice where the country does not support EMV QR an error is raised.

However, this error is also raised if EMV QR is selected but the bank account is not set. The following error is raise
`No EMV QR Code is available for the country of the account False.`
This commit adds a check to ensure the bank account is set and raise a better error message.

Task# 3868467

closes odoo/odoo#162500

X-original-commit: e6ca281b691e75dd9c12fb110f80f444c21729de
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-04-19 02:27:25 +00:00
ahmad(alah) 73627b45eb [FIX] google_calendar: accepting recurrent event tests
The `test_accepting_recurrent_event_*` tests make sure that accepting recurrent events on google side reflect in odoo.
The test was failing because of the following:
when retrieving the invited attendee, the test used `self.assertEqual(event.attendee_ids[1].state, expected_states[i])` assuming that organizer will be at index `0` and invited user at index `1`.
However the list of `event.attendee_ids` is ordered by create_date.
And we create both organizer and attendee with the same command at the same time: `partner_ids=[Command.set([self.organizer_user.partner_id.id, self.attendee_user.partner_id.id])]`
So we might have organizer at index `1` and invited attendee at index `0`. This resulted in the indeterministic behavior of the test.

To fix this issue:
This commit changes how the invited attendee is retrieved, making sure that we always get the right attendee.

fixes runbot-61527

closes odoo/odoo#162279

X-original-commit: 6db2614283abfc035343f021b9cfc52609aa9d44
Signed-off-by: Ahmad Almaghraby (alah) <alah@odoo.com>
2024-04-18 21:06:44 +00:00
Rémi Rahir (rar) d7f6c42f9c [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/9f3317a18 [REL] 17.0.19
https://github.com/odoo/o-spreadsheet/commit/2be837072 [FIX] dashboard: limit clickable cell recomputation
https://github.com/odoo/o-spreadsheet/commit/309c33b1d [FIX] data menu: Auto-select adjacent cells on filter menu Task: 3839869
https://github.com/odoo/o-spreadsheet/commit/0e76c8e2a [FIX] filter: recompute header position Task: 3858512
https://github.com/odoo/o-spreadsheet/commit/4af08d9a7 [FIX] FigureContainer: no selection of a figure content Task: 3752290
https://github.com/odoo/o-spreadsheet/commit/d93b6bcfe [FIX] Composer: pressing enter in the link editor
https://github.com/odoo/o-spreadsheet/commit/da28a4b94 [FIX] sheetview: pageUp/Down with frozen rows Task: 3847414

closes odoo/odoo#162493

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2024-04-18 18:06:07 +00:00
lejeune quentin d17b6e8b48 [FIX] hw_posbox_homepage: Remove link in iot homepage
Actually if a server is not configured we can click on it and
we are redirect to not reachable page

With this commit it is not possible to click if server is not configured

closes odoo/odoo#162372

Signed-off-by: Yaroslav Soroko (yaso) <yaso@odoo.com>
2024-04-18 16:38:24 +00:00
lejeune quentin 4775ed2f15 [FIX] hw_posbox_homepage: Hide certificate error
When the iot run without server we display an certificate error.

This error is useless because we can't get a certificate without server.

Some customer a worry about this error

With this commit we hide this comment if we not connected to a Odoo server

closes odoo/odoo#162371

Signed-off-by: Yaroslav Soroko (yaso) <yaso@odoo.com>
2024-04-18 16:38:23 +00:00
Mohammed Basioni 02461534d2 [FIX] web, website: convert inline templates with text to regular templates.
Strings within inline templates are not translatable, so we convert
these templates into standard templates so that they can be.

Task-3761551

closes odoo/odoo#162106

X-original-commit: 5b38d58db1bb7cacd2a5ffa195a3799f2645fdbb
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Mohammed Basioni (basm) <basm@odoo.com>
2024-04-18 16:38:22 +00:00
Louis Wicket (wil) cc541f9935 [FIX] tools: properly export all translated attributes
Prior to this commit, some attributes such as "data-tooltip" were not
exported in /static/src/ templates, while "label" was only exported in
them.

This commit adjusts the code to use the same list of translated
attributes everywhere, fixing the problem and making it less likely to
happen again.

Task-3872895

closes odoo/odoo#162250

X-original-commit: 6c272a432cea29fa98d9f2a3e4f454214099f3e6
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2024-04-18 15:05:29 +00:00
Serge Bayet (seba) 3118782cd8 [FIX] web,website: fix a rtl issue with carousel snippet
Given the changes in [1] and subsequently in [2], which in some way
counteract the RTL adjustment, it is necessary to eliminate the rtlcss
directive from the carousel CSS to ensure the correct behavior.

Steps to reproduce:

- Enter in edit mode.
- Drag and drop an image gallery and a carousel snippet.
- Navigate to the theme tab.
- Add an RTL language (Arabic, for instance).

Bug :

- The images slide in incorrectly during transitions. In RTL mode, when
  clicking on the left chevron, the next image should appear, not the
  previous one.

If we have three slides numbered 1, 2, and 3
- In RTL mode: Clicking left should navigate from 1 to 2 to 3 and then
  back to 1.
- In non-RTL mode: Clicking left should navigate from 1 to 3 to 2 and
  then back to 1.

The directional Font Awesome icons (classes starting with `fa-` and
ending with `-right` or `-left`) are not flipped in the mobile viewport
as a result of [3]. Necessary adjustments have been implemented
to prevent this behavior.

Upon investigation, a more significant bug was discovered regarding the
'oi-...-[right/left]' icons. These icons were not flipped appropriately
in the frontend when the webpage context was set to an RTL language. A
pull request has been created and merged to address this issue [4].

More info on rtlcss [here]

[1]: https://github.com/odoo/odoo/commit/ebb61753bf3d3dd8d3f53db088112b9e4beb813d
[2]: https://github.com/odoo/odoo/commit/c48f57ea2538ad51e00ac27d58f8e191781444f3
[3]: https://github.com/odoo/odoo/commit/be375bb2a886edd002f042355455a71fcac4daf5
[4]: https://github.com/odoo/odoo/pull/157214
[here]: https://rtlcss.com/learn/usage-guide/value-directives/#tip

opw-3747848

closes odoo/odoo#162202

X-original-commit: 7f0f750b0d9e45982130742af2ac396d1985612e
Related: odoo/enterprise#60922
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-04-18 15:05:27 +00:00
Ethan Vincent cbb18848f6 [FIX] sale_management: (revert) handle temp recs
This PR reverts the commit
https://github.com/odoo/odoo/commit/c6842f1

opw-3754297

closes odoo/odoo#161868

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-04-18 15:05:21 +00:00
Youssef Bashandy 9dac77e414 [FIX] hr_holidays : saving 'default_date_from' with another key
Steps to reproduce:
	1- Create an allocation with validity date (e.g. 01-01-2024 -> 30-06-2024)
	 and another one starts after the first one (e.g. 01-07-2024 -> 31-12-2024)
	2- Go to Time off module and select a date in the second allocation's period
	3- Click on the Time off type dropdown menu
	4- You will see the first allocation displayed not the second one

Current behavior before PR:
The display name of some leaves gets computed in a wrong way.
This is happening because after fetching the right allocation
we compute the display name but this time we don't have
the 'default_date_from' in context so since
it became one of the fields that triggers '_compute_leaves'
https://github.com/odoo/odoo/blob/17.0/addons/hr_holidays/models/hr_leave_type.py#L218:L219
we compute the leaves once again but the target_date will be none
and it will get assigned with today's date in 'get_allocation_data'
https://github.com/odoo/odoo/blob/17.0/addons/hr_holidays/models/hr_leave_type.py#L380:L381

Desired behavior after PR is merged:
This has been solved by saving the date attribute in the context
with another name as when computing the display_name we call sudo so clean_context()
removes the 'default_' context keys. Now when it gets removed we are
going to have the same value but with another name.

opw-3797696

closes odoo/odoo#159917

Signed-off-by: Youssef Bashandy (yoba) <yoba@odoo.com>
2024-04-18 15:05:18 +00:00
Kartik Chavda (kcv) b412d11747 [FIX] sale_pdf_quote_builder: make header/footer name writable in settings
Steps:
- Install sale apps.
- Upload a header file from settings with xyz.pdf for
example.

Issue:
- Header/Footer file is not updated according to uploaded
file name.

Cause:
- Header/Footer file name in setting is related and
readonly is should not be readonly in order to update
header file name.

Fix:
- Make settings header/footer file not readonly to
set proper updated file names.

task-3620555

closes odoo/odoo#152007

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2024-04-18 15:05:14 +00:00
JF Aubert b742b79aaa [FIX] mrp: allow to consume less than expected
In Shop Floor, consuming less tracked by lots components than expected
gives an 'Invalid Operation: lot/serial number needs to be specified
for a tracked product' error.
Discarding the dialog to fix the quantities makes the production order
disappear from the Shop Floor.
This because of the MO Readiness filter: as the move becomes partially
available, the reservation state goes to confirmed rather than assigned.

closes odoo/odoo#144718

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-04-18 15:05:13 +00:00
lejeune quentin bbd8e1da50 [FIX] hw_*: Restart IoT windows service at the end of install
Currently restarts of the odoo server do not happen at
the end of the installation of all components. The devices are therefore not detected.

With this commit we restart the server when all the components have been installed

closes odoo/odoo#162362

Signed-off-by: Yaroslav Soroko (yaso) <yaso@odoo.com>
2024-04-18 12:55:06 +00:00
Pedram (pebr) 9e8c451f69 [FIX] point_of_sale: prevent duplicate display of multi attributes
Prior to this commit, if a product had multiple attributes, each
attribute would be displayed multiple times in the order line. This
commit resolves this issue by ensuring that each attribute line is
displayed only once.

opw-3849701

closes odoo/odoo#162258

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2024-04-18 12:55:04 +00:00
Joren Van Onder 405f3eaa68 [IMP] l10n_br: add taxes related to services
These will be used in the new service tax calculation and EDI modules.

task-3660574

closes odoo/odoo#156017

Related: odoo/enterprise#57868
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-04-18 11:18:46 +00:00
Julien Castiaux 1d49034782 [FIX] base: smtp_auth=certificate with SSL/TLS
Start a SMTPS server with client certificate authentication. In Odoo
configure an outgoing mail server with encryption="ssl/tls" and
authentication="certicifate". Load a valid client certificate and key to
use with the SMTPS server then test the connection.

The connection fails because the client certificate wasn't sent during
the TLS handshake.

If you're having trouble running a SMTPS server, I made a script here:
https://gist.github.com/Julien00859/5090d1cff6c02197e5854aabb67bf5ac
It uses aiosmtpd, a light pure python smtp server, install it with pip.
You'll need to copy your snakeoil ssl key + cert inside your /tmp
directory and to expose them to your current user:

    # public cert
    cp /etc/ssl/certs/ssl-cert-snakeoil.pem /tmp

    # private key
    sudo cp /etc/ssl/private/ssl-cert-snakeoil.key /tmp
    sudo chmod 400 /tmp/ssl-cert-snakeoil.key
    sudo chown $USER /tmp/ssl-cert-snakeoil.key

task-3703209

closes odoo/odoo#162297

X-original-commit: b3d7c1fc9c017a4354dc4a6f8abfbf590bc26a51
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-18 07:28:35 +00:00
Julien Alardot (jual) 442e032cce [FIX] sale_expense: Fix price_unit used in mapping key
No rounding in the query used to map sale.order.line to
the hr.expense, models leads to some records not being able
to be linked together, because of floating point errors.

Adding a rounding to the key price_unit,
and not filtering on price_unit. Then, using the rounded string versions
of the price_unit in the comparisons adds a more reliable approach.

task-3705179

closes odoo/odoo#162245

X-original-commit: 0f4705be195ac66e1cdf5af39fd509035929556c
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2024-04-18 07:28:30 +00:00
Paweł Fertyk 0217b88e48 [FIX] mrp_account: fix BoM creation for non-accounting users
Currently, recalculating `analytic_distribution` requires access to
`account.analytic.distribution.model`. This breaks BoM creation for
non-accounting users (e.g. MRP managers). This commit fixes the issue by
using `sudo()._get_distribution`.

closes odoo/odoo#162184

X-original-commit: 3872e9365e4d8cc100a6022e934292f6f6802162
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Pawel Fertyk (pafe) <pafe@odoo.com>
2024-04-18 07:28:29 +00:00
Samuel Degueldre b258e5d294 [FIX] http: force mimetype of .js files to text/javascript
Previously, when the odoo server was running on some Windows
installations, it was possible for javascript files loaded directly from
the static folder of an addon to fail to run because the Content-Type
header was set to text/plain instead of text/javascript. This is because
the mimetypes module from the standard library honors the mimetypes from
the OS, in the case of Windows it reads a key in the registry, which can
be misconfigured to text/plain for .js files.

This commit forces the mimetype of .js files to text/javascript to solve
this issue.

closes odoo/odoo#162313

X-original-commit: 64cbe389e698398eee93ebde9c61b2ee79756380
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2024-04-18 05:53:27 +00:00
Julien Castiaux 41ccb102c1 [FIX] base: bad logging argument in test_smtp_connection
task-3703209

closes odoo/odoo#162262

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-18 00:32:47 +00:00
Guillaume-gdi 5d41bb4a79 [FIX] web_editor: remove useless params when call IAP OLG
Since [this other commit], web_editor can call IAP to generate text via
chatGPT. Unfortunately, an unnecessary param (`version`) was given to
IAP leading to a warning on the IAP side
`generate_content_from_conversation> called ignoring args <version=X>`.
This commit removes this useless param.

[this other commit]: https://github.com/odoo/odoo/commit/386a2fdebf429b0318473e596ed9ac0966d9a8b5

Related to task-3383324

closes odoo/odoo#162249

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-04-18 00:32:45 +00:00
aliya c318734d45 [FIX] account_edi_ubl_cii: remove deprecated peppol eas
As of April 1, 2024, the migration period set by the Peppol Authority of Finland for the requirement
specified in the Peppol Authority Specific Requirements document has ended. According to this requirement,
Finnish end users’ Peppol addresses (participant identifiers) must adhere to the ISO 6523 code list 0216 OVT-format.
Other address types are not allowed for Finnish end users.

See also:
[Finland Peppol Authority requirements](https://peppol.org/wp-content/uploads/2023/08/Finland-Peppol-Authority-Specific-Requirements.pdf)
[Finland Peppol Authority website](https://www.valtiokonttori.fi/en/service/the-state-treasury-is-the-finnish-peppol-authority/#for-service-providers_authority-specific-requirements-in-finland)

It turned out that we have a few others that are no longer used on Peppol.
We will remove those in master as well.
See:
[Peppol codelists](https://docs.peppol.eu/edelivery/codelists/)

no task, reported by the Finnish Peppol Authoirty Team

closes odoo/odoo#162246

X-original-commit: e4519cd0d73029cc482cc4c34e4a57b1432b4c79
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2024-04-18 00:32:44 +00:00
Antoine Vandevenne (anv) 23f1edd299 [I18N] sale_async_emails: add missing module translation
Commit f0016849 added the module `sale_async_emails` but not the .pot
file.

closes odoo/odoo#162215

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-04-18 00:32:42 +00:00
Levi Siuzdak (sile) fcfadf1663 [FIX] hr_holidays: don't assume default date strings are datetimes
Versions
--------
- saas-16.3+

Steps
-----
1. Set timezone of User and browser to America/Los_Angeles;
2. go to Time Off;
3. click on calendar to create a new leave.

Issue
-----
Date defaults to the day before the selected date.

Cause
-----
Commit 0a0c6917b5 added a TZ conversion in
JS to add default start & end times for leaves. The issue is that it
assumes the context values are always datetime strings, therefore always
using `deserializeDateTime`, which does a timezone conversion from UTC
to local time, which is incorrect when the context values are date
strings.

For a UTC-7 zone like America/Los_Angeles, it deserializes a date string
like '2024-01-01' to '2023-12-12 17:00:00' (7 hours before midnight). It
then sets the start hour to 7, and serializes it back to UTC, adding 7
hours, resulting in '2023-12-12 14:00:00'. Instead, Jan 1, 7 AM in
America/Los_Angeles should convert to '2024-01-01 14:00:00' UTC.

Solution
--------
Use `deserializeDate` instead of `deserializeDateTime` when the
`default_date_{from,to}` in the context is a date rather than a
datetime. This way, '2024-01-01' gets deserialized into '2024-01-01
00:00:00' local time. When this value gets used for the default hours,
'2024-01-01 07:00:00' local time will get serialized to '2024-01-01
14:00:00' UTC as expected.

opw-3757712

closes odoo/odoo#162203

X-original-commit: 134455167734d101a8ce923043700e5fc8f497bd
Signed-off-by: Levi Siuzdak <sile@odoo.com>
2024-04-18 00:32:41 +00:00
Adrien Widart (awt) 58152ddb58 [FIX] stock,mrp: allow company creation with company-specific routes
If the "generic" routes (i.e., the ones created from the master data)
are company-specific, the user won't be able to create a new company
anymore.

To reproduce the issue:
1. In Settings, enable "Multi-Step Routes"
2. Enable all companies
3. Inventory > Configuration > Rules:
   - For each Manufacture rule:
     - If its route does not have any company:
       - Set the route's company equal to the one of the rule
4. Create a new company

Error: a Validation Error is raised: "Rule [...] (Production) belongs
to \<new company\> while the route belongs to \<an existing company\>."

Creating a company leads to the creation of the WH and its rules. At
some point, we create/update the global rules. Let's look at the
Manufacture one. We will provide all the required values for its
creation:
https://github.com/odoo/odoo/blob/270d8aa06bb37b4a01f01a7274062e3f88ca2a1c/addons/mrp/models/stock_warehouse.py#L112-L128
As you can see, for the `route_id` field, we try to find a global
route. But here is the issue: in this `_find_global_route`, we will
find the "generic" one thanks to the provided XML_ID. But, step 3,
we set a company on that route. As a result, here, we try to create
a rule for a company X linked to a route that belongs to a company Y,
hence the validation error:
https://github.com/odoo/odoo/blob/dc58d7913131f1f4dbeb0e3337e61e0b21f6f0d9/addons/stock/models/stock_rule.py#L107-L108

OPW-3790512

closes odoo/odoo#162189

X-original-commit: f7131cbb860fe447ee7f31beff3de59da0544bcd
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2024-04-18 00:32:40 +00:00
Romain Derie 2030e1fa67 [FIX] website: get env correctly on configurator_apply
Commit [1] in 17 introduced a `request.env` instead of `self.env` in
`configurator_apply()`. It was not seen and went through the merge.
It should not have any bad impact in real use cases as the method is
always called from the frontend context and `request` is bound but we
have this test [2] which was introduced in 17.1 which is calling
`configurator_apply()` in a python standalone unit test, where `request`
is unbound. It allowed us to detect the mistake since the nightly was
red because of it.

[1]: https://github.com/odoo/odoo/commit/9f319cbc95f8f4cb76df6f2b82e4b43a74f4b753
[2]: https://github.com/odoo/design-themes/commit/b8aae07df41b44aa78cf39ff6104136556199130

closes odoo/odoo#162170

Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2024-04-18 00:32:39 +00:00
labo-odoo 1b71ab41af [FIX] web: name of the selected example should be in white
Steps to reproduce the issue:
----------------------------
1. Enable dark mode
2. Go to Project app
3. Create a new project
4. Click on `See examples` in the kanban
5. Select an example.

Actual Behavior:
---------------
The name of the selected example is in black instead of white.

Expected Behavior:
-----------------
The name of the selected example should be in white.

Solution:
--------
Update the font color of the selected example name to white for better
contrast in dark mode.

task-3602610

closes odoo/odoo#162133

X-original-commit: 60d1580d4bc493c2572ac7c223df3c72f53873bd
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2024-04-18 00:32:37 +00:00
Thibault Delavallée 0680a7c8ca [FIX] test_mail_*: fix query counters tests and runbot builds
Ensure everything is flushed before running tests. Update counters. Check
no-demo mode.

Task-3871642
Runbot-55365
Runbot-55366
Runbot-55367

closes odoo/odoo#162022

Related: odoo/enterprise#60844
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-17 22:47:19 +00:00
Thibault Delavallée db6c468377 [FIX] portal: fix test that breaks without demo data
Followup of odoo/odoo@d6d6bee087 : test was not written to be independent
from demo data.

Also update other tour that fails in no-demo mode as portal user has not enough
address value set to continue the tour, compared to demo mode.

Task-3871775
Runbot-56554
Runbot-56553
Runbot-61488
Runbot-58213

closes odoo/odoo#162021

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-17 22:47:18 +00:00
aath-odoo 162a82b7d6 [IMP] mail: preventing line break in systray activity
Before this commit:
In systray activity, for some languages, when there were few activities (exceeded a certain
length of text), it would break the line to display the labels.

After this commit:
Now, to maintain the design integrity, the text has been truncated to visually display
the labels like "aujourd'hu.." and maintain the design consistency.

Task-3869856

closes odoo/odoo#162001

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-17 22:47:17 +00:00
Antoine Vandevenne (anv) 383a2675d8 [FIX] payment_(buckaroo, stripe): updated the PM based on provider codes
When processing a transaction, the payment method was searched based on
the received code (e.g., 'sepa_debit') that was compared with the
`payment` module's generic codes (e.g., 'sepa_direct_debit'). This
commit ensures that we now compare with provider-specific codes for
Buckaroo and Stripe.

In practice, this mistake had little to no impact as most provider codes
match the generic ones, and we fall back onto the payment method
selected by the user if we can not find a more accurate one based on the
code.

closes odoo/odoo#161883

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-04-17 22:47:13 +00:00
Antoine Vandevenne (anv) d6d5f142c3 [FIX] payment(_stripe): adapt validation currency to payment method
When payment details are tokenized through a validation operation, the
currency to use was usually (except overrides) chosen as that of the
payment provider's company. This sometimes caused compatibility issues
if the selected payment method did not support the company's main
currency. For example, the SEPA Direct Debit payment method only
supports the EUR currency.

This commit allows passing a payment method when getting the validation
currency so that only supported currencies can be returned.

Part-of: odoo/odoo#161883
2024-04-17 22:47:13 +00:00
Achraf (abz) 95f9902d11 [FIX] web: Put kanban color classes in the right place
After this commit, `colorField` is used instead of `cardColorField` to
handle color change from the dropdown of cards in the kanban view.

The value of `colorField` is observed in order to adapt the HTML classes
of `oe_kanban_card` (first `DIV` of `o_kanban_record`) by
adding/removing `oe_kanban_color_X` (where X is an index representing a color).

opw-3823860

closes odoo/odoo#161645

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2024-04-17 22:47:12 +00:00
Achraf 9fd3fc5889 [FIX] web: Use kanban-menu template in arch kanban_arch_parser
This commit modifies the way kanban_arch_parser retrieves `colorField`.

Previously, the parser tried to retrieve only `colorField`
(the `data-field` attribute of `.oe_kanban_colorpicker`) from `kanban-box`.
Except that in most cases `.oe_kanban_colorpicker` is defined in
`kanban-menu` and not `kanban-box`.

for example:

https://github.com/odoo/odoo/blob/31107fb4cc9cf5dc2da21cbfef58dae722c73922/addons/crm/views/crm_lead_views.xml#L554-L559
https://github.com/odoo/odoo/blob/c6978c3fc4f828d970d45ebdaa4a35b44f3d09ce/addons/project/views/project_task_views.xml#L544-L550
https://github.com/odoo/odoo/blob/c6978c3fc4f828d970d45ebdaa4a35b44f3d09ce/addons/project_todo/views/project_task_views.xml#L28-L31
etc.

As a result, this code was always ignored and we always fallbacked on `||"color"`.
```js
 const colorField = (colorEl && colorEl.getAttribute("data-field")) || "color";
```

Now `KanbanArchParser` checks both `kanban-box` and `kanban-menu` and
finally fallbacks to `color`.

Part-of: odoo/odoo#161645
2024-04-17 22:47:12 +00:00
Hesham 0d5f278067 [FIX] base: fixed inverse currency rates in list view
In the currencies list view, the current rate and inverse rate were swapped.
Their strings were also changed to match the string in the form view.

Currency rates were inversed in the currencies list view.

task-3856386

closes odoo/odoo#160882

Signed-off-by: William André (wan) <wan@odoo.com>
2024-04-17 22:47:11 +00:00
axtr 80f72ccb2e [FIX] product: count only active pricelists
Problem:
When we are in the form view of a product variant, the smart button "Extra Price" shows the number of pricelists for this variant including the archived ones

Steps to reproduce:
- Install "Sales" app and activate the pricelists
- Create a product and some variants
- Create at least one pricelist for a variant
- Archive at least one of these pricelist
- Go on the form view of the variant and take a look at the smart button which shows the number of pricelists including the archived ones

Cause:
The domain that filters the pricelists doesn't take in consideration whether the pricelist is active

opw-3836973

closes odoo/odoo#160876

Signed-off-by: Axel Trémaudant (axtr) <axtr@odoo.com>
2024-04-17 22:47:10 +00:00
Tanguy Quéguineur 54edf86bd2 [FIX] stock: display packaging on delivery slip
Issue
-----
The packing is not displayed on the delivery slip when:
- the product is tracked by lot/SN
- the stock.move state = "Done"
- "Display Lots & Serial Numbers on Delivery Slips" is activated
According to c07258c3f27790eea424cee745b2036a3ef0e8c2, packaging
information should always be present.

Fix
-----
We add packaging information to the delivery slip in the case it
was missing.

opw-3820304

closes odoo/odoo#159448

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-04-17 22:47:09 +00:00
Flotchet 040c314e91 [FIX] hr_skills: fix duplicate "skills" title
Steps to reproduice:
-go to myprofile with hr installed
-go to resume page
-> skills title is duplicated

Reason:
The no_label attribute is set to True but the widget will still display a label.

Expected behavior:
The label should only be displayed once

Fix:
Remove the effectless no_label attribute and remove the separator

closes odoo/odoo#158051

Task: 3815381
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-04-17 22:47:08 +00:00
Victor Piryns (pivi) d29a622740 [PERF] account: speed up dashboard
Description:
Add supporting indexes that are used in the queries generated when
openning the accounting dashboard. A query is tweaked to hit
those indexes and avoid `JOIN` where possible.

Benchmark:
Hot loading the default accounting dashboard, default filters and
1 company selected on a staging database with millions of accounting
related entries.

|         | Before   | After    |
|---------|----------|----------|
| Timings | 7.32 sec | 1.6 sec  |

Reference:
task-3805835

closes odoo/odoo#157892

Signed-off-by: William André (wan) <wan@odoo.com>
2024-04-17 22:47:08 +00:00
Paolo Gatti f043353880 [IMP] l10n_it_edi: Adding negative bill test
Added a test to verify the behaviour when receiving a negative bill. The
invoice gets imported with negative amounts, but it can't be posted.
When the user tries to post it, they are prompted to turn it into a
credit note with a UserError.

closes odoo/odoo#141485

Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-04-17 22:47:07 +00:00
Julien (jula)andqsm-odoo d28774398f [FIX] website: review default hr color
By default, Bootstrap uses a solid color and dim the element by setting
`$hr-opacity` to `0.25`[1].
Our design comes with a color that is "dimmed by default" since:

```scss
$hr-color ← $border-color ← rgba(currentColor, .25)
```
This commit therefore sets `$hr-opacity: 1 !default`.

At the same time, this also removes the hr background-color that
Bootstrap sets, otherwise it conflicts with the transparent color we are
adding on top of it.

[1]: https://github.com/odoo/odoo/blob/1154556/addons/web/static/lib/bootstrap/scss/_variables.scss#L664

closes odoo/odoo#160495

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2024-04-17 19:02:39 +00:00
Julien (jula)andqsm-odoo 3ec555eb38 [FIX] website: prevent crash due to color-mix in Safari 16.5
__Current behavior before commit:__
The `color` attribute of `hr` is set to `$hr-color`[1].
`$hr-color` is equal to `$border-color`[2] which itself is equal to
`--o-border-color`[3].
Finally `--o-border-color` is set using `fade-currentColor()`[4]
which uses the `color-mix` css function on `currentColor`[5].

In short, the `color` of `hr` depends on itself. This creates a circular
reference that makes Safari 16.5 crash.

This bug is caused by WebKit. There seems to be a commit to fix[6]
this bug but it looks like it was not backported to this version of
Safari.

__Description of the fix:__
Set `border-top` color of `hr` to `$border-color`. This way of doing
gives the same result as setting `color` but removes the circular
dependency with `currentColor` that makes Safari 16.5 crash.

`color` is set to `inherit` to override the bootstrap rule[1] that
leads to the bug.

For reference, `hr` color is already set like that here[7].

__Steps to reproduce the issue on runbot:__
1. Go to the website shop using Safari 16.5
2. Add an item to the cart
3. Open the cart view
4. Safari crashes

opw-3806725

[1]: https://github.com/odoo/odoo/blob/1154556/addons/web/static/lib/bootstrap/scss/_reboot.scss#L71
[2]: https://github.com/odoo/odoo/blob/1154556/addons/website/static/src/scss/bootstrap_overridden.scss#L333
[3]: https://github.com/odoo/odoo/blob/1154556/addons/website/static/src/scss/bootstrap_overridden.scss#L91
[4]: https://github.com/odoo/odoo/blob/1154556/addons/website/static/src/scss/website.scss#L35
[5]: https://github.com/odoo/odoo/blob/1154556/addons/website/static/src/scss/primary_variables.scss#L2219
[6]: https://github.com/WebKit/WebKit/commit/0d0b884
[7]: https://github.com/odoo/odoo/blob/1154556/addons/website/static/src/snippets/s_hr/000.scss#L7

Part-of: odoo/odoo#160495
Co-authored-by: qsm-odoo <qsm@odoo.com>
2024-04-17 19:02:39 +00:00
Julien Carion (juca) 77aadf471c [FIX] web, *: autocomplete cancels search on click out
This commit fixes a bug where the value of an autocomplete with autoselect
could go into an undefined state where the model value doesn't match the
input value but no change is detected. This would happen on escape press,
scroll and more recently due to https://github.com/odoo/odoo/pull/159333
on click out. To fix this issue, the commit introduces some change in the
autocomplete behavior so that it will no longer select the active option
on click out (blur) when autoselect is active and instead it will revert
the input value to the one stored into the model. Also applies this
behavior on escape key press and scroll for the before mentioned reasons.

Steps to reproduce:
- Go to CRM form view
- Edit the salesperson name to some non existant one and click out (or
scroll or press escape)

Before the fix, the name was stuck to the invalid one but no change was
detected so we couldnt save it. Before https://github.com/odoo/odoo/pull/159333,
click out would select the active option of the dropdown instead (and
launch a dialog for quick create). This is removed because the behavior
is neither intuitive nor practical. After the fix, the name is reset to its
previous valid value instead. This applies to all autocomplete components
with autoselect prop set to true.

closes odoo/odoo#162040

X-original-commit: 9d9026ed0c7bb0af6cf910cc206cf8b55d1b7a36
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2024-04-17 13:44:45 +00:00
Sanjay Sharma ef631c5d10 [FIX] website: remove sub level options of border width
Steps to reproduce :

1. click on edit website.
2. click on THEME tab from snippet options.
3. scroll down to input fields.
4. the border width has options for small and large size, which serves
no purpose and were displayed empty.

Purpose:

This commit aims to remove the changes made on [1] which added 2
sublevel options for Border Width for Input Field which served no
purpose.

After this commit :

The Border Width option will not have sub options small and large.

[1]: odoo@388e4bb

task-3771146

closes odoo/odoo#161872

X-original-commit: f35123799408614c0bd50fcb79d147d2f69a84f7
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2024-04-17 13:44:44 +00:00
Benoit Socias 07f6d71e4d [FIX] website: keep track of throttled scroll event target for Chrome
In Chrome, if a scroll event is not brand new, its `currentTarget` is
lost.

This commit makes sure that the `currentTarget` of the throttled scroll
event sent to `_onScrollWebsiteAnimate` is kept separately to avoid the
issue in case of throttling delay.

task-3449843

closes odoo/odoo#161850

X-original-commit: 277e9f292a031ed835f4135e597c17dab2fd067d
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2024-04-17 08:01:26 +00:00
Benoit Socias f6aa408095 [IMP] web: further document throttlingForAnimation
This is a followup on [1].

In Chrome the event's currentTarget is cleared after events such as
"scroll" are handled. For asynchronously called methods to be able to
access it, the current value of currentTarget needs to be kept.

To help developers that might stumble on this issue when using
`throttleForAnimation`, this commit emphasizes the fact that usage of
that function is not limited to event handlers, and it adds a test case
that illustrates a solution for tracking the lost scroll event target.

No scenario was identified in 15.0, but this could be used as an
alternative solution for [1].

[1]: https://github.com/odoo/odoo/commit/0ba601d2ef5c4e2f846818e78dcd23966d6f563d

task-3449843

X-original-commit: 6cc4cbf2b91d624368c489460a90795921985f6b
Part-of: odoo/odoo#161850
2024-04-17 08:01:26 +00:00
AllePilli 529419957f [IMP] account_edi_ubl_cii: handles UBL files with namespaces per line
Backporting: 1e24b151c6ad0023769b5a561690cb62bcda1d8a

When importing a UBL file, Odoo expects the UBL specific namespaces to
be in the root element of the file. This is not always the case as these
namespaces could exist in every element in the file. When a file is
formatted this way, Odoo cannot extract the necessary data from it
because it is missing the necessary namespaces. To cover this case we
use the lxml.etree.Element.find function instead, and pass in the UBL
specific namespaces to successfully extract the data.

task-3657563
opw-3839398

closes odoo/odoo#161959

X-original-commit: 2845db5966bae3d6f81b6007980053f4ecb00a03
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
2024-04-17 06:41:22 +00:00
Alvaro Fuentes b278241a71 [FIX] base: ensure existing ir.model.constraint xmlids are loaded
When we load a module and the SQL constraints exist both in the table
and in `ir_model_constraint` we need to ensure the xmlid is loaded.
Otherwise the record in `ir_model_constraint` is removed.

Since 4c9968397b we skip returning
existing non-updated constraint records in `_reflect_constraint`. This
leads to them being removed by the ORM. At the end of the load the ORM
sees the record in `ir_model_data` but not in the xmlid pool, thus it
removes it.

closes odoo/odoo#162105

X-original-commit: b5670c7f0d35d13affee2ae93158556346b7dd23
Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
2024-04-16 17:38:14 +00:00
Julien Van Roy 992532e9ef [FIX] account_edi[_ubl_cii]: company_id when searching retrieve_partner
Bug:

1. Have at least 2 companies ("A" and "B")
2. Export an xml (Bis 3 for instance) for an invoice with customer
"Azure Interior"
3. Set a company on "Azure Interior" (say: A)
4. Import the xml in multicompany mode, with current company = B The
partner "Azure Interior" should be retrieved, but when writing it on the
invoice, it will throw a UserError "odoo.exceptions.UserError:
Incompatible companies on records: 'Draft Invoice (* 63)
(INV/2024/00006)' belongs to company 'B' and 'Partner'
(partner_id: 'Azure Interior') belongs to another company."

Cause:

We try to write a partner on an invoice belonging to another company. It
only occors when we have several companies selected because there is the
global rule `base.res_partner_rule` that will add `('company_id', 'in',
company_ids + [False])` to any search domain on the partner
(`company_ids` is replaced by `env.companies.ids`, see `_eval_context`).

Fix:

Ensure any search domain contains `env.company.id`: the `company_id` of
the move being created.

opw-3829223

closes odoo/odoo#162019

X-original-commit: 18119d446bdca9c04b7085bd1a1bd2f0e0b94ff3
Related: odoo/enterprise#60816
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
2024-04-16 17:38:12 +00:00
Guillaume-gdi 1d16d3a095 [FIX] website_blog: remove problematic test without cache
Since [this commit], the `test_10_perf_sql_blog_standard_data` test
failed randomly. As testing sql perf for website without cache doesn't
really make sense (as explained in [this other commit]) we can can just
remove the test without cache.

[this commit]: https://github.com/odoo/odoo/commit/88b016fdc407e318c43c96df9b582853512f04fa
[this other commit]: https://github.com/odoo/odoo/commit/dad8dca0da23143eb2f28debde5139e907368a2e

runbot-55755

closes odoo/odoo#162036

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-04-16 16:18:46 +00:00