Commit Graph
168412 Commits
Author SHA1 Message Date
roen-odoo 7c577fd34d [FIX] pos_loyalty: display "enter code" correctly
Current behavior:
When you only used the "Next order coupons" loyalty program, the "enter
code" button was not displayed.

Steps to reproduce:
- Install the pos_loyalty module
- Archive all the loyalty programs
- Create a loyalty program with "Next order coupons" as reward
- Open a PoS session

opw-3608894

closes odoo/odoo#147101

X-original-commit: 55ad2020e4b56a2ce525959f0c021b83198446bc
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-12-21 17:24:59 +00:00
roen-odoo 47ff920f57 [FIX] pos_sale: fix warehouse group by in sales report
Current behavior:
When grouping by warehouse in the sales report, the pos orders appeared
under the "None" warehouse group.

Steps to reproduce:
- Create a PoS order
- Validate the PoS order, and close the session
- Go to sale reporting, group by warehouse
- A group "None" appears, with the PoS order inside

opw-3540797

closes odoo/odoo#147100

X-original-commit: 132dd31e7e7a941ad375ada0be35dde05d0b3a43
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-12-21 17:24:58 +00:00
Romain Derie c66551ff8a [FIX] website: sync website homepage url with page url change
- Create a "/test" page, publish it
- Set "/test" as homepage url directly on the website (in the settings)
- Go to that page
- Open the page properties and change its URL from /test to /else

From there, the website setting (`homepage_url` field) was still set to
/test and not /else.
It means that the first "published" menu would then be used to avoid
serving a 404 as homepage to your visitors.

It is a bit confusing and people probably just expect to change that
website setting too when changing the page URL.

