Commit Graph
150754 Commits
Author SHA1 Message Date
Antoine Dupuis (andu) 7cb109e7b0 [FIX] account: fix write-after-post in PR 91638
PR 91638 introduced a write() on the partner_id  after the AML state
was set to 'posted'.

This causes a problem for users who have the journal hash activated.

Fix => move the write() before posting the AMLs.

closes odoo/odoo#91997

X-original-commit: cd3bbeb15983b263ba2ffb419d59575b64a41ca2
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
2022-05-23 09:57:42 +02:00
Xavier-Do cb9b93b5c4 [FIX] core: ordered to_compute
Set order is not randomized for integers (integer hash is the integers
itself and doesnt use pythonhashseed)
but the output may be ordered or not depending of the values:

In [2]: list(set(range(126,130)))
Out[2]: [128, 129, 126, 127]

In [3]: list(set(range(130,134)))
Out[3]: [130, 131, 132, 133]

This will lead to different results in query count tests depending on
the current value of the sequence.

The proposed solution is to use an Orderedset. We need to keep in
mind that the initialisation/operation on Orderedset may be slower but
this shouldn't represent any significant overhead in this case.

closes odoo/odoo#91962

X-original-commit: da66b8fc008f97680584e266135b7fa7d3dedeca
Signed-off-by: Rémy Voet <ryv@odoo.com>
2022-05-23 08:30:14 +02:00
Xavier MorelandRaphael Collet 6c872f6c19 [FIX] core: _get_external_ids to behave better in onchange context
If `_get_external_ids` is called in an onchange context on a newid
wrapper, the result map uses NewId keys but the assigned data uses
real ids, which leads to a mis-setting, and usually the call blowing
up immediately as `data['res_id']` is not one of the preallocated dict
entries.

Update the code to better handle this possible difference.

closes odoo/odoo#91957

X-original-commit: 5797fd80a63309269f15bcbe4948d4429a53eec2
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2022-05-23 08:30:11 +02:00
FrancoisGe ac66c26097 [IMP] web: CP add custom placeholder by namespace
This commit adds the possibility to have a custom placeholder in the
command palette depending on the namespace.

closes odoo/odoo#91947

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-05-23 08:30:04 +02:00
Odoo's Mergebot 07951f15fb [FW][FIX] adapt odoo 15.0 to work with ubuntu jammy
Ubuntu Jammy brings some breaking changes for odoo 15.0. Since 15.0 is still the main branch, this pr aims to ensure compatibility if deployed on ubuntu Jammy.

Main changes:
- python 3.10
- werkzeug 2.0+, including vendoring werkzeug's user agent parser in `odoo/tools/_vendor/useragents.py` (= the one from version 0.16) as it is discontinued after v2.1
- currentThread is now deprecated (use current_thread instead)
- default requirement version (based on deb package version)
- new opcode in python 3.10
- distutils.version.LooseVersion is deprecated

- wkhtmltopd version packaged with ubuntu jammy don't have patched qt but will work without headers and footers. Suggested wkhtmltopdf version 0.12.5 doesn't have a build working with jammy yet because of incompatible libssl dependencies.  A parallel wip may provide a 0.12.5 version compatible with jammy latter (currently used as testing version on runbot). If this solution is chosen, this build may be provided by odoo latter.

As usual, all changes are made with the spirit to keep compatibility with previous version (Focal)

enterprise PR: https://github.com/odoo/enterprise/pull/26831

closes #84097
closes #88980
closes #89533
closes #78020
closes #83309
closes #87463

closes odoo/odoo#91927

Forward-port-of: odoo/odoo#91543
Forward-port-of: odoo/odoo#88803
Related: odoo/enterprise#27601
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-05-23 08:29:56 +02:00
Julien Castiaux 8f52bdf9f4 [FIX] test_http: unreliable tests
Part-of: odoo/odoo#91927
2022-05-23 08:29:55 +02:00
Christophe Monniez d2b7a601ba [FIX] test_crm_full: bump query count
This query count test fails deterministically on runbot when built with
Ubuntu Jammy. After some investigations, it appears that this query
count is very indeterministic and will be fixed in #91386.
Until that, the expected count is bumped.

