686 Commits
Author SHA1 Message Date
pengyuthon 6b5469a4f0 chore(gzth): 天投云 Odoo 17 定制补丁汇总
本提交汇总生产环境长期定制改动(2024-11 ~ 2026-05):

- web 前端:list/calendar/form 状态指示/确认框/选择创建对话框等交互与中文化调整

- mail:mail_thread、models 定制(含多公司/权限相关处理)

- hr / hr_attendance:考勤与员工逻辑定制

- odoo/addons/base:ir_rule 记录规则调整

- bus/websocket、maintenance 视图、purchase_stock manifest、hr_contract zh_CN 翻译
2026-09-29 16:35:05 +08:00
Odoo Translation Bot b31ea21cab [I18N] Update translation terms from Transifex 2024-04-28 00:10:20 +02:00
Victor Piryns (pivi) 6101700868 [FIX] bus: split large NOTIFY payloads
Description:
On a database with heavy activity, it is possible for the payload
size we pass for the `NOTIFY` query on the bus to be larger than what
PostgreSQL allows by default, 8000 B. This limit is defined as:
https://github.com/postgres/postgres/blob/6686e9676c8faff4ee04c1574e117ae38f117efa/src/backend/commands/async.c#L158-L166
and it is used to compare the size of the payload before processing:
https://github.com/postgres/postgres/blob/6686e9676c8faff4ee04c1574e117ae38f117efa/src/backend/commands/async.c#L654-L657

Fix:
- Binary split the payload into multiple chunks if it's exceeding
  the above-mentioned limit. The unit of splitting is a channel, so
  if the content of one channel itself is larger than said limit, it
  is not handled, but shouldn't occur under normal circumstances.
- Introduce also a new ENV variable `ODOO_NOTIFY_PAYLOAD_MAX_LENGTH`
  to allow tweaking of the limit if they are running a handrolled
  custom PostgreSQL cluster.

Reference:
opw-3650618

closes odoo/odoo#159469

X-original-commit: 61c7bba44990522d853bae25aa7899cb03c72e31
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2024-03-27 17:45:00 +00:00
tsm-odoo 0dde17e60f [FIX] bus: fix non deterministic websocket test
Before this commit, the `test_websocket_instances_weak_set` was
sometimes failing. Indeed, this test doesn't wait for the connection
to be fully established before making its assertions. This commit
fixes this issue.

fixes runbot-55037,55035

closes odoo/odoo#157510

X-original-commit: 15bad5ccbeced41127eeaea3e47eebbc3f55091e
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2024-03-18 08:45:38 +00:00
Odoo Translation Bot 1b9fd01d46 [I18N] Update translation terms from Transifex 2024-03-10 00:13:03 +01:00
Odoo Translation Bot cb45934163 [I18N] Update translation terms from Transifex 2024-03-03 00:09:56 +01:00
tsm-odoo 60dc936be1 [FIX] mail: fix missing identifying field in record insert
When a message is posted, the server sends a `mail.record/insert`
notification to update the related channel pin state. In order to
recognize the thread, the client needs its id and its model.
Currently, only the id is passed so the thread pin state is not
updated. This PR adds the model to the notification.

closes odoo/odoo#155150

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-02-23 16:43:33 +00:00
tsm-odoo 49fa5c1f3e [IMP] im_livechat, *: show live chat channels as sidebar categories
*: mail.

This PR removes the live chat sidebar category. From now on, each
channel will have its own category. This is a first step towards
providing an efficient way for operators to join/leave a live chat
channel.

part of task-3640730

closes odoo/odoo#154755

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-02-22 16:23:59 +00:00
tsm-odoo 4f0b262dbe [FIX] bus, mail: fix redundant bus subscriptions
Since 16.3, opening the web client on the Odoo backends results in two
subscribe events being sent through the bus websocket.

Discuss listens to the thread changes to know when the subscription
should be refreshed. In order to do so, the last subscription that was
made is kept. This issue is that this subscription is empty in the
first place so the first evaluation always considers the subscription
should be made.

In order to fix this issue, this PR refine the condition to determine
if the subscription should be renewed:
- The last subscription is different from the last one
- The user joined a channel after the bus initialization
- The user left a channel after the bus initialization

In order to test those scenario in a reliable way, this PR also
backports odoo#147455

closes odoo/odoo#154170

X-original-commit: 109b45f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2024-02-15 18:21:31 +00:00
Denis Ledoux b23cb16487 [FIX] core: restrict httprequest attributes
The version of werkzeug installed can vary from one deployment
to another, as we recommend to use the operating system package,
and the version can therefore change according to the operating
system version.