We had some feedback about similar flows (that couldn't be reproduced or
where people weren't sure) where people ended up writting on the wrong
page or losing their content.
Maybe this will mitigate the issue.

Kind of related: task-3476840

closes odoo/odoo#147086

X-original-commit: 374a1b31f70a3209b1ae11db8e5886350579c7f9
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-12-21 17:24:56 +00:00
Abdelouahab (abla) 462c3f55e1 [FIX] web_editor: report 2 columns must be side by side
To reproduce
============
- on studio > create new report from internal layout
- execute 2 columns command --> the second column will be under the first one

Problem
=======
the browser finds out that the `iframe` is small to keep two `col-lg-6` side by side.

Solution
========
use `col-6` instead, like in 17

opw-3585043

closes odoo/odoo#147074

X-original-commit: 246f42baf76b308210a2b03d46a6143ace4bb7cc
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2023-12-21 16:07:55 +00:00
tsm-odoo 8d3956046e [FIX] bus: fix non deterministic reconnect test
Before this PR, the "can reconnect after late close event" test
was relying on the `nextTick` helper to check which bus events
were received when the device switches from online to offline.

This test was non deterministic since a tick might not be enough
to receive the related events: the bus service communicates with
a shared worker through the MessagePort API, the worker uses a
Websocket which dispatch events upon connection/reconnection.

This commit replaces the use of the `nextTick` helper by the
dedicated `waitForBusEvent` helper which resolves once the event
is received.

fixed runbot-45695

closes odoo/odoo#147068

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-21 16:07:54 +00:00
Nicolas Seinlet 4d3331ba12 [FIX] 14.0 is no more supported with 17.0 release
closes odoo/odoo#147047

Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-12-21 16:07:53 +00:00
abd-msyukyu-odooandSalvo Rapisarda d1688b6ee3 [FIX] survey: prevent soft lock with conditional questions
If multiple questions are conditionally displayed if the user selects an answer
in another multi-choice question, that answer was added multiple times in the
list used to filter mandatory questions that have to be answered when displayed.
This is an issue because the answer was only removed once if the user changes
his choice resulting in a state where a mandatory question that is hidden stays
mandatory even though it is not displayed to the user.

How to reproduce:
- create a new survey with:
      - Question1:
        - multi-choice with one answer
        - 2 answers (A, B)
      - Question2:
        - single line text box
        - mandatory answer
        - conditional display depending on answer B of Question1
      - Question3:
        - single line text box
        - conditional display depending on answer B of Question1
- start the survey
- click on answer B then click on answer A

Current behavior:
- user is not able to submit the survey with answer A selected

Expected behavior:
- user should be able to submit the survey

Note:
The issue was already fixed from 17.0 in this [commit], but the test is
still adjusted to ensure that displaying/hiding multiple questions at once
depending on conditional triggers works as intended without preventing the user
to finalize the survey.

[commit]: https://github.com/odoo/odoo/commit/55fa52be8a80e6f7ee2a526db29c0d97c24ae8f6

task-3630079

closes odoo/odoo#147008

X-original-commit: f574ec49b730917e8e781a9b47895048a389d585
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
Co-authored-by: Salvo Rapisarda <sdrapisarda@gmail.com>
Co-authored-by: Damien Abeloos <abd@odoo.com>
2023-12-21 16:07:50 +00:00
Anita (anko) d7790b57cd [FIX] payment_adyen: not send False information
If customer did not have address,email and telephone fields,
"False" would be send to Adyen resulting in these field
containing False values, which in some cases was falsely
triggering anti-fraud system.

task-3159378

closes odoo/odoo#146990

X-original-commit: 0de6864e32cff260393fde391250cff0fa6d9653
Signed-off-by: anko-odoo <anko@odoo.com>
2023-12-21 16:07:50 +00:00
Benjamin Vray 90cf5596de [FIX] website_mass_mailing: fix display thanks button on form newsletter
Steps to reproduce the issue:

- In website edit mode, add newsletter block onto the page.
- In the options of the snippet, change the template to "form".
- Click on the "Display Thanks Button" checkbox.
- => Traceback.

In this commit [1], a button has been added to the options of the
"Newsletter Block" snippet to allow the user to display the "thanks"
button in edit mode to be able to edit it.

Later, in another commit [2], a new "Form" template was added to the
"Newsletter Block" snippet, but the "Display Thanks Button" option was
not adapted for it.

This commit adapts the "Display Thanks Button" option for the "Form"
template of the "Newsletter Block" snippet so that it displays the thank
you message on the page, and the user can also edit it.

[1]: https://github.com/odoo/odoo/commit/a9eae10af88a0aba88ce6d3e3f517926edf36c00
[2]: https://github.com/odoo/odoo/commit/bd6ef64f4c79b9c04dc8b85dc2daccb61d55cad0

task-3610063

closes odoo/odoo#146867

X-original-commit: ccf338c67219b10fe86b15012e143a84c886654f
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2023-12-21 16:07:47 +00:00
padh-odoo 47a6e12be3 [FIX] sale: fix the sale order portal view
The portal view of the sale order total is broken.

This issue was fixed in this commit 619e5e0dad but it was removed in this commit df8535fbd4

The changes that were removed have been re-added.

task-3646364

closes odoo/odoo#146806

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-12-21 16:07:47 +00:00
Romain Derie a8f8ded1ce [FIX] website: prevent img url to become absolute with animation option
Using the animation option on an image can turn the image src from
relative to absolute.
It then makes our code crash in some cases (multi domain & cors
protected img). The previous commit makes sure to protect this case by
making the code more robust.

This commit is fixing one of the detected root cause (explained in
previous commit).

The fixed code was introduced with commit [1].

Since we can't guarantee our code has no other way to turn relative into
absolute url, neither that we won't introduce new code doing that, the
very small safety net from previous commit has to be keep as defensive
programming.

[1]: https://github.com/odoo/odoo/commit/7f730f81ec541cc7791fc6b3fded17c838433f85

closes odoo/odoo#146731

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-12-21 16:07:46 +00:00
Romain Derie c51dc918fd [FIX] website: prevent crash on cors protect img used with animation
The image mouseover animation, introduced with [1], can crash through
legit UI flows:

- Visit your website on domain 1 (you will need to access the same
  website from another domain later):
  1. On local: use http://localhost:8069/ and http://127.0.0.1:8069/
  2. On runbot: use master-all and master in URL
  3. On odoo.com: use xyz.odoo.com and xyz.com
- Drag & drop "Text - Image" snippet
- Double click on the image to replace it
- Upload any image
- Click on the image and set its "Animation" option to "On Hover"
- Save
- Outside edit mode, mouseover the image to see the animation
- Behind the scene, the img src is changed from /web/image/xyz to a
  hardcoded base64 value to show the animation
- Now enter edit mode, the system will actually reset the src to the
  original src (to replace the b64) but it will replace it by an
  absolute link and not the initial relative link
- Edit the text below the image, BUT DON'T MOUSEOVER THE IMAGE
  (otherwise the absolute url would be turned into b64)
- Save, again DON'T MOUSEOVER THE IMAGE
- Now go on your second domain to access the same page

Bug: Mouseover the image, a `Uncaught Promise > Failed to fetch` error
will be raised because of a CORS error.

Indeed, on http://localhost:8069/, simply doing this in your debug tool:
```js
fetch('http://127.0.0.1:8069/website/static/src/img/snippets_demo/s_image_text.jpg')
```
will throw the same error.

Note: we can't just modify the CSP rule(s) to allow that domain because
we have no way to know which domains are safe and really domains from
the same database:
- When you are on xx.odoo.com, there is no way to know that xx.com is
  also your domain for the same website. At best it will be set in the
  website domain but it's not always the case (often not the case in
  mono website)
