Commit Graph
168389 Commits
Author SHA1 Message Date
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
Pierre Paridans 8266af8339 [FIX] tests: error when Chrome websocket returns empty message
Since Chrome 120 (specifically Chromium build 1208985), an empty message
is received from the CDT at the end of a test run, which obviously
cannot be parsed as JSON.

This is due to a fix made in Chromium [1] where ChromeDriver didn't send
the CLOSE frame in response to the CLOSE frame sent by the client. The
websocket-client library we use to talk with the CDT interprets this
frame as a empty string when receiving message (cf. in `_core.py` [2]).

As we don't need to interpret more complex low-level messages, this
commit simply skips the empty message (which was already implicitly done
in 15.0 [3]).

[1]: https://bugs.chromium.org/p/chromedriver/issues/detail?id=4499
[2]: https://github.com/websocket-client/websocket-client/blob/69e470fee083cd4d5f42bccaff3a6168bfeee863/websocket/_core.py#L379-L399
[3]: https://github.com/odoo/odoo/blob/b5b069564c0a0246f3f263804088d40c3990633a/odoo/tests/common.py#L1169

closes odoo/odoo#146913

X-original-commit: 28d5a2603fb0284629079af2b8b431b45d58cd18
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-12-19 22:45:59 +00:00
Adrien Guilliams (adgu) aaaaddd4f5 [FIX] point_of_sale: fix pos created when download pos restaurant
Prior to this commit, when creating a database with pos_restaurant,
a classic point_of_sale was created with the name Shop but without
all the settings of the previous Shop that was archived by
the installation of pos_restaurant. We do not want this so we remove
this behaviour.

We also fix another bug. The bug is that, if a starting pos config is
archived and that the user wants to download the demo data from the
frontend after that, the server will raise an error. This is because
the pos config is archived and the pos session will try to create orders
and use payment methods from the archived pos config. We also fix this
in this commit by not taking into account the
point_of_sale_onboarding_main_config.xml file if the pos config is
inactive.

closes odoo/odoo#146833

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-12-19 17:32:18 +00:00
Fabien Pinckaers 88f1b488c5 [IMP] web: reduce list icon's padding, to avoid label ellipsis
Example in SO: Quant... > Quantity, Unit P... -> Unit Price

closes odoo/odoo#146803

Signed-off-by: Fabien Pinckaers (fp) <fp@odoo.com>
2023-12-19 16:19:44 +00:00
Aaron Bohy b3ddb46aab [FIX] base_automation: correctly trigger on_change rules
Before this commit, and since [1], automated rules of type
"on_change" (i.e. on UI update) didn't run. This is because the wrong
field (trigger_field_ids) was used to record fields for which the
rule must be triggered. For that type of rule, the field to use is
on_change_field_ids. As a consequence, those rules were not
correctly created, and thus they didn't properly react to field
changes.

[1] odoo/odoo@8bdac7e26c

opw 3632084
opw 3595411

closes odoo/odoo#146780

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-12-19 16:19:43 +00:00
Chauhan Aadil Riyazmohamed 15a088d0f1 [FIX] project: discard unnecessary scrollbar in project form view
Before this commit:

In project module when project form view opens there is a tiny horizontal
scrollbar that doesn't seem necessary.

After this commit:

With this commit, I have fixed this issue and discard unnecessary tiny
horizontal scrollbar in project form view.

task:3508251

closes odoo/odoo#146819