e.g. the werkzeug version installed using
`apt install python3-werkzeug` varies between
Ubuntu 18.04, 20.04, 22.04, 23.10, ...

We want to keep under control the attributes
developers use on werkzeug.wrappers.Request,
to avoid compatibility issues from one
version to another.

Therefore, this revision aims
to subclass werkzeug.wrappers.Request to limit
the attributes which can be used.

task-3734305

Part-of: odoo/odoo#78857

Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-12-07 12:53:19 +00:00
Odoo Translation Bot dd40867949 [I18N] Update translation terms from Transifex 2024-02-11 00:14:17 +01:00
Tiffany Chang (tic) 94c58407f6 [I18N] *: add in Russian translations
For a first iteration, Russian translations were done using DeepL using
1 large .pot file of all the standard modules to translate (e.g. no
localizations, no test modules, etc). Unfortunately for some reason
doing a msgmerge with the existing ru.po files didn't seem to work, so
old "Translators" metadata at top of files were lost (maybe they will be
re-added during next Transifex sync?)

Part-of: odoo/odoo#152285
2024-02-06 18:49:02 +00:00
Odoo Translation Bot 95a4b6dfdc [I18N] Update translation terms from Transifex 2024-01-21 00:17:03 +01:00
bve-odoo 72c1a4f96a [IMP] *: replace type where possible
do not compare types, for exact checks use `is` / `is not`,
for instance checks use `isinstance()`Flake8(E721)

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-11-07 17:09:34 +00:00
Benjamin Hanquin (beha) 762b087aee [IMP] bus: privatize internal attributes
Internal attributes of our Websocket class are
not supposed to be overridden or even used by developers
in business modules.

Ensure that by name mangling these attributes,
to make the use of them harder and make understand
those attributes are meant for the internal use
within the Websocket class only.

Part-of: odoo/odoo#75510
2023-11-13 11:02:17 +00:00
Odoo Translation Bot 0e23020b84 [I18N] Update translation terms from Transifex 2024-01-07 00:23:19 +01:00
Killian Frappart bc0b090cd6 [FIX] bus, mail, im_livechat: open discuss from livechat history
The kanban view used to display message history of livechats sessions is
replaced by Discuss for a smooth and consistent user experience.

Minimum viable version for Task-3497801

closes odoo/odoo#146800

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-12-29 18:33:23 +00:00
tsm-odoo bb2a140a59 [FIX] bus, im_livechat: add guest channel instead of using context
In [1], a context object was added to websocket requests to subscribe
to guests channels on cors live chats. However, the common mechanism
to subscribe to record channels is to pass a string channel that will
then be validated by the `_subscribe` method of `ir_websocket`. This
approach works with OdooSH out of the box while the other one does
not.

This PR removes the mechanism introduce in [1] in favor of the string
approach.

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

closes odoo/odoo#147114

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-28 15:33:38 +00:00
tsm-odoo be63841a6e [FIX] bus: fix non-deterministic channel managment test
This commit fixes a non-deterministic error in the bus module. Testing
the bus service is difficult because it relies heavily on async code.
Until now, `nextTick` was used but there is no guarantee that this is
enough. This commit introduces the `waitForChannels` method that
awaits the channel subscriptions to be done before resolving.

fixes runbot-21942,54467

closes odoo/odoo#147616

X-original-commit: 429a0668a4bed52eff1c7b8cd0c5c66261678699
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-28 13:09:29 +00:00
tsm-odoo 56a10b4536 [FIX] mail: fix non deterministic steps in qunit tests
Several tests are non deterministic because they are using
`assert.verifySteps` at the wrong moment. Helpers such as
`afterNextRender`, `nextTick`, `Deferred` are used but those are
either not reliable or cumbersome to setup.

This PR introduces an asynchronous API on top of
`assert.step`/`assert.verifyStep`. This will wait until steps are
executed or until the timeout is reached.

fixes runbot-52660,54471,52794

closes odoo/odoo#147455

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-12-27 12:38:45 +00:00
Odoo Translation Bot 50e8e08183 [I18N] Update translation terms from Transifex 2023-12-24 00:18:24 +01: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
Odoo Translation Bot 304a6caa14 [I18N] Update translation terms from Transifex 2023-12-17 00:08:26 +01:00
tsm-odoo 0feaa4f650 [FIX] bus, website_livechat: prevent psycopg2 errors during tests
`psycopg2` errors sometimes happen during tests. This is caused by
race conditions between several `cr.execute()`/`cr.fetch*`.

This is even worse with websockets that are long lived connections
that sometimes open a cursor in the middle of the test.