- When you are on xx.com, we have no way to know that xx.odoo.com is
  also your domain for the same website. At best it will be set in the
  ICP `web.base_url` but until that ICP is actually frozen, it will
  change every time the admin logs in the database.

[1]: https://github.com/odoo/odoo/commit/7f730f81ec541cc7791fc6b3fded17c838433f85

Part-of: odoo/odoo#146731
2023-12-21 16:07:46 +00:00
Lopes Marc (loma) 657d5493f8 [FIX] website_slides: fix datetimeObj.getTime is not a function
HOW TO REPRODUCE
================

- Don't need to login
- From Odoo front-end, go to Courses > Trees, Wood and Gardens >
    Main Trees Categories
- You get the following client error:
    Uncaught Promise > datetimeObj.getTime is not a function

HOW TO SOLVE:
============

Unlike standard JS equivalent, luxon datetime objects don't have a
getTime() function. Replace it by valueOf() function.
Also, remove calls to `DateTime.fromJSDate().formatting_fn()` by
luxon equivalent functions.

see bb09cf76e3

task-3632077

closes odoo/odoo#145573

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-12-21 16:07:45 +00:00
Guillaume-gdi 6b6b1365c8 [IMP] website: permit to detect colors of webp logo
Before this commit, when a user uploaded a webp logo through the website
configurator, the colors of the logo were not detected. This commit adds
the possibility to detect the colors of a webp logo.

task-3609329

closes odoo/odoo#145047

Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2023-12-21 16:07:44 +00:00
Guillaume-gdi 2b1dc56efd [IMP] website: select logo colors after uploading logo
This commit permits to automatically select the colors of the logo after
uploading it.

task-3609329

Part-of: odoo/odoo#145047
2023-12-21 16:07:44 +00:00
Guillaume-gdi a38a81a1e6 [IMP] website: add a button to remove website logo in the configurator
This commit adds a button to remove the website logo in the website
configurator.

task-3609329

Part-of: odoo/odoo#145047
2023-12-21 16:07:44 +00:00
Guillaume-gdi fbf5441fd6 [FIX] website: prevent having multiple logos for a website
Before this commit, when a user was uploading a logo for a website via
the website configurator, the logo was added as an attachment but the
potential previous logo was not deleted. This commit fixes this by
deleting the previous logo when a new one is uploaded.

Steps to reproduce the issue:
- Create a new website
- Fill the configurator until you can upload a logo
- Upload a logo, then upload another one
- Finish the configurator
- Edit a page of the website
- Change an image

=> You can see the first logo you uploaded in the list of images.

task-3609329

Part-of: odoo/odoo#145047
2023-12-21 16:07:44 +00:00
Anita (anko) bf45d09828 [FIX] website_sale(_loyalty): fix disappearing code input
If incorrect code was applied, possibility of putting another
code was blocked.

task-3601317

closes odoo/odoo#144367

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-12-21 16:07:43 +00:00
Rahul Prajapati d56b9d34a3 [FIX] mail: margin between Log note and Activities buttons
The margin between the `Log note`/`Activities` is more than
`Send message`/`Log note` buttons. Which looks weird after the `WhatsApp`
button is added.
So, we update the margin between `Log note`/`Activities` to be
the same as `Send message`/`Log note` buttons.

task-3497496

closes odoo/odoo#146811