Part-of: odoo/odoo#91927
2022-05-23 08:29:55 +02:00
Christophe Monniez 567721d136 [FIX] populate: force integer for randint
random.randrange needs integer values since python 3.10. As randint uses
randrange, we cast the seconds into integer.

Part-of: odoo/odoo#91927
2022-05-23 08:29:55 +02:00
Xavier-Do 482057043f [FIX] http, web: use Response instead of BaseResponse
Part-of: odoo/odoo#91927
2022-05-23 08:29:54 +02:00
Xavier-Do 1824f32f58 [FIX] http: use vendored user agent parser
Part-of: odoo/odoo#91927
2022-05-23 08:29:54 +02:00
Christophe Monniez e2ff2fd29b [FIX] link_tracker, pos_mercury: use unescape from html
As werkzeug.utils.unescape is deprecated in werkzeug 2.0 and the
markupsafe version of unescape just uses the built-in html.unescape [0],
we can use directly the same built-in method.

[0]  pallets/markupsafe@c35603a903

Part-of: odoo/odoo#91927
2022-05-23 08:29:54 +02:00
Christophe Monniez ba1724732c [FIX] core: ignore invalid escape sequence in 3.10
Since Python 3.10, the invalid escape sequence warning use quotes to
display the invalid sequence. Because of that, the filter does not catch
it anymore.

With this commit, they are caught in all supported versions.

Part-of: odoo/odoo#91927
2022-05-23 08:29:54 +02:00
Christophe Monniez 082a5a1a98 [FIX] report: replace deprecated LooseVersion method
With this commit, the LooseVersion function comes from distutils which
is deprecated [0] in Python 3.10 is replaced by parse_version.

[0]: https://peps.python.org/pep-0632/

Part-of: odoo/odoo#91927
2022-05-23 08:29:54 +02:00
Christophe Monniez 27a7d4822f [FIX] server: replace deprecated daemon getter/setter
Since Python 3.5 the isDaemon and setDaemon methods can be replaced by a
property. As it's now deprecated in Python 3.10, the Time has come.

[0] https://docs.python.org/3.5/library/threading.html#threading.Thread.setDaemon

Part-of: odoo/odoo#91927
2022-05-23 08:29:53 +02:00
Christophe Monniez f629cf5fee [FIX] safe_eval: add new py 3.10 GEN_START opcode
Part-of: odoo/odoo#91927
2022-05-23 08:29:53 +02:00
Christophe Monniez 22448d76da [FIX] requirements: adapt for ubuntu Jammy
Part-of: odoo/odoo#91927
2022-05-23 08:29:53 +02:00
Christophe Monniez 65c8814a2f [FIX] various: replace deprecated currentThread method
CurrentThread is now really deprecated in Python 3.10 ... Time to
change.

Part-of: odoo/odoo#91927
2022-05-23 08:29:52 +02:00
Olivier Dony 959059fb5e [FIX] _vendor: fix compatibility with werkzeug 2.0+
As of werkzeug 2.0, the `posixemulation` compatibility layer for atomic
rename operations is abandoned[1]. In the mean time an atomic,
cross-platform file renaming function was introduced in the stdlib, as of
Python 3.3: `os.replace()`.

By using `os.replace()` instead of `posixemulation.rename()`, we can
ensure compatibility with versions 0.x, 1.x and 2.x of werkzeug.

We've always required Python 3.5+ since the P3 support, so
`os.replace()` is always available.

This is a follow-up of the work for supporting werkzeug 1.x [2]

References:
[1] https://github.com/pallets/werkzeug/pull/1790
[2] vendoring of werkzeug.sessions: odoo/odoo#45931

Part-of: odoo/odoo#91927
2022-05-23 08:29:52 +02:00
Xavier Morel 2041f55c85 [FIX] auth_oauth: restore fetching uid from user_id
In discussing 56fe16bd I was reminded to re-set the `user_id` from
`sub` in case an override / other client would be using it, but we
didn't think that an override might also be *setting* this work key,
which apparently is the case.