Before websockets, longpolling was just disabled during tests. This
commits disable websockets as well in order to prevent those errors
as much as possible.

Some live chat tours were updated in [1] after the websockets intro-
duction due to some race conditions. This was reverted as the fix
relied on a hack on websockets that are now unavailable.

fixes runbot-25357,24809

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

closes odoo/odoo#143647

X-original-commit: e3b07a301036fcce76ebbbd856b507326b88160a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-11-30 05:17:40 +00:00
tsm-odoo 579ee6d979 [FIX] bus: mock websocket worker during tests
The bus service communicates with the websocket worker in
order to deliver messages coming from the bus. Most of the
time, it is using a `SharedWorker` but when this kind of
worker is not available, it fallbacks on a `Worker`.

During tests, the `SharedWorker` is mocked to prevent opening
websockets on the server. However, the `Worker` is not.

Since [1], opening websockets during tests is forbidden thus,
any test relying on `Worker` and expecting a connection to be
established would fail.

This PR solves this issue by mocking the `Worker` constructor
as well.

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

closes odoo/odoo#143988

X-original-commit: 1c67542decb1b6ad38fd15532cb6ac82417ca6dc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-11-29 07:51:39 +00:00
tsm-odoo 8e52f40f59 [FIX] test_discuss_full, *: decouple tests from demo data dependency
*: website_livechat.

closes odoo/odoo#143645

X-original-commit: 9643717d911c31f150adab5b699ec7b9219f8981
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-11-27 08:39:49 +00:00
Odoo Translation Bot 3ffba892de [I18N] Update translation terms from Transifex 2023-11-26 00:20:02 +01:00
Odoo Translation Bot f6fe982853 [I18N] Update translation terms from Transifex 2023-11-19 00:28:08 +01:00
tsm-odoo c9b72f09d8 [FIX] bus: fix im status not updating
Odoo periodically updates the user online status. This is
done every minute and is throttled in order to ensure it won't
be triggered more than it should.

Since [1], the underscore `throttle` function has been replaced
by the `throttleForAnimation` function. This is not equivalent:
the function won't be triggered if there is no animation which
result in an outdated user status.

This issue was highlighted by the live chat: the button does
not show up when there is no available operator.

Steps to reproduce the issue:
- Log in on Odoo with live chat installed
- Go to a web page that uses the live chat widget
- Wait more that one minute and refresh the page
- The live chat button is not shown anymore: the only
operator is considered as disconnected.

This PR fixes that issue by re-introducing the underscore
throttle function: it is robust and can be needed, not all
throttles are linked to animations.

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

opw-3578517

closes odoo/odoo#142160

X-original-commit: f64a7cbad3dee3ffc365b931306b1c13c8bff536
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-11-15 13:56:35 +00:00
Louis (wil) 68b4dfc2bb [I18N] *: import translations
closes odoo/odoo#141655

Related: odoo/enterprise#50484
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-11-08 20:48:14 +00:00
tsm-odoo 9bf36e00a4 [FIX] bus: fix websocket outdated on db change
When the bus service is loaded, it connects to the websocket
worker and passes some information that are used to determine
whether the websocket connection is outdated.

Amongst them, the user id is used to detect when the user changed
and when the websocket connection should be refreshed.

This is not enough to ensure the websocket connection is still
relevant: the user id could be the same but the db could have
changed. The websocket would then be linked to the previous
database.

This commit fixes the issue by sending the db name alongside the
user id. This will ensure the connection is refreshed when it is
outdated.

Steps to reproduce the issue:
- Log in on db1 on 2 tabs
- Log out
- Log in on db2
- Try to star a message in the discuss app
- Nothing happens, the messages are sent from db2 but the socket
listens to db1

closes odoo/odoo#141263

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-07 21:02:17 +00:00
Odoo Translation Bot 5d2bc9e9b3 [I18N] Update translation terms from Transifex 2023-11-05 00:21:55 +01:00
Odoo Translation Bot 6739c317d1 [I18N] Update translation terms from Transifex 2023-10-29 00:07:17 +02:00
Fabien Meghazi 2738f8972e [ADD] base: add support for custom imbus & cron_trigger postgres notifications
This patch provides the possibility to implement a custom security layer on top
of Odoo's imbus notification system and ir_cron live triggering system.

The key addition is the `ODOO_NOTIFY_FUNCTION` environment variable (opt-in),
which can now define a custom postgresql function to be called instead of the
default `pg_notify` function. This allows for greater flexibility and control
over the notification and triggering mechanisms within Odoo.

closes odoo/odoo#140089