Related: odoo/enterprise#53066
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-12-21 14:52:40 +00:00
tsm-odoo 6f25d4b06f [FIX] {im, website}_livechat: fix discuss sidebar test
Since [1], the test that ensures live chat threads are sorted
according to their last interrest date is broken. Indeed, the sort was
moved from `im_livechat` to `website_livechat`. This is incorrect.

Also, most of the compare functions used to sort by datetime were
incorrect: those datetimes can be undefined in which case the result
of the compare function would be `NaN`.

This PR moves back the sort function in the correct module and
introduce a standard way to compare by datetime which handles
undefined datetimes correctly.

[1]: https://github.com/odoo/odoo/pull/143382

fixes runbot-47784

closes odoo/odoo#146805

Related: odoo/enterprise#53065
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-12-21 14:52:38 +00:00
Gauthier Wala (gawa) 5506ca7479 [FIX] analytic: gross margin domain empty
To reproduce:
- Create a new plan with an account
- Add an analytic item with this account
- Go to the view of this account
- Gross Margin Button has a value
- Click on it
=> List is empty

The reason being that the view should not include account_id,
but auto_account_id

closes odoo/odoo#147080

Signed-off-by: William André (wan) <wan@odoo.com>
2023-12-21 13:01:15 +00:00
aliya 19852c3bb4 [FIX] account_peppol: fix saving of the verification code
When the verification code is saved,
it triggers the full save and and users get errors about other required fields, e.g. website language missing.
This commit removes save on every focusout, as the save is triggered when clicking confirm.

closes odoo/odoo#147037

X-original-commit: 06d67a05211a24b856b95bc3bdae775dfbd90c19
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-12-21 13:01:14 +00:00
Loan (LSE) 88213dfbbd [FIX] product_image: handle read timeout
According to:
https://requests.readthedocs.io/en/stable/user/advanced/#timeouts
There is 2 different timeout, the connect and read one.
Both have their own exception if they timeout, the connect one
was handled but not the read one.

Before this commit:
 If the read timeout happen, a traceback will occur interrupting
 the (scheduled) job:
 File ".../odoo/addons/product_images/wizard/product_fetch_image_wizard.py", line 308, in _get_image_from_url
    response = self._session.get(url, timeout=5)
  ...
 requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='...', port=443): Read timed out. (read timeout=5)

After this commit:
 We ignore the timeout-ing request the same way the
 request.ConnectionError do

opw-3546601

closes odoo/odoo#147012

X-original-commit: a4c382e3e03541d5db7fd7c627b78658573732a4
Signed-off-by: Loan Sens (lse) <lse@odoo.com>
2023-12-21 13:01:13 +00:00
Fahad Rizwan c81f879222 [CLA] signature for Fahad-2001
closes odoo/odoo#147050

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-12-21 10:42:50 +00:00
FrancoisGe f5543ca74e [FIX] web: keydown on list view in a dialog
Description:
===========
Before this commit, when a line in edit mode in a list view is the last
tabable element in a dialog, pressing "tab" does not cause a switch to
the next line in edit mode. It is therefore not possible to navigate
in this dialog using "tab".

Problem:
=======
Currently, the ListRenderer listens to keydown events using few t-on-keydown.synthetic
in order to know whether to switch the next line to edition.
For information, the effect of a synthetic is to create a single listener
on "document" instead of creating a listener for each element. There is
a conflict with the ui service which listens to all the "tab" keydowns
in order to check whether or not we are on the last tabable element of
the current activeElement. If we are, we stop the event and focus on the
first tabable element. This feature avoids the need to navigate outside
dialogs by pressing tab.
In our situation, this has the effect of stopping the keydown event
before the synthetic can receive it, as the service ui listener is placed
on the dialog and the synthetic listener on the document.

Solution:
========
Remove the use of synthetic in the ListRenderer.
No significant loss of performance was observed.

closes odoo/odoo#147027

X-original-commit: 48e154e
Related: odoo/enterprise#53150
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-12-21 10:42:46 +00:00
Panagiotis Kyriakou c3e497f1d2 [FIX] web: augmented the context of many2many fields
Prior to this change, anything passed in the context of a m2m
avatar field would not be taken into account because the context
was not passed properly in the many2many_tags_avatar_field template.

This commit fixes that and also adds a test for future testing.

task-3599601

closes odoo/odoo#146562