Therefore restore the old behavior of *getting* the user_id from the
response object, migration to using `sub` (and removal of compat with
`user_id` and `id`) will be done when the module is reworked and the
flow compatibility, nonce, etc... are all fixed.

closes odoo/odoo#91996

X-original-commit: a787a2f644e9e83dc6320eaf372e657718fd2e22
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-05-23 07:33:43 +02:00
Christophe Monniez c16f35387f [FIX] tests: fix test retry mechanism for subtests
When a subtest fails, the failure or error is taken into account and even if
the subtest was silenced the test itself logs an ERROR with the count of
failures.

With this commit, at the first try, the subtest result is not taken into
account.

closes odoo/odoo#91974

X-original-commit: 96ca5bb6d7aeb54dfb8d5453edaf04b2ea903d41
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-05-22 09:03:51 +02:00
alt-odoo e7ebb669db [FIX] website_hr_recruitment: allow portal users to filter by department
Currently, only a public user or an internal user can access HR
department information. This is causing an access rights error when
trying to filter job offers on the website if connected with a portal
user, while there is no error if not connected (public user). We should
have the same behavior for the two cases.

closes odoo/odoo#92003

X-original-commit: 689a3aa9bf08bf3567c0fa0cc4cf67cc3d7e0b54
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
2022-05-21 12:10:11 +02:00
qsm-odoo aa468fe0b6 [FIX] base: remove branding on nodes whose inner content is removed
Parent view:
```
<hello>
    <world></world>
    <world></world>
</hello>
```

Child view:
```
<data>
    <xpath expr="/hello/world[1]" position="replace"/>
</data>
```

=> There are two <world/> in the original view, the first one is removed
   by a child view.

In that case, the branding was still distributed on the <hello> element.
This is a problem as it meant that in edit mode you were able to edit
the whole content of that <hello/> element... breaking the xpath made by
the child view.
After this commit, in that case, the branding is rightfully distributed
on the remaining <world/> element (just like it would have been if the
inheriting view had added an element instead of just removing one).

This is a follow-up of the parent commit (of the same PR at [1]).

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

Related to opw-2811674

closes odoo/odoo#91991

X-original-commit: abd9d7a74c91f4632550a376fe566ac28e64377b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-05-20 22:05:47 +02:00
qsm-odoo 89f9bb887a [FIX] base, tools: properly distribute branding around removed elements
When branding was added on items which follow an element that is removed
by an inheriting view, the branding was incorrect. Indeed, it supposed
the removed element does not exist in the original view. E.g.:

Parent view:
```
<hello>
    <world></world>
    <world></world>
    <t t-esc="foo"/>
</hello>
```

Child view:
```
<data>
    <xpath expr="/hello/world[1]" position="replace"/>
</data>
```

=> There are two <world/> in the original view, the first one is removed
   by a child view. The data-oe-xpath set on the remaining <world/>
   should still be /hello/world[2] and not /hello/world[1] to target the
   right element in the parent view.

This of course induced edition problems where a saved area was not saved
inside the right element of the parent view or, more likely in normally
complex arch, just crashed on save. As an example, with 14.0 enterprise:

- Install website_appointment
- Go to a page with a calendar to schedule an appointment
- Enter edit mode, try to add something in the area *below* the calendar
- Save => crash

Commit [1] already fixed similar problems when an element was *replaced*
by something (especially, when replaced by an element with the same tag
name). This commit actually reviews what was done to fix both problems
(replacement and removal) at the same time. It also makes it so the xml
that `apply_inheritance_specs` produces has no "Element" part impacted
when used with "inherit_branding=True", which seems better... although
the notion of inheriting branding should probably be independant from
this function (maybe something to do in master).

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

opw-2811674