Signed-off-by: Fabien Meghazi (fme) <fme@odoo.com>
2023-10-28 19:59:03 +00:00
Xavier-Do bf3b6b0b8b [IMP] base, web, *: change url formating
Previously proposed formating was trying to normalize extra in one part
of the path. This means that no extra needed a placeholder.

The implementation was meant to be more generic and extendible since a
part of the logic has to be in website.

A suggestion was made to make it more restricted but explicite by
keeping the url simple in web/controllers/binary.py but adding a
controller in website to add this extra part.

The base extra direction is now in the extension, as the min part.

Initial urls:
/web/assets/{unique}/[{website_id}/][rtl/]{bundle_name}[.min].{extension}

New urls:
/web/assets/[{website_id}]/{unique}/{bundle_name}[.rtl][.min].{extension}

Managed by two routes:

/web/assets/<string:unique>/<string:filename>
/web/assets/<int:website_id>/<string:unique>/<string:filename>

Where filename is in the format {bundle_name}[.rtl][.min].{extension}

Multiple possibilities where proposed

- /web/assets/website/<int:website_id>/<string:unique>/<string:filename>
More explicit but prefixing by /website was considered

- /website/assets/<int:website_id>/<string:unique>/<string:filename>
This one is a litle painfull to match similar attachement, where
website is ignored.

- /website/<int:website_id>/assets/<string:unique>/<string:filename>
Almost accepted but subjective, and anyway two previous solution breaks
the cdn mecanism and would need a migration

- /web/assets/<int:website_id>/<string:unique>/<string:filename>
Almost accepted but subjective, and anyway two previous solution breaks
the cdn mecanism and would need a migration

This last solution was not ideal to match without unique
/web/assets/%/<string:filename> can match both

/web/assets/123456/<string:filename>
and
/web/assets/1/123456/<string:filename>

Anyway, matching without unique shouldn't be supported for al (even if
it is kind of supported with any right now) but it will work by changing
unique wildcard to a more specific one (_ * 7)

closes odoo/odoo#131353

Related: odoo/enterprise#47313
Related: odoo/design-themes#730
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-10-27 11:34:52 +00:00
Xavier-Do 64bbef5bc1 [IMP] base, web: generate assets outside rendering
The generation inside the rendering has some drawbacks:

- `commit_assetsbundle` is needed for reports rendering because the
template rendering may generate some assets that will be accessed by
another transaction before the transaction is committed. But this
solution is not ideal since the transaction is committed in the middle
of the request

- when the first rendered page is a 404, the assets are not committed
and the page is broken.

- when starting, deleting an attachment can create a concurrent update
error and the request is retried. This will occur once per attachment
and for all worker trying to access the same resource. The whole
transaction is rollbacked, even the previously created assets bundle.

- The cold page load is a slower since there is more work to do.

- Implementing a readonly request is difficult because it could be
transformed to read write and re-executed if the assets bundle does not
exist.

Generating assets when needed solves those issues. The concurrency
when deleting an assets could still occur but only once per bundle, and
in a smaller transaction. This could be solved with a lock now that we
have more control on the transaction. The commit_assetsbundle can be
removed and 404 page should have a correct layout. The cold page load
could be a little faster because the assets bundle can be generated in
parallel requests instead of sequentially when rendering the page.

Part-of: odoo/odoo#131353
2023-10-27 11:34:52 +00:00
Louis (wil) 3f6f949fa5 [I18N] export sources
closes odoo/odoo#140002

Related: odoo/enterprise#49687
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 08:36:16 +00:00
Michael (mcm) fcb16a3b1b [IMP] *: remove guarded catch
This commit removes the promise extension which added the function
`guardedCatch`. It was used to filter server and connection errors from
javascript errors. Instead of using guardedCatch, we should use catch
and check if the reason is a server or connection error if needed and
re-throw the error if it's not handled.

closes odoo/odoo#137702

Task: 3439226
Related: odoo/enterprise#48451
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-25 15:50:34 +00:00
Alexandre Kühn 09592c25fd [REF] mail: replace Partner/Guest to Persona in mail.record/insert
As a step to simplify model insert from python. All data are
formatted in a way to make data insert trivial in JS models.

closes odoo/odoo#138760

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-23 20:07:29 +00:00
Sébastien Theys d15e88abef [FIX] bus: authenticate on the correct env
`_authenticate` is updating the `env`, but it updated the `env` of
`ir_websocket` instead of `self`. There was then a mismatch between
the `update_context` and the current user.

This was highlighted in another PR that removed sudo from these methods
with the hope on relying on ACL, which depends on current user and other
context values at the same time.