X-original-commit: 03202b7c790be266674e12b96a0b99f44ac773ed
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-12-21 10:42:45 +00:00
micheledic a7f24724ad [FIX] stock: fix on style of warehouse filter on search panel
This commit changes the style of warehouse filter on hover and when something is selected so there is evidence that is clickable and if something is selected

closes odoo/odoo#146371

X-original-commit: 229fd7e5351889307f8b6340990a195cbfe1cebc
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-12-21 10:42:44 +00:00
Xavier ALT 9be2ec255b [FIX] crm: handle customer creation on. lead -> oppor. w/ archived lang
To reproduce:

1. enable 'debug' mode
2. go to menu "Settings / Translations / Languages" and enable a new
  language (ex: nl_NL)
3 create a new lead and set that language
  (IMPORTANT: do not set a customer)
4. go back to menu "Settings / Translations / Languages" and disable the
  language you previously enabled at step 2.
5. from the lead list view, selection the lead you created at step 3,
   click "Action" and choose "Convert to opportunities"
6. In the wizard choose for:
   * Conversion Action: Convert to opportunity
   * Customer: Create a new customer
7. Click button "Convert to opportunity"

This crash with the following error:
```
Traceback (most recent call last):
  File "/data/build/odoo/odoo/http.py", line 654, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/data/build/odoo/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Wrong value for res.partner.lang: 'nl_NL'
```

This commit ensure that when converting a lead to an opportunity, we
don't crash if language is archived.

OPW-3617359

closes odoo/odoo#147003

X-original-commit: 208d6ed021f62b1b53f75129a18e8a0d302f47b0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-12-21 09:12:21 +00:00
Nasreddin Boulif (bon) 5b71700434 [FIX] website_event_crm: escape HTML tags in lead description
Steps to reproduce:

  - Install `website_event_crm` module
  - Go to events and create a new event
  - Add a question of type `text input`
  - Publish the event and go to it on the website
  - Register to the event with an email containing `@example.com` and
    answer the question.
  - Go to CRM in backend and open the new lead created.

Issue:

  Html tags are not escaped in the lead description.
  Same issue with `text_box` type question when having html in answer.

Cause:

  The override of `_get_lead_description_registration` is returning
  a string that escape also the `</br>` tags + the `text_box` answer
  is not escaped.

Solution:

  Use Markup around strings that contain the `</br>` tags to be not
  escaped + escape `text_box` answers.

opw-3471097

closes odoo/odoo#146937

X-original-commit: 27faa1f9b28d01e13277d8d16d7dfbbab8701b01
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-12-21 07:59:57 +00:00
dhrp-odoo a05f93e46c [FIX] spreadsheet_dashboard: multi-record selector dropdown styling
Previously, the multi-record selector dropdown occupied an entire line.

This commit addresses this issue by applying the `flex: 1 0 1rem;`
property to the auto-complete dropdown. This adjustment confines the
dropdown to the necessary space. If the space available is less than 1rem,
it will wrap to a new line.

Task ID: 3607067

closes odoo/odoo#146919

Related: odoo/enterprise#53071
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-12-21 07:59:55 +00:00
alsh-odoo 9dae491432 [FIX] account: fix traceback when from or to value is false
This traceback arises when the user removes the from or to values.

To reproduce this traceback:

1) Install 'account_accountant' and make sure the debugger mode on
2) Open 'Accounting/Configuration/Account Groups'
3) Create a new record
4) Give the 'from' and 'to' values and save the record.
5) Now remove the 'From' value and try to save it

Error:- "TypeError: '>' not supported between instances of 'str' and 'bool'"

When removing the 'to' value 'code_prefix_end' will be False.
It leads to the above traceback from here.

https://github.com/odoo/odoo/blob/230b680bf92583c9f5e4a3739be1d8602df44331/addons/account/models/account_account.py#L838-L842

sentry-4715927815

closes odoo/odoo#147041

X-original-commit: 0d20e3f14c749c3bf6df4349ce1c2c256f771c7e
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
Signed-off-by: Altaf Shaik (alsh) <alsh@odoo.com>
2023-12-21 04:56:58 +00:00
kasp-odoo 763cd36f65 [ADD] account_audit_trail: separate module from l10n_in
Before this commit
==================
The `account_audit_trail` was part of the `l10n_in` module, which restricted its
usage to Indian localization.

After this commit
=================
The `account_audit_trail` module has been separated from the `l10n_in` module.
It is now a standalone module, allowing it to be used independently in various
locations if needed.

