Commit Graph
167442 Commits
Author SHA1 Message Date
Romeo Fragomeli 99372adeeb [FIX] web: avoid moving fullscreen dialog on small screen
On "small screen" (especially on Mobile), all dialogs are in fullscreen,
so we don't allow moving the dialog as there is no enough space
available on the screen.
This commit disallows the use of `useDialogDraggable` on "small screen".

Steps to reproduce:
* Open Odoo in "small screen"
* Go to Sale App
* Create a new SO
* Click on the Customer field
* Use the mouse to move the fullscreen dialog (modal's header) => BUG

closes odoo/odoo#141482

X-original-commit: c5f2bd38a3175d7a4ce471dbb91a54f0c3378d10
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-11-08 04:09:56 +00:00
xmo-odoo fc7804b14e [FIX] onboarding: dependencies
When onboarding was updated to override web assets in 518a4e4c43 it should also have been updated to *depend* on web.

closes odoo/odoo#141474

X-original-commit: 76907e3b34d8e33943024772e373fd0c3228b1f8
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-11-08 04:09:56 +00:00
Chong Wang (cwg) 1a7978e509 [FIX] base: fix update translations for base field
in #124402
`update_field_translations` will call `write` to trigger all override logics.
But for ir.model.fields, write will call init_model which may remove all
translations. This commit fix the issue by adding a bypass for translate_only
`write`.
(this commit is the merge of #141126 and #140695)

opw-3575512

closes odoo/odoo#141472

X-original-commit: 33f08c40c92429ada6c5b0387f36d32d4825fcb6
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Chong Wang (cwg) <cwg@odoo.com>
2023-11-08 04:09:54 +00:00
Rodolpho Lima 9728715bdb [FIX] web_editor: remove tooltip in HtmlField
Since [1] the behavior for double-clicking an image in an html field is
displaying it "full-screen", and no longer opening the Media Dialog to
edit it. But, when an image is (single) clicked, a tooltip is displayed
with the misleading "Double-click to edit" message.

This commit makes sure the tooltip is no longer displayed in HtmlField,
while keeping its original behavior for other forms of use of the
Wysiwyg component, like in website.

[1]: https://github.com/odoo/odoo/commit/8ca115b3b9dfe87b59b6b064a4d85ea152d9214c

task-3542766

closes odoo/odoo#141471

X-original-commit: 7cf2896ccb47c7832663cd42b9f22899f4eb5d3c
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
2023-11-08 04:09:53 +00:00
Julien Carion (juca) 52fb449f90 [FIX] web: domain selector: fix reset domain button style
Styling for domain selector's reset domain button was lost in
https://github.com/odoo/odoo/pull/128680. This commit simply brings it
back.

closes odoo/odoo#141470

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-08 04:09:52 +00:00
william-andre 3529e11ab2 [IMP] account: order by payment date in amounts to settle
Better usability, we want to reconcile the later invoices first.
Also removing the group by partner because most people will only have a
few lines per partner, so reducing noise. It also doesn't make sense
because we are not displaying credit notes anymore (separate action)

closes odoo/odoo#141457

Signed-off-by: William André (wan) <wan@odoo.com>
2023-11-08 04:09:51 +00:00
william-andre 32c2c5378c [FIX] account: filter due date
The filter was considering the Accounting date, which has nothing to do
with the due date.

Part-of: odoo/odoo#141457
2023-11-08 04:09:51 +00:00
william-andre 072c7ee50f [FIX] account: group by payment date
Reproduce:
* Accounting > Vendor > Amounts to Settle
* Group By: Due Date (any)

There is an error because `payment_date` is not stored.

We also allow more operators in `_search_payment_date` because the
`read_group` will use `<=` and `>=` to open the groups. We still
transform `=` to `<=` to enable the quick search.

Part-of: odoo/odoo#141457
2023-11-08 04:09:51 +00:00
Xavier Bol (xbo) 349915dfc3 [FIX] project: hide name field in project list view
The name field has been to be able to order on it but it is added
and just invisible instead of completely hide the column.

This commit changes `invisible` attribute to `column_invisible` to
completely hide that field in the project list view.

closes odoo/odoo#141455

X-original-commit: 62f49331ba
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-11-08 04:09:50 +00:00
Anh Thao Pham (pta) 466d0188db [FIX] account: fix foreign taxes creation with group-type taxes
Steps to reproduce:
- Install Accounting
- Create a fiscal position for a foreign country:
  * Country: [Any country that has group-type taxes] (e.g. Italy)
  * Foreign Tax ID: [any tax ID for that country] (e.g. IT12345670017)
- Click on the "here" button appearing in the banner
(Click "here" to create the taxes for this country.)

=> A ValueError is raised.
"External ID not found in the system: account.1_22vsp"

Cause:
During the creation of the taxes, the xml_id of each tax is prefixed
with the chart template code to avoid collision.
However, when linking a group-type tax to its children taxes, it cannot
find them because they are prefixed but the group-type tax is using their
unprefixed value.

opw-3518213

closes odoo/odoo#141448

X-original-commit: 3c22a2d4766e2401e25f2fe8eb0aadc0e9f77524
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2023-11-08 04:09:49 +00:00
Rodolpho Lima 8ccaf36d10 [FIX] web_editor: abort rpc on ChatGPT dialog close
Before this commit, when the ChatGPT prompt dialog was closed while
waiting for a response, the "loading" overlay would be present until
such response was complete.

Moreover, in certain occasions, the rpc callback, called after the
component was destroyed, could lead to a traceback due to reading a
property of a no longer existing reference to the prompt input element
(namely, in the `_unfreezeInput` method).

This commit improves the user experience by unfreezing the UI on dialog
close, even if a response is pending, and prevents the rpc callbacks
from running after the component is destroyed.

task-3586380

closes odoo/odoo#141442

Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
2023-11-08 04:09:47 +00:00
Benjamin Vray 180c0c043d [FIX] web_editor: fix toolbar buttons alignment
This commit fixes the layout of icons and labels in the "AI",
"Animate", "Highlight" buttons of the text toolbar in Website edit mode.

Before this commit, there was too much space between the icon and the
label of the "AI" button and not enough space between the icon and the
label of the "Animate" and "Highlight" buttons.

task-3586280

closes odoo/odoo#141440

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-11-08 04:09:46 +00:00
sofiagvaladze 755a3aae1b [FIX] resource: do not update attendance_ids when there is no company
On the 'resource.calendar', attendance_ids is a computed field and
computation is triggered when company_id is changed.

Now, if we remove company_id, attendance_ids are left empty.
Instead, attendance_ids should be updated only when there is a new company set.

task - 3451264

closes odoo/odoo#141433

X-original-commit: af3bff0c578fdbd47a3584cf9e25f3e558cdefc0
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-11-08 04:09:45 +00:00
Paolo Gatti (pgi) 81675e9400 [IMP] l10n_it_edi: new translations
The new refactorings of the Italian EdI require updated translations.

Task link: https://www.odoo.com/web#model=project.task&id=3263708
task-3263708

closes odoo/odoo#141428

Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-11-08 04:09:44 +00:00
Bruno Boi ea83d3eb57 [REV] website: revert UrlAutocomplete displayed behind modal
This reverts commit 6c749a4b0d.

This commit was fixing an issue raised after a fix [1]
that is about to get reverted [2].

We will make a proper fix after the OXP2023 event.

[1]: https://github.com/odoo/odoo/commit/9682cfa174fb39ec9d9874951ea9ee2884058d96
[2]: https://github.com/odoo/odoo/pull/141401

closes odoo/odoo#141405

Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2023-11-08 03:00:13 +00:00
snd 5f85596621 [FIX] stock: remove show_reserved from picking type view
The field is now readonly and computed, so there's no reason keeping it.

closes odoo/odoo#141390

Related: odoo/enterprise#50346
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-11-08 03:00:11 +00:00
Sébastien Geelen (sge) 0605d9357e [FIX] web_editor: handle empty history patch
Change the history diff_util to be able to handle
empty patch without crashing.

Add unit tests accordingly.

task-3583986

closes odoo/odoo#141387

Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
2023-11-08 03:00:10 +00:00
Nicolas Bayet d041044dbb [IMP] web_editor: prevent behaviors when an element is protected
In order to be able to create dynamic widgets to the editor, this
commit reinforce the concept of data-oe-protected by preventing the
default behavior for _applyRawCommand, on paste, on input and on
keydown.

closes odoo/odoo#141385

Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2023-11-08 01:22:01 +00:00
Nicolas Bayet 06bfcfff9a [IMP] web_editor: add oe_movable to move elements in the editor
In order to let third party code set a node to be movable, this commit
adds a class to set a node to be movable in the OdooEditor.

closes odoo/odoo#141384

Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2023-11-08 01:22:01 +00:00
Mahamadasif Ansari ef5ca752de [REM] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Ref-https://github.com/odoo/odoo/pull/130467

task-3508331

closes odoo/odoo#141383

Related: odoo/enterprise#50344
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-08 01:21:59 +00:00
Didier (did) bcf64fa885 [FIX] mail: mark as read can ignore 404 error
404 means that the thread was deleted

Task-3577083

closes odoo/odoo#141372

X-original-commit: 6aeb00d7e3b60f9eb0cb968fe16ba1a333076ec3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-11-08 01:21:58 +00:00
Didier (did) b160005840 [FIX] mail: reset bus notification before testing
Before this PR, bus notification was not reset before testing the bus
notification of link previews.

https://runbot.odoo.com/web/#id=28333&view_type=form&model=runbot.build.error&menu_id=405&cids=1

closes odoo/odoo#141419

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-07 23:57:47 +00:00
Guillaume-gdi 2f3219c08f [FIX] web_editor, website: hide some text style outside the website app
This commit removes some text style options when the editor is used in
the backend. In the website it makes sense to have all the options but
in the other apps, it is not necessary to have all the options.

task-1958098

closes odoo/odoo#141412

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-11-07 23:57:46 +00:00
Arnaud Joset 080688868e [FIX] calendar: test was trying to send mails for past events
Before this commit, the test was trying to send mail for a past event.
It would fail with the following error:

```
FAIL: TestCalendar.test_event_creation_mail
Traceback (most recent call last):
  File "/data/build/odoo/addons/calendar/tests/test_calendar.py", line 329, in test_event_creation_mail
    _test_one_mail_per_attendee(self, partners)
  File "/data/build/odoo/addons/calendar/tests/test_calendar.py", line 311, in _test_one_mail_per_attendee
    self.assertEqual(len(mail), 1)
AssertionError: 0 != 1
```

https://runbot.odoo.com/web/#id=29871&view_type=form&model=runbot.build.error&menu_id=405&cids=1

closes odoo/odoo#141411

X-original-commit: 2b0bedf5a57ca2733501359fb8cc8e5bc743a4fa
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-11-07 23:57:45 +00:00
william-andre a5f00ac011 [FIX] analytic: plan column not created
Reproduce:
* create a sub-plan (with parent_id)
* make that plan a main plan (void parent_id)
* open the analytic line view

Result:
Traceback because the dynamic field was not created

closes odoo/odoo#141409

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-11-07 23:57:44 +00:00
Brieuc-brd 2057fdb2e1 [FIX] web: reintroduce text-effect UI icon
Commit 70f853aab9 introduces `oi-smile-add` UI icon but it also
removes by mistake `oi-text-effect` icon.

This commit reintroduces `oi-text-effect` icon.

task-3586386

closes odoo/odoo#141408

Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2023-11-07 23:57:43 +00:00
Antoine Vandevenne (anv) 1fb7571afb [FIX] *: retarget documentation links to 17.0
closes odoo/odoo#141406

Related: odoo/enterprise#50357
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-11-07 23:57:41 +00:00
Mathieu Duckerts-Antoine fe9b2a8a71 [FIX] web: model field selector: communicate path in debug input
Have the model field selector popover open, modify the path in the
debug input (bottom input available when isDebugMode=true), then close
the popover by clicking away. The model field selector is correctly
updated but its parent does not receive the right path. This happens
because onClose is called before the function update passed to the
popover is called.
Here we make the popover communicate its current path on each input
event so that if the popover has to be closed, the model field selector
knows which path to communicate to its parent.

closes odoo/odoo#141362

X-original-commit: 6a4e4221a1daa474217070f6a78602a962bbcf65
Related: odoo/enterprise#50337
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-11-07 21:02:33 +00:00
Mathieu Duckerts-Antoine c4b8e05009 [FIX] web: model field selector: falsy paths
Since the refactoring of the model selector [https://github.com/odoo/odoo/commit/ebf646b44f747567ff8788c884f7f18dffd453e0], it is now more possible
to clear a selected field name (i.e. reset the path to "").

This has lead to an unsatisfactory situation when creating filters in a
spreadsheed. Indeed, the proper functioning of the interface was heavily
relying on that possibility.

In this fix, we introduce a new prop "allowEmpty" that if set to true
allows to clear the selected path and improve the display of falsy paths:
for a falsy path, the model field selector is empty and does not have a
warning message.

X-original-commit: 0244b0a7092b4c68e9f5cd4926b3017ea32b91de
Part-of: odoo/odoo#141362
2023-11-07 21:02:33 +00:00
qsm-odoo 8b7b4f7fb4 [FIX] web_editor: properly update grid/col buttons on mobile view toggle
Commit [1] introduced the grid mode for multi-column snippets, with
discriminating behavior between mobile and desktop previews.
When toggling multiple times the mobile view, the buttons above the
block sometimes remain in their previous state. The `updateUIVisibility`
trigger doesn't seem to go through.

Step to reproduce:
- Drop an Image - Text snippet
- Activate the grid mode
- Click on a column
- Toggle the mobile view until either of the following happens:
  - When going from desktop to mobile: the buttons are still the ones
    that should appear on desktop (send to front, send to back, move
    handle and delete).
  - When going from mobile to desktop: the buttons are still the ones
    that should appear on mobile (left/right arrows and delete).

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

task-3551537

closes odoo/odoo#141359

X-original-commit: 174e9fe0d8665d1a81c90a6f7bf5cc9e3361f161
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-11-07 21:02:31 +00:00
Martin Trigaux bb1984d915 [FIX] mass_mailing: correctly compose the Markup message
Was logging
<ul>&lt;li&gt;Test mailing successfully sent to foo@example.com&lt;/li&gt;</ul>

closes odoo/odoo#141327

X-original-commit: e382f505b2061e5043bfb79a5c0f2787e40fae8b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-11-07 21:02:29 +00:00
Didier (did) 4064508af5 [IMP] mail: send cache control header on avatars
Before this PR cache control header for avatar was set to no-cache which is not
the right value.
This PR mark the avatar routes response as immutable when a unique string is
present. We also use the partner write_date as unique string when possible.

task-3551636

closes odoo/odoo#141326

X-original-commit: 3de4f1f1225229cbdb0512df5790ce491f04ea7e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-07 21:02:27 +00:00
Pierre Pulinckx (pipu) 7b1dd79f46 [FIX] web: localize date/datetime in domain descriptions
The date/datetime values produced in the domain selector for
date/datetime fields are not localized (like they are in the date
picker) when presented in :
- the domain selector in readonly mode
- the facets edited/created from the domain selector dialog
Here we make sure that the localization parameters are used when we
display date/datetime values in the domain descriptions.

closes odoo/odoo#141304

X-original-commit: bd1f5dc017a2549889002d5ff5382cbd3be6580b
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-07 21:02:26 +00:00
Antoine Guenet 9266a8e800 [FIX] web_editor: check node is connected before reverting next to it
When reverting history removal steps, we check that the next node or the
previous node exists so we can add the removed node next to it. But we
failed to check that the node was still connected to the document.

closes odoo/odoo#141303

Related: odoo/enterprise#50304
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2023-11-07 21:02:24 +00:00
Antoine Guenet 16d6c250a5 [FIX] web_editor: do not preserve out-of-editable cursor in sanitize
When sanitizing the content of the editor, we should not move the
cursor if it is out of the editable area.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet 708cc85261 [FIX] web_editor: do not call closest on non-Element node
The `closest` method is only available on the Element class.
`parentElement` guarantees the returned node will inherit from the
`Element` class, which `parentNode` does not. This replaces calls to
`closest` on nodes returned by `parentNode` so that they are called on
`Element` nodes instead.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet 2f1786c5d2 [FIX] web_editor: ensure observer is always disabled for link zws
To prevent history steps that include the link zws, we need to ensure
that the observer is always disabled when the link zws is inserted or
removed.

Due to these changes, we need to initialize `_currentStep` before
setting the original link zws, so that `observerApply` can access it in
the process of pausing the mutations observer.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet ef11e75b70 [FIX] web_editor: prevent link isolation in non-editable links
The link isolation mechanism should not be applied in non-editable
links. It also should not be applied in Bootstrap navigation as we don't
want it to behave like a list of links and not to insert non-link
content between the navigation elements.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet 3bc23ce5a5 [FIX] web_editor: properly implement Powerbox navigation test
A Powerbox test was executed without first setting the selection in the
DOM, which caused the Powerbox to close immediately. It also omitted to
reopen the Powerbox after the first command selection, before using the
arrow keys to navigate through the commands.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet 69b92cad60 [FIX] web_editor: wait one tick after triggerEvent in tests
We need to wait one tick after `triggerEvent` to be sure that the
event's listeners are resolved before checking the result. Some tests
did the waiting after calling `triggerEvent`, but some didn't. This
includes the waiting in `triggerEvent` itself.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet b031af6c6a [FIX] web_editor: toggle checklist on element with class
When transforming an element into a checklist, we were first creating
the checklist and therefore adding the necessary class to the list
element, and then applying all the attributes of the original element to
the list. This was causing the class to be removed is the original
element contained a class attribute.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet 05524a5b7a [ADD] web_editor: add tests for moving in/out of links with arrow keys
This adds a few tests to check that the link isolation is working.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet 8f1d33ac42 [FIX] web_editor: wait for selectionchange on set test selection
The selectionchange event is triggered one tick after the selection
changes so we need to wait for it to be triggered before moving forward
with testing.

Doing this implied correcting a test: as we were not waiting for the
selectionchange event, we were not taking advantage of some corrections
applied there.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet 34ff41f797 [FIX] web_editor: do not normalize on preserveCursor
When preserving the selection, we typically want our selection to remain
as close as possible to what it was before. But `preserveCursor` called
`setSelection` with its default `normalize` argument, which would change
the selection in sometimes unexpected ways.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet 0f4914a157 [IMP] web_editor, project: remove attributeless spans/fonts on sanitize
`<span>` and `<font>` elements without attributes are useless and can be
removed. Removing them will make the editor output more readable and
will prevent endless nesting of attributeless `<span>` and `<font>`
elements when successively styling, unstyling and deleting text.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet 37cfea537c [FIX] web_editor: remove empty classes and styles
This commit removes empty classes and styles from the editor on clean
for save.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet 79f5f0619e [ADD] web_editor: add style on link with selection
This adds a style on the link that currently hosts the selection, to
make it clear that the next character input will happen inside.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet b18a8ab05d [FIX] web_editor: handle selection at edges of links
This replaces the link isolation mechanism with a more robust one that
doesn't require setting the `contenteditable` attribute on the editable
to `false` (which is rife with issues). In so doing, we also improve the
handling of selection at the edges of links, making a clear distinction
between the selection being inside the link or outside of it.
Note: we only do this for collapsed selections, as it's not clear what
should happen when the selection is not collapsed.

task-3103566

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet e5d7affed5 [FIX] web_editor: ensure standard selection before running tests
Some editor tests may be sensitive to the existence or not of a
selection in the DOM before initializing the editor. The first test to
be run won't have a selection before the editable is initialized, but
every subsequent test will (removing the test node add the end moves the
selection to its parent). One particularly problematic consequence
concerns tests that would fail with an initial selection but succeed
otherwise. Such a test would only fail when run after another test, but
not when run alone.

This commit prevents this confusing debugging situation (and potential
false negatives) by setting a selection at the beginning of the testNode
by default before running each test, ensuring that each test has the
same initial conditions.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00
Antoine Guenet fff405a6c2 [FIX] web_editor: temporarily skip mobile tests
The editor mobile tests are making wrong assumptions about the way the
editor behaves on mobile and are therefore wrong. This temporarily
disables them until the discrepancy is resolved.

Part-of: odoo/odoo#141303
2023-11-07 21:02:24 +00:00