X-original-commit: 4ab569933464617444f6150793876ff4eba11690
Part-of: odoo/odoo#91991
2022-05-20 22:05:47 +02:00
David Monjoie 7a14ea6986 [FIX] web_editor: prevent media selection during search
When updating the results following a change in the search filter or the
source sources filter (All, Illustrations, ...), the list of media is
regenerated to match the new results. If the user clicks on one media at
the right time after the search is triggered (not too fast but not too
slow either) it is possible to select a media which id is out of sync
with the new state of the widget, thus prompting `_onAttachmentClick` to
provide `undefined` to `_selectAttachment`, which ultimately leads to a
traceback in `_highlightSelected` when accessing either `media.id` or
`attachment.id` depending on the case.

This commit fixes the issue by disabling pointer interactions with
the attachments during the search and rendering update process.

closes odoo/odoo#91985

X-original-commit: bc9db4e5a5559692f461acc7402df969b6236481
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-05-20 21:09:08 +02:00
Federico (fega)andAndrea Grazioso 9c35ab88fc [FIX] account: multi-company error bill created by email with alias
Steps to reproduce:
- Set up an alias to receive vendor bills to company 2
- Forward a mail to this alias from an internal user
- The mail should have the email address of a partner belonging to company 1 in it

Current behavior:
- The partner from company 1 can be set as vendor even tho the vendor bill will be from company 2 (inconsistent)
- This leads to a multi-company error, and you can't open the bill as an user who can see it but not the partner.

Intended behavior:
- Partner from company 1 shouldn't be set as vendor if the vendor bill has been created from email alias of company 2.

As the intended behavior says, the code avoids to set the vendor if the bill is created through an alias.

opw-2587047

closes odoo/odoo#91973

X-original-commit: 4d5bb1fd46546870cd10d8dcd5b229de68a2e284
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: Andrea Grazioso (agr-odoo) <agr@odoo.com>
2022-05-20 21:09:04 +02:00
Mathieu Duckerts-Antoine 01d7f98e24 [IMP] web: search: domain evaluation uses action context
It is now possible to get access to the action context keys when the
search filters are evaluated. This means that a search arch filter like

    <filter name="my_filter" domain="[('my_field', '=', context.get("my_value))]"/>

can be safely evaluated if "my_value" is in the action context (or in
the user context or is builtin as before).

closes odoo/odoo#91959

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-05-20 21:09:00 +02:00
Nicolas Bayet 36e80e02a8 [FIX] web_editor: fetch undraw images in website and note
task-2794153

closes odoo/odoo#91970

X-original-commit: 536b2ff35f28836ef14cbb353b4749adee21aaad
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-05-20 20:14:23 +02:00
Zodk2 585ce0e380 [CLA] Signature for Zodk2
closes odoo/odoo#91964

X-original-commit: e7fa830b5a869774cd2853c55ddceb9b2611a6b1
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-05-20 20:14:20 +02:00
tsm-odoo ec532560d9 [IMP] mail: move discuss widget remaining logic to discuss_container
This PR prepares the ground for the one introducing the new environment in the discuss
app. Indeed, the discuss widget will be removed since it was used as an action. The discuss container
will instead be added to the action registry.  Now that the logic has been moved to the discuss_view
model, we can move the logic inside the init function to the discuss_container setup.

task-2582313

closes odoo/odoo#91890

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-20 20:14:16 +02:00
kais-odoo a6be4dea7c [IMP] rating: rename the title of rating submit page
Purpose of the commit is to reword the rating submit page
into "Rate our Services"

task-2823445

closes odoo/odoo#90979

Related: odoo/enterprise#27152
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-20 19:14:59 +02:00
Laurent Stukkens (LTU) 53ed5d54cb [FIX] project: remove unnecessary condition in _onDeleteColumn
This commit removes the unnecessary condition on modelName as the code
stands in `ProjectTaskKanbanColumn` which is only used in the
`project.task` kanban view.

closes odoo/odoo#91965

X-original-commit: cb55586bd3da19a6fbbb22728f9d2961830e1592
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-20 17:53:14 +02:00
Cedric Prieels (cpr) da1b2c0c3c [IMP] hr_timesheet,timesheet_grid: add new pivot measures and generic improvements
A new report was created for timesheets, also introducing new measures regarding
the (non-)billable time (percentage) and the timesheets revenues/costs. Some general
improvements were furthermore introduced in the timesheet apps.