task_id: 3326258

closes odoo/odoo#123650

Signed-off-by: William André (wan) <wan@odoo.com>
2023-12-20 18:01:44 +00:00
Louis (loti) e40413da5d [FIX] website_sale: do not show unavailable carriers
Carriers with no/invalid/incompatible rules shouldn't be displayed in
the checkout process.

Cherry-picked from https://github.com/odoo/odoo/commit/5052b9e4a15155c694cf005fdf330997770c6cac
and added tests.

task-3284612
opw-3413820

closes odoo/odoo#147004

X-original-commit: 0491ac9a8d4dbce9e67d336d149b210a558a945c
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-12-20 16:51:14 +00:00
Pierre Paridans e975ff5289 [FIX] website_sale: broken tour setup on multi websites
The `test_01_shop_mail_tour` test was modified in commit [1] to make it
independent of demo data. But the unique constraint on `domain` field
(cf. commit [2]) make it break when run with 3 or more websites.

This commit made the dummy domain assigned in this test non-unique,
which doesn't alter the original meaning of the test but, allows to run
it with multiple existing websites.

Note: this fix is similar to commit [3].

runbot-52417

[1]: https://github.com/odoo/odoo/commit/ad6e975fb1bf12c744764d40ed64e990bc0a9440
[2]: https://github.com/odoo/odoo/commit/507db4e179514d171ec82e8ea0cbaf2323a6c30d
[3]: https://github.com/odoo/odoo/commit/0c522e42a82ec596e69611c556c4fc0d50e6e978

closes odoo/odoo#146984

X-original-commit: ec67c8f1090e90b44f45527f10ea72f235ca5c65
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-12-20 16:51:13 +00:00
Valentin Chevalier 9dfb42f4a4 [FIX] website_sale: show the right reference price in the cart
Before this commit, the product reference price was computed based on
the total amount and not on the unit price.

Now, the product reference price is computed based on the quotient of
the total amount by the quantity.

closes odoo/odoo#146979

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-12-20 16:51:12 +00:00
william-andre f0a346a477 [FIX] account: prevent moves from stealing lines
The balance check doesn't work when a line is being moved from one move
to another because we never notified the move owning the lines at the
start that the lines are being modified.

To reproduce using a simple CSV to import:
```csv
"line_ids/id","line_ids/product_id"
"__export__.account_move_line_9_25fb2fbf","[FURN_7777] Office Chair"
```

To reproduce using a simple server action:
```python
self.env['account.move'].create({'line_ids': [(4, 9)]})
```

We now notify the original move also, triggering everything that needs
to be triggered: sync of dynamic lines and the check for the balance.

closes odoo/odoo#146906

X-original-commit: 41beb0d4fcc70bebe51ff2c872903486be25dae7
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-12-20 15:21:35 +00:00
Abdelouahab (abla) 70abc5d083 [FIX] analytic: read analytic plan
To reproduce
============
Users in a newly created database are not able to create new projects
that has timesheet enabled

Problem
=======
when creating a project with timesheet, an analytic account is created
which requires reading `analytic.plan` which leads to the access error

Solution
========
read `analytic.plan` through `sudo`

opw-3642817

closes odoo/odoo#146769

Signed-off-by: William André (wan) <wan@odoo.com>
2023-12-20 15:21:34 +00:00
Soukéina Bojabza 497e953d67 [FIX] web_editor: fix dropzones with open mega menu
When we start dragging an element with an open mega menu, the dropzones
should only appear:
- inside the mega menu: we therefore should not be able to drop a mega
menu element outside of it.
- after the clone of the element, so we can still drop it where we
started the drag (if it does not come from the mega menu).

This is well the case for normal dropzones but the grid dropzones case
was forgotten. Some "clone dropzones" are also not added for inner
contents that are in a grid mode snippet.

Steps to reproduce:
1)
- Add a mega menu with the menu editor.
- In edit mode, drop the "Text-Image" snippet and toggle the grid mode.
- Open the mega menu and start dragging one of its columns (note that it
toggles the grid mode).
=> A grid dropzone appeared in the "Text-Image" snippet, outside the
mega menu.

2)
- Drop an "Alert" snippet in "Text-Image".
- Open the mega menu.
- Start dragging the "Alert" snippet.
=> No dropzone appeared where we started the drag (so after the clone).