closes odoo/odoo#139436

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-23 13:11:27 +00:00
tsm-odoo 8e47143e29 [FIX] bus: fix websocket events tests
[1] tried to remove nondeterminism from bus tests. However, several
issues remain:

- the asset watchdog bundle is added to the registry during bus tests.
Websocket tests wait for the `connect` event after starting the environment.
This `connect` event can be triggered sooner than expected since the asset
watchdog services starts the bus.
- a the random delay is added to the reconnection attempts.
- `nextTick` is kept when waiting for a client to leave the worker.

This commit fixes those issues.

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

closes odoo/odoo#138639

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-17 10:05:51 +00:00
tsm-odoo e9446a511e [FIX] bus: fix race in websocket tests
Before this commit, websocket tests were sometimes failing with the
`no result to fetch` error. This is due to a race between the
`subscribe` event being received which itself leads to dispatching bus
notifications interferring with the rest of the test (the connection
is shared).

In order to solve this issue, the `WebsocketCase` now exposes a
`subscribe` method that waits for this dispatching to be done in order
to ensure it will not interfere with the rest of the test.

Some tests were also failing because the subscription was done with 0
as the last notification id. This is an issue since this could lead to
notifications being sent while they are not expected.

In order to solve this issue, `last_notification_id` is now correctly
passed when subscribing to channel notifications.

fixes runbot-24226

closes odoo/odoo#138649

X-original-commit: 3256885fd08d33a67d7165fa33d373fd039ef7af
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-14 02:26:53 +00:00
tsm-odoo 7bab1cfde1 [IMP] bus: make bus tests more robust
This commit makes bus tests more robust by implementing
functions that wait for some events instead of relying
on `nextTick` that might or not be sufficient.

fixes runbot-23097

closes odoo/odoo#138221

Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-12 09:49:46 +00:00
tsm-odoo 621668e53b [IMP] bus: clean bus tests
This commit cleans the bus tests by:
- flattening the tests structure by putting tests outside
of the `QUnit.module` function.
- removing unnecessary `assert.expect` calls.
- adding an helper to add common bus service to the registry

Part-of: odoo/odoo#138221
2023-10-12 09:49:46 +00:00
tsm-odoo 4716251144 [IMP] bus: better websocket error logging
Before this commit, diagnosing websocket handshake error was
cumbersome since the only information available was the return
code of the initial HTTP request (400).

The HTTP stack does not log `werkzeug.exceptions.HTTPException`
and derivated classes since they are valid responses. This commit
adds a log in order to provide more insight about what went wrong.

closes odoo/odoo#138083

X-original-commit: 50af40302c2849b99e8e501bc170cf887ca8e6fa
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-10 08:19:37 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Michael (mcm) 2fbc08a197 [IMP] *: remove legacy service mappers
This commit removes the legacy service mappers which are useless now.

closes odoo/odoo#136807

Task: 3439226
Related: odoo/enterprise#48015
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-04 19:40:16 +00:00
Xavier Morel beb0c25a94 [IMP] core, bus: future werkzeug compatibility fixes
- `Response.charset` is deprecated since 2.3, `Response.set_cookie`
  accesses the currently-extent internal `_charset` directly until
  this too gets removed in Werkzeug 3.0. Add a `_charset` to
  `FutureResponse` so this does not crash.
- Bytes response headers are deprecated since 2.3, and will get
  removed in 3.0, passing bytes in websocket is completely unnecessary
  happenstance which is trivially fixed.

closes odoo/odoo#137145

X-original-commit: 66e3040d4ad9e03aabefebd4799f699ad30fca45
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-10-02 06:54:39 +00:00
Sébastien Theys 7a90938a70 [REF] mail, *: tests: simplify text option of contains
* = bus, calendar, im_livechat, hr, project_todo, sms, snailmail,
    test_mail, web, website_livechat

The current implementation often led to tests relying on DOM structure
to properly target the correct element with the text.

It is now easier to simply check if a parent contains some text.

closes odoo/odoo#136295

Related: odoo/enterprise#47770
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-23 10:33:04 +00:00
Sébastien Theys 7ea370fce7 [REF] mail, *: tests: refactor contains to further remove jQuery
* = account, base_iban, bus, calendar, crm_livechat, hr, hr_holidays,
    im_livechat, mrp, project, sms, snailmail, test_mail,
    test_mail_full, web, website_livechat, website_slides

Add support in `contains` for most operations that we use in tests.
Remove return value from `contains`.
Move into `web` module.
Remove import/export chains, directly import from correct module.

closes odoo/odoo#134652

Related: odoo/enterprise#47064
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-14 11:22:47 +00:00