See task-2783955

closes odoo/odoo#88072

Related: odoo/upgrade#3509
Related: odoo/enterprise#25922
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-20 17:53:10 +02:00
Simon Genin (ges) 8c3307a6b5 [FIX] web: fix field view get debug menu item
closes odoo/odoo#91943

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-05-20 16:46:09 +02:00
Valentin Chevalier 7f6f6a545c [FIX] payment,sale: fix access error when using the capture or void buttons
Before this commit, users may saw the capture and void buttons but
couldn't use them.

As capture or void actions need to access acquirer-related fields,
these actions are now sudoed to allow any users that see the button
to use it.

The access rules and rights are also checked before executing the action
to avoid abusive RPC calls.

task-2785144

closes odoo/odoo#91923

X-original-commit: 2e351d6ff9b7f72b486e83c827ff6e15a05c3331
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-20 15:25:46 +02:00
Valentin Chevalier ccf8ca3c04 [FIX] payment: show capture&void buttons to the right users
Users without the right permission see the buttons but can't use them.

Capture and void buttons are now only visible and usable for admin or
users in account.group_account_invoice group (for invoicing module).

task-2785144

X-original-commit: db6b54cc49ba7d9266e766112017604ed98c2cb3
Part-of: odoo/odoo#91923
2022-05-20 15:25:46 +02:00
Jeremy Kersten deec7a1dd6 [FIX] base: add get_extension helper
Since PR #90855, we add extension if mimetypes doesn't match the type.
Since guess_type don't know some extension, we prefer considere all string
of less of 8 char as an extension before to fallback on the mimetypes lib.

With this commit, a filename filename.scss will be considered with an
extension .scss by our own helper instead of a fallback on .bin or .a as
returned by guess_extension of mimetype.

closes odoo/odoo#91905

X-original-commit: ca49c314970f32d051a449b0c0aa1aef30ca9a8b
Signed-off-by: Jérémy Kersten <jke@odoo.com>
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-05-20 15:25:42 +02:00
Antoine Guenet da775cf678 [UPD] point_of_sale: update html2canvas library to latest version
The `html2canvas` library had been downgraded to its version from 2013
because of an issue with RTL rendering (see [1]). In the meantime, the
library explicitely introduced RTL rendering support (see [2]).
Upgrading the library to its latest (2022) version means a lot of old
bugs are fixed.

[1] https://github.com/odoo/odoo/commit/659e2857a651ea5f6df4a7139836d7f7398c40da
[2] https://github.com/niklasvh/html2canvas/pull/2653

closes odoo/odoo#91773

Related: odoo/enterprise#27527
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-05-20 15:25:23 +02:00
dbkosky af942f5f97 [IMP] account_intrastat:fields in grouped aml view
This commit refactors the protected fields out of the hardcoded list in
the account_move_line model, and into a function that can be overriden
in inherited models.

This allows for account_intrastat to specify that the intrastat
transaction code field and the intrastat product origin country field
should not be editable after the accounting lock date.

(In the corresponding commit these intrastat fields are added to the
journal views)

related PR: https://github.com/odoo/enterprise/pull/27049

closes odoo/odoo#91134

Task-id: 2753542
Related: odoo/enterprise#27049
Signed-off-by: William André (wan) <wan@odoo.com>
2022-05-20 15:25:20 +02:00
Dossogne Bertrand c5dff04665 [IMP] hr_holidays: improve cancel interface
This commit aims to improve the time off experience by:
- fixing the "cancelled" ribbon on time offs
- removing the archive dropdown action
- removing the "off until" banner in discuss if the user's leave is not validated

TaskID 2800647

closes odoo/odoo#87650

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-20 15:25:13 +02:00
mit patel e780665a09 [IMP] website_sale_slides: improve design of 'Start Learning' card
Currently when user purchases a course and completes the payment, the
card of the  purchased course is shown with 'Start Learning' button.
However, the layout can be improved.

This commit adds the short description of the course, duration and
steps of the purchased course to provide a bit more information to
the user. Apart from that, the title is now clickable and the
information part now occupies a bit more space than the image.