This commit fixes these issues. The first issue is solved by properly
filtering the `selectorGrids` when a modal or a dropdown (so the mega
menu) is open. They were already filtered for the modal case (see commit
[1] which was then refactored in [2]) but it should have been done in
`_activateInsertionZones` at the already dedicated place, instead of
before the call to this function in `_onDragAndDropStart`. This made the
siblings and children selectors filtering redundant and this code was
therefore removed.

The second issue was happening because the "clone dropzone" was only
added if there was no "closest" grid, instead of only checking the
parent. This therefore prevented it for inner contents inside grid items
instead of only for grid items. This commit fixes that. For the case
where we are dragging a grid item (still with an open mega menu), a grid
dropzone is added.

[1]: https://github.com/odoo/odoo/commit/cc406afcea7bf5846233a9f97a4a8ac5f618f3ec
[2]: https://github.com/odoo/odoo/commit/34b534f75dbf3e4c475ca8cc40c8fafde5dbea5d

task-3594979

closes odoo/odoo#146714

X-original-commit: 8eebef20de144fe223feace39546d827a0952b23
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2023-12-20 15:21:33 +00:00
Paul Stroobant f032256c4f [FIX] hr_contract: prevent copy of contract_id on employee duplicate
Steps to reproduce issue:

1. Create two companies, **A** and **B**.
2. Create employee *X* in **A**.
3. Create a contract, assign it to *X* and change its state to Running.
4. Duplicate *X* to create employee *Y*
5. Change *Y*'s company to **B** (bypass warnings and errors).
6. Try to access Payroll Dashboard.
7. A Multi-Company access errors is raised

Explanation:

When duplicating *X*, the value from `contract_id` is copied to *Y*.
After *Y*'s company is changed to **B**, Payroll Dashboard tries to retrieve data from its `contract_id` and, the contract still being related to **A**, a Multi-Company access error occurs.

Suggested fix:

Preventing the value being copied solves the problem. It also lines up with the `contract_ids` not being copied.
The root issue existing in *v15.0*, the fix will be implemented in that version too.

opw-3623483

closes odoo/odoo#146890

X-original-commit: 703863d86c603a4cbbd6115713cd5d49e1887a22
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Stroobant Paul (stpa) <stpa@odoo.com>
2023-12-20 12:36:44 +00:00
tsm-odoo b5306fcd1b [FIX] mail: fix non deterministic crosstab test
This PR fixes a test that ensures the bus subscriptions are updated
when a member is invited to a channel. This test waits some time
before checking if the subscription is done. Sometimes, a tick is not
enough and the test fails. This PR adds a deferred that resolves when
the subscription is done that can be awaited to ensure the timing is
always right.

fixes runbot-46941

closes odoo/odoo#146848

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-12-20 09:55:06 +00:00
tsm-odoo ba5585fea7 [FIX] im_livechat: avoid useless message fetch when chat is created
When a live chat is created on the server, the `/mail/thread/messages`
route is called. This is not required since we know for a fact the
thread was just created. This PR prevent this useless request.

task-3646201

closes odoo/odoo#146785

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-12-20 09:55:06 +00:00
adda-odoo 67d975b94b [FIX] delivery: fix cyclic while loop
Steps to reproduce -->
1) Have Returns operation return type set to Delivery Order
2) Create an SO -> Deliver with a shipping carrier
3) Return the delivery and re-return with the same shipping carrier (need to manually update this field value)

Solution -->
Keep track of `next_moves` that have been accessed

This PR is basically an extension of https://github.com/odoo/odoo/pull/142942

opw-3588205

closes odoo/odoo#146878

X-original-commit: c4d834fa0e62752d3f25f9a6d2aaadc1ce3ce5a6
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-12-20 08:35:46 +00:00
JF Aubert 6fe45e648d [FIX] mrp: fix byproduct list view
The stock.move.line view for byproducts displays the quant_id (Pick From).
It is more appropriate to display the destination location (Store To).

closes odoo/odoo#146604

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-12-20 08:35:43 +00:00
JF Aubert 41e55c446a [FIX] stock: fix destination location label
In the main stock.move.line list view, the replacement of 'location_id'
by 'quant_id' adapted the label to 'Pick From',
The label of 'location_dest_id' is therefore adapted to 'Store To'.