X-original-commit: f151910b1df856b0141c488a32b62f8e006c0492
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-19 14:51:40 +00:00
Aaron Bohy f8702f24db [FIX] mail: kanban_activity: define options of the selection field
When defining a selection field as field dependency, one must
specify the options of that selection field (or at least an empty
list if options don't matter). Because if that field isn't in the
arch (which is the point of defining field dependencies), and the
model has to process a value for that field, it will crash in
`parseServerValue` (selection case).

There's no scenario to reproduce this in standard, but one can
build one: edit the project task form view arch, in the child_ids
x2many, set mode="tree,kanban", but do not add the kanban nor the
form view inline (s.t. default views are used). Then open the view
in mobile and click to add a record in the relation.

closes odoo/odoo#146435

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-12-19 12:20:07 +00:00
Mahdi Cheikh Rouhou (macr) a058996ecc [FIX] website_sale: show phone required error on same address
Issue:
======
The phone field is required in a billing and shipping address at the
same time but no warning appears.

Steps to reproduce the issue:
=============================
- Install ecommerce
- Log in with mitchel admin and add anything to cart then go to checkout
- Update the saved address which is for shipping and billing and remove
  the phone
- Save the adress , the page will reload and no error appears.
- Add the phone and save it will works.

Origin of the issue:
====================
`use_same` wasn't passed in `kw` when updating the address.

Solution:
=========
Force `use_same` when validating the values when we have the address is
the same for shipping and billing.

opw-3617720

closes odoo/odoo#146266

Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2023-12-19 12:20:06 +00:00
Mahdi Cheikh Rouhou (macr) 13b338acd8 [FIX] web: solve datetime_picker with 12H format error
Isssue:
=======
When using a language with twelve-hour format (arabic) and open
datetime_picker it will raise an error.

Steps to reproduce the issue:
=============================
- Change lang to arabic
- Create a task in a project an try to modify the deadline

Origin of the issue:
====================
When we have `props.focusDateIndex != 0` and `props.range = False` we
will have only that index in the array `this.state.timeValues` ,
iterating over the array in `handle12HourSystem` function will result in
error because it starts iterating from index 0 which is undefined.

Solution:
========
Skip the undefined indexed;

opw-3629657

closes odoo/odoo#145424

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-12-19 12:20:05 +00:00
Anita (anko) 20a3998c30 [IMP] website_sale: Show Customer Account with ecommerce
If ecommerce was installed, website privacy setting "Customer Account"
was hidden and replaced with another setting. Now both of these settings
are shown.

task-3321443

closes odoo/odoo#146746

X-original-commit: 8529bd040ef759fdcbc4597408e3d82650be8424
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: anko-odoo <anko@odoo.com>
2023-12-19 11:03:56 +00:00
Romain Derie b96354fa55 [FIX] web_editor, website: remove clone button on mega menu block
Step to reproduce:
- Create a mega menu
- Enter edit mode and select it
- You can duplicate the top level block (but not remove it)
- If you duplicate it, you end up with a second top level block that you
  can't delete ever, even by deleting inner elements one by one.

Technical details:
1. The remove button of the mega menu is already hidden thanks to commit
   [1] which used the `forceNoDeleteButton` editor option introduced
   with commit [2].
2. The table of content snippet also need to hide both the delete and
   clone button. It was done in an "non-ideal" way with commit [3].
3. The delete button removal for table of content snippet was actually
   improved to use the `forceNoDeleteButton` option of commit [2].
4. It's also commit [1] which prevent the deletion of the top level
   block when deleting inner elements one by one: when the last one is
   deleted, it regenerates the whole block.

This commit thus simply makes it so `forceNoDeleteButton` also hides the
clone button.
A first solution was made by introducing a new `forceNoCloneButton`
option, but there is good chances that you always want to either hide
both or show both, so merging those options for now is the simplest
solution.

It also takes the opportunity to remove the (now) useless code in the
table of content snippet.

[1]: https://github.com/odoo/odoo/commit/97810a9c40396bb27cb5779937734849d185cf1f
[2]: https://github.com/odoo/odoo/commit/7ef484377a493ebe558242480d0da6b542d6c247
[3]: https://github.com/odoo/odoo/commit/9fb2dad97cfbd412bee3cb5d1358a9835e721f60#diff-ea32a091d6b1a47aeea680fa39bbc9111260cbdaf07e9f388a9d04741806ea8fR128-R129

opw-3604033
opw-3627319

closes odoo/odoo#146745

X-original-commit: 44b006778df913b847c58b3e405d2a177fcb1a7c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-12-19 11:03:54 +00:00
Rodolpho Lima 0fe09d713e [FIX] web_editor: link_in_selection style outside editable
Before this commit, the CSS properties defined by the
`o_link_in_selection` class could be applied to a link outside the
editable. In particular, the link preview in the LinkDialog widget would
display the visual indicator of a link in selection, even though it is
not editable nor selected (this happens because the link preview
contains the classes of the original link being edited).

As the styling provided by `.o_link_in_selection` is only meant to be
applied to links inside the editable, this commit makes sure the CSS
rule is specific about that.

task-3580546

closes odoo/odoo#146679

X-original-commit: b7664dc8e8a0a7909101f45d5a58473ca64d71ca
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
2023-12-19 11:03:53 +00:00
Adrien Guilliams (adgu) 7451a35a5d [FIX] point_of_sale: disabled commercial fields in child partner
Prior to this commit, a user was able to modify the commercial fields
of a partner in the POS. This is not wanted and not possible in the
backend. This commit adapts it to the backend behavior.

closes odoo/odoo#146475

X-original-commit: 0c55915172f06864c6f29d59d3057fbe0ff42bb5
Related: odoo/enterprise#52885
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2023-12-19 11:03:53 +00:00
tsm-odoo 225cfc03f6 [FIX] mail, im_livechat: do not overwrite tab title on embed live chat
Since [1], messages received out of focus are notified to the user via
the tab title. In order to do so, the title service is used. This
service changes the tab title according to its internal state.

When the live chat is embed on a page, the original title of the page
is not coming from the title service. When the service state changes,
the title is replaced without taking into account the original title.
This behavior is not correct.

In practice, this functionality is only used by the `web` bundle. The
error occurs because the code handling this behavior is placed in the
common bundle while it should not. This PR fixes this issue by moving
this code to the `web` bundle.

task-3644431

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

closes odoo/odoo#146752

X-original-commit: 43b67c377b6a236cb009b21afd62d8c593ef9cd6
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-19 09:36:59 +00:00
dise-odoo 0360463053 [FIX] sale_timesheet: remaining days/hours on so field not displayed
The "Remaining Days/Hours on so" field wasn't displayed on the portal
tasks view, because of an issue with two templates having the same id.

In the view file sale_timesheet_portal_templates.xml, the
portal_timesheet_table_inherit is now depreciated and its content was
moved into the project_portal_templates.xml file.

task-3595003

closes odoo/odoo#146747

X-original-commit: c2ef7a4185f82b84f036ee2825e949f6340b4d40
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-12-19 09:36:57 +00:00
Adnan Saiyed 3deed0ece1 [FIX] web_editor: link / unlink buttons not appearing/disappearing
Current behaviour before commit:

-When creating a link, the 'unlink' button is
 not getting appeared in the toolbar.

-When removing link through 'unlink' button,
 the 'unlink' button is not getting disappeared
 in toolbar.

-Before this commit, _updateEditorUI method is
 responsible for hiding/ showing create-link
 button.

Desired behaviour after commit:

-Now, When creating a link, the 'unlink' button
 gets appeared in the toolbar.

-When removing link through 'unlink' button,
 the 'unlink' button gets disappeared
 in toolbar.

-This commit ensures that _updateToolbar
 method is responsible for hiding/ showing
 of create-link and unlink button.

task-3514639

closes odoo/odoo#146680

X-original-commit: 92ca62162e85a3c617ba73eaa974d342adc3e35a
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
2023-12-19 09:36:57 +00:00
SilvioC2C 623279045c [FW][IMP] sale: allow custom cache keys for solines tax computation
The new, refactored method `_compute_tax_id` caches the results of `account.fiscal.position.map_tax()` to improve performances; however, this makes it nearly impossible to customize the behavior of this method in case other elements are added to the workflow of taxes computation.

Every sale order line with the same fiscal position, company and product taxes have their taxes mapped in the same manner

This commit adds a hook to allow custom modules to specify additional custom cache keys.

closes odoo/odoo#146678

Forward-port-of: odoo/odoo#146271
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-12-19 09:36:56 +00:00
Dylan Kiss (dyki) 8533c7d86e [FIX] l10n_es{_edi_facturae}{_adm_centers}: add administrative centers
Currently it's not possible to send facturae invoices through FACe,
since we did not include administrative centers in the XML.

This commit fixes that by:

- Introducing a new partner type for Administrative Centers, with the
  necessary fields
- Adding all Administrative Centers linked to a partner on the facturae
  electronic invoice

Since often the three required Administrative Centers (Fiscal, Receiver
and Payer) are the same, we allow the user to specify multiple roles
on an Administrative Center.

Demo data was also added for the Administrative Centers and updated to
pass the facturae validator.

For stable versions, we use a patch module to not break things.
This should be moved to the main module in master.

task-3599447

closes odoo/odoo#146675

X-original-commit: 7c4e846f023f92f48ee465008769848075757a29
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2023-12-19 09:36:55 +00:00
Rodolpho Lima df18b57e53 [FIX] web_editor: embed video on paste URL
Before this commit, pasting a URL as plain text followed by picking
"Embed Youtube Video" in the command bar failed to embed the video,
inserting the following text instead: "[object Promise]".

This happened because [1], which is the result of a forward-port, failed
to `await` the call to getYoutubeVideoElement, which is an async
function since version 15.2.

[1]: https://github.com/odoo/odoo/commit/c2f0519fec40dcf529218f39829e0a09c0f7af69

task-3611566

closes odoo/odoo#146653

X-original-commit: 4891359210e2f921dbfb6d7c870ec5cf1b60d3f5
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
2023-12-19 09:36:54 +00:00
Aditya Dubey 3d226f3eff [FIX] hr_holidays: fixed user access right in kanban view
Steps:
- Open Time Off module
- Navigate to user's kanban view
- Without any HR app access, mouseover a leave request
- Approve/Refuse buttons appear even when user lacks necessary permissions

Issue:
- Users without any HR app access rights are still able to see "Approve" and
"Refuse" buttons from the kanban view.

Cause:
- The kanban view does not properly check for HR app permissions before
displaying the "Approve" and "Refuse" buttons.

Fix:
- Updated the kanban view logic to hide the "Approve" and "Refuse" buttons for
users who don't have the necessary HR app access.

Task-3507942

closes odoo/odoo#145352

X-original-commit: 4a30e170d4b0bea0b1178dc67c41bdfe83bbe884
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-12-19 09:36:52 +00:00
sabr c2440fa562 [FIX] base: prevent traceback while invalid context pass
This issue occurs when a customer passes an invalid context in the view, at that
time this error will be generated.

Steps To Produce:-
- Go to `Settings >Technical >User Interface >Views`
- Open any view
- pass invalid context like
`context="{'search_default_demo': active_id}, 'search_default_x_stage_id':[3]}"`
-error will be generated

error-SyntaxError
unmatched '}' (<unknown>, line 1)

after this commit, we can display Validation Errors to users instead of a
traceback when they make mistakes in any UI view.

sentry-4684090820

closes odoo/odoo#145193

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-12-19 09:36:51 +00:00
Thomas Lefebvre (thle) 9b9e900dad [FIX] hr_holidays: keep company calendar if several employees
Steps to reproduce:
-------------------
- modify the company calendar to get an other value than 8 average hour per day;
- add this calendar to two employees (A and B);
- create a type of leave for the current company;
- create an allocation for the employee A for this type with X hours without saving;
- add the employee B;

Issue:
------
The number of hours is modified.

Cause:
------
There is an inconsistency between `_compute_number_of_hours_display`
and `_compute_from_holiday_status_id` methods.

In the `_compute_from_holiday_status_id` the number of hours is determined
according to order: employee calendar --> company calendar --> constant (8 hours)

In the `_compute_number_of_hours_display` the number of hours directly falls back on
the constant if we don't find an employee for a type of leave that is employee.

In the case of multiple employees, we will always use this constant,
whereas we use the company calendar in the other method.

Solution:
---------
Keep the company calendar if you don't have an employee before falling back on a constant.

opw-3617281

closes odoo/odoo#146730

X-original-commit: 55f24b4f07eaa4527559a2819e264b4809a6b21f
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-12-19 08:12:30 +00:00
Valeriya(vchu) 7e902f8cef [FIX] website_sale_picking: add missing module_id field
Before this commit: there was no stat button 'publish' displayed for
payment provider 'pay in store'.

Reason: The stat button is shown when the module is installed but there
was no connected module on the 'payment_provider_onsite' record.

With this commit the module_id is added.

closes odoo/odoo#146349

X-original-commit: 4480fe7c990c498175f8e7ed75a1abf34bef9547
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Valeriya Chuprina (vchu) <vchu@odoo.com>
2023-12-19 08:12:27 +00:00
Paul Stroobant 6caf040e3a [FIX] base: remove private address in contact type help
Steps to reproduce issue:

1. Open Contacts
2. Select a contact
3. Choose:
    - Add an address
    - Only if contact is individual: Select drop-down menu next to Address fields in form
4. Private Address doesn't show in the options

Explanation:

Private Address was intentionally deleted from `res.partner.type` in *v16.4* (cf. b1f7e56f79).

Suggested change:

Remove Private Address paragraph in `res.partner.type.help`, it should not exist anymore.

opw-3602922

closes odoo/odoo#146298

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-12-19 08:12:27 +00:00