taskId-2790996

closes odoo/odoo#86873

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-05-20 15:25:10 +02:00
tsm-odoo 2c16b5939d [FIX] mail: fix incorrect seen_message_id in tests
One of the discuss_tests assumed that pyEnv.create returns a record while it returns an id.
Therefore, this test was setting a relational field to undefined instead of the id of
the related record.

closes odoo/odoo#91885

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-20 13:15:53 +02:00
Ipsita Borisagar c272573905 [FIX] mail, test_mail_full: remove an obsolete method
Before this commit:

There is an obsolete method 'channel_fetch_listeners' which is not needed now.

After this commit:

Removed this obsolete method.

Task-2827899

closes odoo/odoo#91876

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-20 13:15:49 +02:00
Valentin Chevalier 691ab5835b [IMP] payment, *: hide tokenization checkbox when paying a subscription
*: account_payment, sale, website_sale

Users should not be able to discard the tokenization of their payment if
they pay for a subscription.

This commit introduces a new helper method to better predict when the
tokenization checkbox should be shown or hidden. This also ensures that
the behavior will be the same across all modules.

task-2695201

closes odoo/odoo#91860

X-original-commit: 1d8dc53f8ed2a967b35213bc913cdfbc42ff15bc
Related: odoo/enterprise#27568
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-20 13:15:46 +02:00
Sébastien Geelen (sge) 38a05bac1c [FIX] website: fix linting errors
closes odoo/odoo#91840

X-original-commit: 0f1c783122d9ee30dd5c6f5bcb375e34067766c6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-05-20 13:15:40 +02:00
Sébastien Geelen (sge) ce067c3b56 [FIX] web_editor,website,website_sale : fix products header edition
Prevent edition on e-commerce products header bar.
Since we cannot save any change done in the header object anyway,
And some edition would trigger error.
We put the all bar in a read-only mode.

task-2745151

X-original-commit: e2f7b8fad76dc816b2f6864340d3740446117cdb
Part-of: odoo/odoo#91840
2022-05-20 13:15:39 +02:00
Louis Wicket (wil) 050dea5813 [IMP] base: set phone and mobile fields to unaccent=False
Set `phone` and `mobile` fields on `res.partner` to unaccent=False since phone
numbers are unlikely to have any accent. This will also make it easier
to add indexes on these fields in the future.

Part of task-2832241

closes odoo/odoo#91788

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-05-20 13:15:34 +02:00
Sébastien Geelen (sge) 6a9fd6b827 [FIX] web_editor: fix some linting errors
closes odoo/odoo#91786

X-original-commit: 46094420d70bfef0e9834a1ed7ef60beab1ccb22
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-05-20 13:15:30 +02:00
Sébastien Geelen (sge) a3ee176405 [FIX] web_editor: Fix style formating traceback
In some case, when removing format on element with multiple textNode,
the code generate a traceback.

The loops in `toggleFormat` provide a limit element `closestDecorated` to
the `splitAroundUntil` util. However this limit element can be split and
dumped by the format removal. In this case the reference was never encountered
in the DOM by the `splitAroundUntil` code and will bubble all the way to the
`<html>` TAG an try to split it, which generate an error.

We fix it by getting the `closestDecorated` in every loop.

task-2850686

X-original-commit: 2d93345c38f55c276370d0059d562d28320db2fb
Part-of: odoo/odoo#91786
2022-05-20 13:15:30 +02:00
Sébastien Geelen (sge) cc80572ee6 [FIX] web_editor: fix missing strikeThrough tests
Add some unit test for strikeThrough format.
Those tests reveal some bug in the current formating code.

task-2850686

X-original-commit: 4d8e1dc381d01bb254d2e806a335a40733608f2e
Part-of: odoo/odoo#91786
2022-05-20 13:15:30 +02:00
Sébastien Geelen (sge) 491a9d6399 [FIX] web_editor: fix unit test
Wrong contentAfter labeling.

X-original-commit: 22bb8ae8e131a576987e95911d229aad42d00193
Part-of: odoo/odoo#91786
2022-05-20 13:15:30 +02:00