Part-of: odoo/odoo#146604
2023-12-20 08:35:43 +00:00
dise a56e1ea1c8 [FIX] portal: change _search method to support custom search_in
The _search method of the portal search panel uses the currently
selected dropdown item to retrieve the search criteria ; however, when
using a search criteria that is not displayed in the dropdown menu, the
replace method causes a traceback, since calling attr on the empty
jquery selector object returns undefined.

The _search method was changed to use optional chaining before
accessing the replace method, and to replace the search_in value by an
empty string in case the result of the expression is undefined.

closes odoo/odoo#146570

X-original-commit: 053176523ea97b1c7a2ce7cafa88c4bdf0b1795d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-12-20 07:28:11 +00:00
Odoo's Mergebot ebab869e0a [FW][IMP][FIX] website_forum: fix links and buttons
This PR fixes a link issue on Safari. 
Because `<tr>` elements in this browser don't support `position: relative` and our links have a `.stretched-link` class,
the last link in the list was the one being clicked wherever you clicked.

We've also fixes some mobile issues such as the "New Post" button overflowing and the burger button alignment.
| Before | After |
|-----|-----|
| <img width="380" alt="Screenshot 2023-11-28 at 10 14 20" src="https://github.com/odoo/odoo/assets/19491443/19475aaf-a736-4df7-b4bd-9d9cd68bd293"> | <img width="371" alt="Screenshot 2023-11-28 at 09 53 12" src="https://github.com/odoo/odoo/assets/19491443/c91da79f-e971-4f11-b7d7-39512e70b56d"> |

Some changes have been made for the design to function better with the web editor. 
The breadcrumb for example : if ever the user were to change the size of the `h5` heading with the website builder, the `/` would not be the same size as the text preceding and following it. This is because the text is inside an `h5` but not the `/`. By removing the `h5` and giving the size to the wrapping parent element we fix this issue.

| Before | After |
|-----|-----|
| <img width="329" alt="Screenshot 2023-11-28 at 10 08 05" src="https://github.com/odoo/odoo/assets/19491443/d50065af-af63-4cd8-bbeb-eb9e4ac7d797"> | <img width="444" alt="Screenshot 2023-11-28 at 10 08 53" src="https://github.com/odoo/odoo/assets/19491443/7efb11a4-2911-4032-991e-e82e90b5106f"> |

task-3555851

closes odoo/odoo#145891

Forward-port-of: odoo/odoo#139206
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-12-20 07:28:10 +00:00
Elisabeth Dickinson a1456ad051 [FIX] website_forum: fix design to work better with web editor and more
Some changes have been made for the design to function better with the
web editor. We've force the Y margins on headings to `0` and switched
some font size classes.

Using a `fs-5` on the `fa-check-circle` breaks the layout if the heading
size is changed so it has been swapped for a `fa-lg`.

To be aligned with other frontend layouts, the `oi-chevron`s used in
buttons have been switched for `.fa-angle`.

By adding a condition to one of the wrapping `div`s in the header we
a avoid the empty `div`.

Instead of using a `row` without a `col` child, we use a `d-flex`.

task-3555851

Part-of: odoo/odoo#145891
2023-12-20 07:28:10 +00:00
Elisabeth Dickinson 8c052e2b2e [IMP] website_forum: align the offcanvas button in the header on mobile
The offcanvas button was not vertically aligned on mobile. This is
fixed by aligning it to the baseline, its size has also been increased.

Another issue was the breadcrumb items not being the same size
as the `/` when it the heading size is changed in the editor.
The `h5` have been removed and we apply the font size to the wrapping
`.breadcrumb` instead.

task-3555851

Part-of: odoo/odoo#145891
2023-12-20 07:28:10 +00:00
Elisabeth Dickinson 494537f68d [FIX] website_forum: fix link issue on Safari
On Safari, `<tr>` elements don't support position: relative.
To fix this, we used a hack adding a `transform: scale(1)` to the `tr`

task-3555851

Part-of: odoo/odoo#145891
2023-12-20 07:28:10 +00:00
Elisabeth Dickinson fb7efd9d01 [IMP] website_forum: wrap button on mobile
Wrap the "New Post" button that was overflowing on mobile.

task-3555851

Part-of: odoo/odoo#145891
2023-12-20 07:28:10 +00:00