Commit Graph
387 Commits
Author SHA1 Message Date
Romain Derie f51a53e6ee [FIX] website: avoid calling external services during test
`s_map` snippet is calling maps.google.com which might be the reason this tour
experience some race condition when trying to drag and drop the
`s_newsletter_subscribe_form` (which happen after the `s_map` snippet was
dropped).

When the race condition happen, we can see on the screenshot that the snippet
was drag & dropped into the footer instead of the `s_text_image` inside the
`#wrap` as it should be (see comment on first step of the test).
The reason the snippet is not dropped where it should be is because the `s_map`
was not removed as it should have been (seeing the screenshot), so the page was
scrolled and the footer became the first available and visible `o_editable`.

The `s_map` snippet is probably still in the DOM (despite a step is in charge
of removing it) because it is recreated after the google maps server reply,
which sometimes is probably taking an unexpected long time.

Anyway, external services should never be called during tests, removing the
snippet from the tour is an "easy" first step to try to fix the race
condition.

closes odoo/odoo#79120

X-original-commit: 37c9ae2c3b228e5abbe5bdb84df2c381d9f2fcb3
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-10-28 10:05:33 +00:00
Xavier Morel 17e6a69b91 [IMP] core: use Savepoint object in TestCursor
Initialize the savepoint semi-lazily (on-demand) as cycling a savepoint
generates 4~5 queries (depending whether the savepoint is explicitly
released on COMMIT or not):

    SAVEPOINT
    -- < do stuff>
    -- commit
    RELEASE SAVEPOINT -- or not
    SAVEPOINT
    -- close
    ROLLBACK TO SAVEPOINT
    RELEASE SAVEPOINT

With a lazy savepoint, this is just 0-1 queries (`SAVEPOINT` at the
first explicit query only, creating a cursor and then closing it
immediately is a no-op).

For reliability use a semi-lazy savepoint: always immediately emit a
`SAVEPOINT` on cursor creation, but don't automatically create one
after each `commit`. That limits the issues of overlapping (but
non-nested) savepoints.

Also fix the `generate` API to not use the request: when `website` was
converted to the new API, `cr`, `uid`, and `context` were dropped as
if it were a model... but it's not. So in order to recover an
execution environment, that was looked up on the session.

That, then, turns out to be an issue when `generate` is triggered from
an RPC call: the RPC layer creates its own cursor and environment
separate from the request's which may not have one at
all. Problematically during testing we're in `mono_db` mode, so the
request's cursor/env can be accessed and will be lazily initialized.

This then causes an issue with the `TestCursor`'s savepoints: rather
than be nested, the lifetimes of the request's and RPC's savepoints
only overlap[0]:

    |-- rpc --|
       |-- request --|

As a result, when the RPC's cursor is committed and released it
automatically released the request's, and the request's explicit
release then fails. This would break `/website:WithContext.test_search`.

By fixing the API of `generate`, it stops triggering the creation of a
request cursor, and therefore the overlap and resulting error.

[0] the laziness or eagerness of the savepointing in the test cursor
    has no impact on this issue, as multiple requests have already been
    issued on the RPC's test cursor before the request's is even
    created

Part-of: odoo/odoo#76243
2021-10-01 15:26:51 +00:00
Tom De Caluwé 2083e59281 [FIX] website: open the editor from a translated homepage
A bug currently prevents opening the editor from a translated version
of the homepage, for example /nl_BE (it works for other paths though).
Before this commit the url computed by _goToMasterPage was:

/website/lang/default?r=/nl_BE?enable_editor=1&rde=2

which will first redirect to the default language and then again to the
translated version. The bug was introduced by commit
119d9437e0 which chose an url without a
trailing slash as the canonical one for the homepage.

However, the bug can already be reproduced in 13.0 since commit
269aa59411  if the user manually
navigates to /nl_BE instead of /nl_BE/. No flows are redirecting to the
url without trailing slash in our codebase before 14.4, so the problem
is rarely seen.

When clicking on the "Edit in master" button, _goToMasterPage now
correctly removes the language code and redirects to the master
version, solving the problem.

task-2622270

closes odoo/odoo#76837

X-original-commit: 141c15d5dae137df11a73146ff4c991add7a2ff3
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-09-20 16:40:09 +00:00
Kamen Zhekov db3acb5ef9 [FIX] website: correctly set and sync custom account setting
A while back, the behavior of this setting was changed from a
related field to a computed as a fix to various issues with: cb9f48d
The setting's value synchronization with what is displayed on the
setting's page is broken, since its behavior changed with commit:
2ccc735 . It resets to its default value for the default website when
editing a secondary one and is not only confusing but breaks the
setting in some scenarios.

When changing the auth_signup_uninvited setting, the changes
are correctly reflected and not reset to default upon changing
the website we are currently editing.

task-2612686

closes odoo/odoo#76538

X-original-commit: 6e7a0664850ccbc30a7a8a3ced22f05347bc6f9e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-09-15 10:16:47 +00:00
Jeremy Kersten 914fe1085e [FIX] http_routing: avoid extra redirect on logout in multi lang
context:
Connected in /fr on a website with /en as default lang.

Before this commit,
  /web/session/logout?redirect=/
  /
  /fr_FR/
  /fr_FR

Now
  /web/session/logout?redirect=/
  /fr_FR

Part 1 -> to say that we are in multilang context and use url_lang.
   multilang=False to avoid /web/session -> /fr/web/session
   website=True to have url_lang done in the request.redirect.
Part 2 -> to remove the trailing '/' that will be only useful for '/'

closes odoo/odoo#76290

X-original-commit: ae35117ee1e019c3c0c333f291478825a5722706
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-09-10 08:49:13 +00:00
Raphael Collet 765ec7837c [REF] core: add methods flush() and clear() on cursor
This deprecates the ugly and inconvenient functions flush_env(),
clear_env(), and avoids explicit calls to precommit.run().

Part-of: odoo/odoo#75598
2021-09-03 15:45:46 +00:00
Benoit Socias c6ba756e4b [IMP] core, website: use fuzzy matching in web-based search
Before this commit searched terms were the ones entered by the end-user.

After this commit if the searched term is not found then the search is
performed on a resembling term.
The similarity is obtained from a Levenshtein distance combined with
ratios of common and different letters.
By default the dictionary against which the search term is matched is
based on the content of the search fields containing a word that starts
with the first letter of the search term.
If the `pg_trgm` Postgresql extension is installed the dictionary is
built from matches using the `<%%` operator (similar to the
`word_similarity` function).
Several approaches were benchmarked during development, those results
are available through the task record.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Younn Olivier fa1c05e7bb [IMP] website: disable assets for unused snippets
Based on their path, we retrieve snippets assets, assuming that it will
be in the form : /snippets/{snippet_id}/{version}.{scss|js}

Then we check the template definition uses that version, or if any views
or html fields contains a snippet with such version exist.
If not, the asset is deactivated.

For that, we are looking for the data-snippet attribute in snippets
already dropped. For the template definition, we look at the first class
definition if a data version attribute is also defined.

task-2212216

closes odoo/odoo#73005

Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-09-02 14:14:56 +00:00
qsm-odooandBenoit Socias a48a30f954 [IMP] website, web_editor, *: allow to use pre-configured gradients
*: web

After this commit pre-configured gradients can be used as snippet
backgrounds, snippet filters or as text effects / highlight effects.

The background colors (and now gradients) are now possible to add
*alongside* a color combination class (editing one does not remove the
other). Background colors and gradients are mutually exclusive.

Part of https://github.com/odoo/odoo/pull/73611
task-2599770

closes odoo/odoo#73611

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Benoit Socias <bso@odoo.com>
2021-08-17 17:43:50 +00:00
Romain Derie 0c883a4417 [FIX] website: remove s_facebook_page snippet from test
It creates race condition, as it contact external ressource, in this case
facebook.com.

Tests should never call external services anyway, it always lead to race
condition.

closes odoo/odoo#74704

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-08-04 12:49:23 +00:00
Gorash 7df343dd1b [IMP] base: QWeb _render return Markup unicode instead of utf8 bytes
In order to limit encoding decoding, the _render method returns a
unicode string in the markup safe object instead of a MarkupSafeBytes

closes odoo/odoo#68299

Related: odoo/upgrade#2454
Related: odoo/enterprise#17270
Signed-off-by: Antony Lesuisse (al) <al@openerp.com>
2021-08-03 16:20:22 +00:00
Gorash 5913b7265e [REF] base,*: refactor Qweb engine
* Remove AST in favor of pure Pyhon. This should make it easier for
developers to understand and create new directives because they do not
need to know AST.

* Remove `t-call-options` as it has been merged into `t-options` for more
consistency. Support for t-call-options is retained.

* Use generators for lists. This increases performances as the rendering
can be sent directly without having to wait for the creation of the
entire list.

* Optimize expressions runtime computation by pre-computing the static
parts.
Example:
'<' + 'div' + '>' + '<' + dynamic_value + '>'
Now compiles as:
'<div><' + dynamic_value + '>'
2021-08-03 15:37:54 +00:00
Romain Derie 460d5ecb92 [IMP] website: add tests for all snippets (drag and drop)
Image gallery snippet when dropped is throwing a traceback.
This lead to the editor not usable anymore, as any JS error will prevent any
further action (no JS will work anymore).

This introduce a test that will drag and drop every snippet in a page and click
on it to load its settings in the right panel.

Note that it will remove the snippet before drag & dropping the next one, as
having too many snippet will impact the perf, even killing the browser entirely
if there is a lot.

task-2604383

closes odoo/odoo#74135

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-30 13:43:24 +00:00
Arthur Detroux (ard)andqsm-odoo 1c442782f8 [IMP] website, *: add visibility options on sections
*: web_editor

Provide the user with an option to hide or display a section tag
depending on the visitor's location (if geoip enabled), language,
utm_medium, utm_source and utm_campaign.

Users can use a M2M widget to select different records. These will be
used to create a CSS selector on save that will hide the section tag
depending on the various options they selected.
This CSS selectors will be applied, as well as various data attributes
when the page loads to hide the targeted tag. All of these operations
are handled client side.

The geoip country had to be added to the session for the feature to work
with countries.

Part of https://github.com/odoo/odoo/pull/67140
task-2381049

closes odoo/odoo#67140

Related: odoo/enterprise#19907
Related: odoo/upgrade#2658
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-07-30 14:03:42 +00:00
Romain Derie 26dee545aa [FIX] website: unset menu/page m2o if menu url is a controller
Setting a controller URL to a menu which is linked to a page should unset the
m2o relationship to preserve the page URL.

Step to reproduce:
  - Create a page (with a menu) and save, eg: "My Page" (url will be /my-page)
  - Edit that new menu and change the URL to /shop (or any controller)

Issue:
  - The page URL is now /shop, which doesn't have a lot sense if there is a
    controller for that URL.
  - Unpublishing the website.page will unpublish the menu, as a menu needs its
    page to be published in order to be visible.

Note: The flow introduced here is the same as if you choose an URL of an
      already existing page, the menu's page will be unlinked from the menu and
      left with its original URL.

task-2575974

closes odoo/odoo#74163

X-original-commit: b52a01f76d89ebb7bdd75577e60a09f048c83000
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-07-26 17:34:19 +00:00
Matthieu Stockbauer f8882698e8 [MOV] website, website_form, *: merge website_form app into website
*: crm_iap_lead_website, website_crm, website_form_project,
   website_hr_recruitment, website_sale

Part of https://github.com/odoo/odoo/pull/69888
task-2462993
2021-07-16 19:13:18 +00:00
Jeremy Kersten 478068c829 [IMP] *: always use Odoo Response
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.

We removed redirect_with_hash that was only for retro compatibility

local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.

Default code for redirect is 303 now instead of 302.

Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.

All werkeug.utils.redirect has been replaced by request.redirect.

Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.

Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.

Migrate your code:

http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect

Courtesy of odony for help and review ;)

closes odoo/odoo#72599

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 07:00:06 +00:00
221254ca7b [IMP] all: read_combined(['arch']['arch'] => get_combined_arch()
The method read_combined() has been deprecated in favor of explicit
calls to read() and get_combined_arch().

There are places where we call _get_combined_arch() instead, in order to
avoid parsing the XML that has just been serialized. This saves useless
serialization-deserialization.

Task: 2541577
Meta task: 2463632

Co-authored-by: Fabien Pinckaers <fp@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2021-06-11 13:47:54 +00:00
Romain Derie 5a7e6d0247 [IMP] website: add tests - redirect 301 in case if trailing slash
This commit add tests to ensure every dispatch flows redirect to a 301 if the
requested URL has a trailing slash.
It also ensures the URL params are not lost in the process.

  - Basic controller: `/my/?a=b`
  - Website Pages: `/my-page/?a=b`
  - Basic controller with language: `/fr_BE/my/?a=b`
  - Website Pages with language: `/fr_BE/my-page/?a=b`
  - Homepage with language (special case/controller): `/fr_BE/?a=b`

opw-2505818
opw-2513575

closes odoo/odoo#71065

Community: https://github.com/odoo/odoo/pull/71065
Enterprise: https://github.com/odoo/enterprise/pull/18615
Related: odoo/enterprise#18615
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-06-03 12:07:32 +00:00
Jeremy Kersten 042c95b021 [IMP] website: autocorrect website domain
Before, get_http_domain make the job,
now we force website.domain to be valid

closes odoo/odoo#71161

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-06-02 14:27:02 +00:00
Romain Derie be2f558019 [IMP] models, website: allow get_base_url() on empty recordset
Before this commit, `get_base_url()` could not be called on an empty recordset.
It might be called on an empty recordset for instance when getting the paypal
payment endpoint URLs.
This commit allows that and returns the ICP value in that case.

The goal is to always use the util method `get_base_url()` instead of directly
accessing the ICP.

closes odoo/odoo#68201

Related: odoo/enterprise#17538
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-06-02 10:04:29 +00:00
Romain Derie 92175d3341 [IMP] *: replace web.base.url ICP by helper method
Previous commit introduce an helper to get the most suited URL for a record
instead of always using the ICP, which is not correct in a website context.

This commit replaces calls to ICP by the helper method.

Community: https://github.com/odoo/odoo/pull/68201
Enterprise: https://github.com/odoo/enterprise/pull/17538
Upgrade: https://github.com/odoo/upgrade/pull/2372

task-2476101
2021-06-02 10:04:29 +00:00
Romain Derie add7d995a8 [IMP] website: better retrieval of base URL
This commit improves the mechanism to find the best URL given a record.
To find the best suited URL, the following heuristic will be done:
  - If record has a website_id, use that website's domain
  - Else if a record has a company_id, use the company's website's domain [1]
  - Else use the `web.base.url` ICP

The following commit will replace (almost) every occurence of ICP by the
`get_base_url()` helper method.

[1] Before this commit, there was no way to know which website was the one from
    a company, has a company could have no website but could also have multiple
    websites.
    We now consider the first found website for a company as the company's
    website. The use of a new sequence on `website` will allow user to chose
    which website to use.

Community: https://github.com/odoo/odoo/pull/68201
Enterprise: https://github.com/odoo/enterprise/pull/17538
Upgrade: https://github.com/odoo/upgrade/pull/2372

task-2476101
2021-06-02 10:04:27 +00:00
Leonardo Pavan Rocha c53724ebc3 [IMP] *: adds generic user avatar
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.

Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient

Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.

closes odoo/odoo#69819

Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-01 14:36:23 +00:00
Romain Derie 2c8c079c05 [FIX] http_routing, website: prevent crash when using fw in url
Before this commit, the routing map generated and used would be the one from
the website the request is performed, instead of the one from the `fw` website
ID which will be the one we redirect the user to.

This issue was introduced with the routing map by website, be8fc2296b and is
restricted to a single case: a publisher using the website switcher, and it
won't happen on next page naviguation/refresh as the `fw` website id will be
the same as the current website's ID. Thus there won't be any routing map
mismatch.

Step to reproduce:
  - Create a page on website 2, set it as homepage
  - Naviguate to website 1 on '/' url
  - Naviguate to website 2 on '/' url
This will raise a werkzeug error about `EndPoint not iterable`.

----- Technical analysis ------

This is the current flow:
1. `_dispatch()` is setting `website_routing` to `get_current_website()` -> 2
2. `_dispatch()` is calling `_match()`
3. `_match()` is calling `routing_map()` with key = `website_routing`, which
   was set to 2 in step 1.
4. `routing_map()` is calling `_generate_routing_rules()` which generate the
   rules based on `website_routing`, which was set to 2 in step 1.
5. `_dispatch()` authenticate the user by calling `_authenticate()`
6. `_dispatch()` is calling `_add_dispatch_parameter()`, where URL param `fw`
   is forced in session, so `get_current_website()` now return the correct
   `website_id` -> 1

The issue: in order to handle the `fw` URL parameter (step 6.), we need to
check the rights to ensure we can allow the website switch.
To check rights, user need to be authenticated (step 5.), which is done after
generating the routing map (2. & 3. & 4.).
The routing map is generated based on the current website (step 1.)

Step 6 depends of steps 5 which depends of steps 2/3/4 which depend of step 1,
but step 1 should depend of step 6, which is an impossible cycle.

closes odoo/odoo#70397

X-original-commit: 4eb26497a774e934d7e1a6be9f505400fd9e2cdb
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-05-05 11:01:15 +00:00
Raphael Collet 34d6f87d54 [REF] core: put field.depends on registry and make field.recursive explicit
The attributes field.depends and field.depends_context are problematic
for sharing fields across registries, because they depend on the model's
registry class, which may vary from one registry to another.  In order
to make computed fields shareable, we have to move those values away
from fields.

For the same reason, field.recursive should not be inferred, because its
value may depend on the registry, although it is generally not the case.
Moreover, the flag recursive=True is set on a field when field triggers
are determined (on the registry).  A compute method may be called before
the flag is set (if no update has been done yet), and that can lead to
incorrect computations.

This happened in test TestUsers2.test_reified_groups in module 'base'.
The user groups view was apparently determined without the flag being
set, and the view depends on the recursive field 'trans_implied_ids',
which was not correctly computed.

We thus force developers to be explicit about recursive computed fields.
The code now logs a warning when the flag is not set up properly.
2021-05-03 12:33:29 +00:00
Samuel DegueldreandTom De Caluwé 2cfb8658bf [FIX] web_editor: fix default shapes not reacting to palette changes
Previously, when toggling on background shapes, they always had the
default colours. In [1] we made it so that when you toggle on a shape on
a section, it would automatically reuse the colors of the surrounding
shapes if any.

Unfortunately, when the "implicit" colors were also the default colors,
they were still marked on the shape, and it got an explicit background
image that would no longer react to changes in the palette.

This was caused by the fact that the call to _getDefaultColors returns
an empty object when the section doesn't already have a shape-container,
this was not a problem before since we were not passing in any colors
when creating the initial shape previously, the the aforementioned
change made it so that we did.

This commit fixes the issue by creating the shape-container before
calling the method that will set the colors on the shape, this way
getDefaultColors works as expected, and the colors are not marked on the
section when they are the default ones, restoring the ability of the
shape colors to adapt to the palette

[1]: https://github.com/odoo/odoo/commit/875aca63f7dab287c61485ebe999b3b8dd89d91c

task-2500607

closes odoo/odoo#70054

X-original-commit: 63acc2b0d1957dedd40af2033722f9ea4ef2e597
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
2021-05-03 09:27:44 +00:00
Xavier Morel e166077cb3 [FIX] base, website: fix entities in tests
`markupsafe.escape` always escapes single and double quotes, and
escapes them to their numeric values rather than symbolic

According to pallets/jinja@f35e28154f,
this is for compatibility with HTML 3.2: the only named entities in
the HTML 3.2 DTD are `amp`, `gt`, and `lt`.

Update tests to match.
2021-04-29 05:34:19 +00:00
Xavier Morel 01875541b1 [CHG] core, web: deprecate t-raw
Add a big fat warning when the qweb compiler finds a `t-raw`.

`t-esc` should now be used everywhere, the use-case for `t-raw` should
be handled by converting the corresponding values to `Markup`
objects. Even though it's convenient, this constructor *should never
be made available in the qweb rendering context* (maybe that should be
checked for explicitely?).

Replace `werkzeug.escape` by `markupsafe.escape` in
`odoo.tools.html_escape`, this means the output of `html_escape` is
markup-safe.

Updated qweb to work correctly with escaping and `Markup`, amongst
other things QWeb bodies should be markup-safe internally (so that a
`t-set` value can be fed into a `t-esc`). See at the bottom for the
attributes handling as it's a bit complicated.

`to_text` needed updating: `markupsafe.Markup` is a subclass of `str`,
but `str` is not a passthrough for strings. So `Markup` instances
going through would be converted to normal `str`, losing their safety
flag. Since qweb internally uses `to_text` on pretty much
everything (in order to handle None / False), this would then cause
almost every `Markup` to get mistakenly double-escaped.

Also mark a bunch of APIs as markup-safe by default

* html_sanitize output.
* HTML fields content, sanitization is applied on intake (so stripped
  by the trip through the database) and if the field is unsanitised
  the injection is very much intentional, probably. Note: this
  includes automatically decoding bytes as a number of default values
  & computes yield bytes, which Markup will happily accept... by
  repr-ing them which is useless. This is hard to notice without `-b`.
* Script-safe json, it's rather the point (though it uses a
  non-standard escaping scheme).
* Note that `nl2br`, kinda: it should work correctly whether or not
  the input is markup-safe, this means we should not need to escape
  values fed to `nl2br`, but it doesn't hurt either.

Update some qweb field serialisations to mark their output as
markup-safe when necessary (e.g. monetary, barcode,
contact). Otherwise either using proper escaping internally or doing
nothing should do the trick.

Also update qweb to return markup-safe bytes: we want qweb to return
markup-safe contents as a common use-case is to render something with
one template, and inject its content in an other one (with Python code
inbetween, as `t-call` works a bit differently and does not go through
the external rendering interface).

However qweb returns `bytes` while `Markup` extends `str`. After a
quick experiment with changing qweb rendering to return `str` (rather
unmitigated failure I fear), it looks like the safest tack is to add a
somewhat similar bytes-based type, which decodes to a `Markup` but
keeps to bytes semantics.

For debugging and convenience reasons, MarkupSafeBytes does *not*
stringify and raises an error instead (`__repr__` works fine). This is
to avoid implicit stringifications which do the wrong thing (namely
create a string `"b'foo'"`).

Also add some configuration around BytesWarning (which still has to be
enabled at the interpreter level via `-b`, there's no way to enable it
programmatically smh), and monkeypatch `showwarning` to show warning
tracebacks, as it's common for warnings to be triggered in the bowels
of the application, and hard to relate to business logic without the
complete traceback.

`t-out`
=======

`t-esc` is a bit confusing for the new behaviour of "maybe escape
maybe not", so add a `t-out` alias with the same behaviour.

Unlike `t-raw`, `t-esc` is only soft-deprecated for now: there are
thousands of instances, so editing all the templates is not
great. Eventually we'll add a `ci/style` to prevent addition of new
ones, and eventually we might do a bulk-replace and hard-deprecate.

Attributes handling
===================

There are a few issues with respect to attributes. The first issue is
that markup-safe content is not necessarily attributes-safe
e.g. markup-safe content can contain unescaped `<` or double-quotes
while attributes can not. So we must forcefully escape the input, even
if it's supposedly markup-safe already.

This causes a problem for script-safe JSON: it's markup-safe but
really does its own thing. So instead of escaping it up-front and
wrapping it in Markup, make script-safe JSON its own type which
applies JSON-escaping *during the `__html__` call.

This way if a script-safe JSON object goes through `markupsafe.escape`
we'll apply script-safe escaping, otherwise it'll be treated as a
regular strings and eventually escaped the normal way.

A second issue was the processing of format-valued
attributes (`t-attf`): literal segments should always be markup-safe,
while non-literal may or may not be. This turns out to be an issue if
the non-literal segment *is* markup-safe: in that case when the
literal and non-literal segments get concatenated the literal segments
will get escaped, then attributes serialization will escape
them *again* leading to doubly-escaped content in attributes.

The most visible instance of this was the `snippet_options` template,
specifically:

    <t t-set="so_content_addition_selector" t-translation="off">blockquote, ...</t>
    <div id="so_content_addition"
        t-att-data-selector="so_content_addition_selector"
        t-attf-data-drop-near="p, h1, h2, h3, .row > div > img, #{so_content_addition_selector}"
        data-drop-in=".content, nav"/>

Here `so_content_addition_selector` is a qweb body therefore
markup-safe, When concatenated with the literal part of
`t-atff-data-drop-near` it would cause the HTML-escaping of that
yielding a new Markup object. Normal attributes processing would then
strip the markup flag (using `str()`) and escape it again, leading to
doubly-escaped literals.

The original hack around was to unescape() `Markup` content before
stringifying it and escaping it again, in the attribute serialization
method (`_append_attributes`).

That's pretty disgusting, after some more consideration & testing it
looks like a much better and safer fix is to ensure the
expression (non-literal) segments of format strings always result in
`str`, never `Markup`, which is easy enough: just all `str()` on the
output of strexpr. We could also have concatenated all the bits using
`''.join` instead of repeated concatenation (`+`).

Also add a check on the type of the format string for safety, I think
it should always be a proper str and the bytes thing is only when
running in py2 (where lxml uses bytestrings as a space optimization
for ascii-only values) but it should not hurt too much to perform a
single typecheck assertion on the value... instead of performing one
per literal segment.

Note: we may need to implement unescape anyway, because it's still
possible to get double-escaping with the current scheme: given an
explicitly escape-ed `foo` and `t-att-foo="foo"`, `foo` will be
re-escaped.

fixup! [CHG] core, web: deprecate t-raw
2021-04-29 05:34:19 +00:00
Julien Mougenot 3e3dce0eb8 [REF] *: rename assets 'glob' to 'path'
Rationale:
The majority of cases where an ir.asset is manually declared
outside of manifest files is to specifically add a single asset file.
This means developers are specifying a single asset *path*, and not a
glob expression. In this context, it seems better to name the filepath
field `path`, and document that it can be specified with a glob
expression when (seldom) needed, rather than making the exception appear
to be the norm - possibly puzzling many developers (What's a glob and
why do I need one?)

The doc is updated as well, and some spell-checking and wording
improvements were done too.

This required some adaptations to the existing `ir.asset` declarations:
- odoo/enterprise#17465
- odoo/design-themes#459

closes odoo/odoo#68695

Related: odoo/upgrade#2348
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-04-07 20:39:10 +00:00
Romain Derie 8fcf930a6b [IMP] web_editor, website, *: introduce popover as edit system for links
*: website_form

This commit introduces a simple & light popover/tooltip (as in Google Doc) when
editing a link.

It will be used:
1. (web_editor) On every page links.
2. (website) In the website navbar, when clicking on a menu, it will replace the
popup shown to ask the user what he wants to do (edit the menu or go to the link
or do nothing). That popup was a bit invasive and old-fashioned.

Part of https://github.com/odoo/odoo/pull/64756
task-2439860

closes odoo/odoo#64756

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-01 09:49:45 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
8cc066173d [IMP] *: Improve assets management
This commit changes the way assets are declared in Odoo modules.

Before: assets were declared in template files. Template bundles were
generated from primary templates, so technically any qweb template could
have been called as an asset bundle, with the 't-call-assets' directive.

Being standard qweb templates, they had access to standard HTML tags
(script, link, with or without raw scripts or style definition), qweb
directives (t-call, t-raw, etc.) and could be inherited by other
templates.

Now: assets are defined in the module's manifest and generated by the
't-call-assets' directive.

More information on the new system can be found on the updated user
documentation (see the "JavaScript Reference" section).

Task: 2352566

Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Xavier Morel 2eb007074c [IMP] website: mockify test
instead of using ad-hoc weirds

closes odoo/odoo#66682

X-original-commit: 7a42cc19492ada223678b6b67fc85fb121155e2b
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-02-23 12:18:07 +00:00
Romain Derie 5e8ca1996e [FIX] website: add tests for #64446
As `standalone` tests were introduced in 14.0 (see 0453566a76), this commit
adds tests to ensure the `inherit_id` of COW views are correctly updated on
module updates.
This test could not be rewritten in a regular test and merged in 12.0 as module
operation in tests try to be avoided (see 5e7e7b00b7d).

See #64446 for more information about the original fix.

closes odoo/odoo#66096

X-original-commit: 9d2787b1dc1485ed132ca51d2b2a4c85b8c77d0c
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-02-16 10:27:16 +00:00
Romain Derie 6a9b5bba9b [FIX] base, website: replicate inherit_id update on cow view
Before this commit, only whitelisted fields would be updated on cow views
during a module update.
A field would be whitelisted if he had the same value than the original view,
see it as a heuristic to not write on modified fields.

But `inherit_id` is not that simple, even if the cow view has a different value
than its original view, it doesn't mean it was modified by the user, it is just
because of the cow mechanism that assigned a copied view as inherit_id, which
is just a copy ofthe original one.

We can thus consider `inherit_id` as unchanged and whitelist it if the `key` is
the same.

In practice, it means that cow'd views did not receive the `inherit_id` updates
as in commit https://github.com/odoo/odoo/commit/c8577568a1e39f6692889b3e21652fa3b8df06b2#diff-823e5db841dca1798ff1300e243059a4e1c93343598d2be5a1d1dcd1d2d0c273R537
where `portal.my_account_link` had its `inherit_id` changed from
`portal.frontend_layout` to `portal.user_dropdow`, see https://github.com/odoo/upgrade/pull/2059:

Considering a module update changing `inherit_id` of D from A to B, the
following use cases are expected. Without this fix, D' never move:

CASE 1
  A    A'   B                      A    A'   B
  |    |                 =>                 / \
  D    D'                                  D   D'

CASE 2
  A    A'   B    B'               A    A'   B   B'
  |    |                 =>                 |   |
  D    D'                                   D   D'

CASE 3
    A    B                        A    B
   / \                   =>           / \
  D   D'                             D   D'

CASE 4
    A    B    B'                  A    B   B'
   / \                   =>            |   |
  D   D'                               D   D'

Opw: 2422773
Opw: 2422727
Opw: 2422770
Opw: 2423406
Opw: 2423859
X-original-commit: ff69f11e9c97d63d9319a8094a87af93984aba38
2021-02-12 15:52:37 +00:00
Francois (fge) 402740f73e [ADD] web: add /web/assets for assets bundle
Part of PR 63177
2021-02-15 10:55:00 +01:00
Samuel Degueldre 480327381a [FIX] website, web_editor: fix empty parallax snippet not being removed
Previously, when removing all the content of a snippet, that snippet
would get automatically deleted. This was not the case for parallax
snippets because we previously intended the user to drop the parallax
snippet, empty it, and drop other content inside of it.

Recently, we added the parallax option on all snippets, rendering the
previous workflow obsolete. There is now no longer any reason to keep
empty parallax snippets. This commit fixes that.

task-2446008

closes odoo/odoo#65551

X-original-commit: 61f410b57f1c28bd6464b86d1582c22b7fd846d5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-04 15:18:36 +00:00
qsm-odoo 05627e4815 [IMP] website: test a website style can properly be edited
This test at least ensures that a SCSS edition through the editor can
properly be done and indirectly tests that the assets order is correct
(in prevision of a future asset refactoring).

closes odoo/odoo#64770

X-original-commit: fe19b48831df17352ea7dbb0b7fa2497ac2da38f
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-19 18:56:42 +00:00
qsm-odoo d7be062403 [FIX] website: make automatic specific view on create
SOC for ir.ui.view creation. If a view is created without a website_id,
it should get one if one is present in the context. Also check that
an explicit website_id in create values matches the one in the context.

Note: it was already the case but kinda by chance and not entirely
correct. Most of the time, the 'arch' field was specified as a creation
value... and as it is a computed field with an inverse method, a COW
was triggered. But this had also the inconvenient of creating an extra
generic view without any arch.

closes odoo/odoo#43245

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-14 11:26:59 +00:00
xO-Tx 86f0b53797 [IMP] website: update default theme tour
The goal of this commit is to update the default theme
tour (steps, changes on snippets...) as in other themes tours.

The url was changed in "registerThemeHomepageTour" function since
the homepage tours are supposed to start in edit mode.

task-2375011

closes odoo/odoo#63850

X-original-commit: b8b394f3824a1f07d76bed5f277b935f619dacbf
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-28 16:53:13 +00:00
qsm-odoo e5572c317a [REV] web_editor, *: remove Jabberwock
*: barcodes, mail, mass_mailing, note, test_website, web, web_tour,
   website, website_blog, website_event, website_form, website_forum,
   website_mail_channel, website_mass_mailing, website_profile,
   website_sale, website_twitter, doc

New solutions are being investigated in master. For the moment, it seems
better to remove Jabberwock to unlock difficult forward-port between
14.0 and 14.1/master, until we decide what to do once and for all in
a later master. We may un-revert this later but that would be way easier
than reverting Jabberwock in a few months.

This was done as safely as possible by removing any commit related to
Jabberwock, then resolving conflicts, then reforcing commits from 14.0
that were hugely adapted for 14.1/master, then forcing the whole diff
over a rebased 14.1/master. The only possible miss (other than me making
a mistake) would be commits that were not forward-ported to 14.1 thanks
to Jabberwock handling the issue on its own (I know we had such commits
in website, which I manually included in this revert, see below).

For reference:

Commits which were reforced to their 14.0 version:
- https://github.com/odoo/odoo/commit/1a916fc2362c0b006460d94a219366ade1cce058
- https://github.com/odoo/odoo/commit/fd9e58a675bb7ec1bf97cb77b21b3c65369d51fe
- https://github.com/odoo/odoo/commit/bdfddace29b16404c06a7ebfc0cc242463a0e768
- https://github.com/odoo/odoo/commit/42b3ad10e0b32b7fc72f801e2c67d6baf938c566
- https://github.com/odoo/odoo/commit/710784da1f02d45cbe898da426ba7e2ac63dc711
- https://github.com/odoo/odoo/commit/597585c9b8b1350bcfd84e8433ea6c82060bcc3d
- https://github.com/odoo/odoo/commit/333a9124608ff655bd9ad5e63044a5cb7ef9c636

Commits that were not forward-ported to 14.1/master and now are:
- https://github.com/odoo/odoo/commit/55ff2d971b672dec5f103215be39101c88856b6c
- https://github.com/odoo/odoo/commit/ebbb3de1e5f363689a5ba1647bb4c26416e42d5b

+ Adapt this forward-port: https://github.com/odoo/odoo/pull/60976 (as
  it was simplified for non-stable master version relying to the
  Jabberwock implementation and now needed to be adapted to the
  summernote implementation).
  See `!$el.data('oe-expression') && $el.data('oe-xpath')`

+ Revert https://github.com/odoo/odoo/pull/60477 and reforce original
  14.0 fix https://github.com/odoo/odoo/commit/746bf53b4aecfc601f0581a948d7cb7153812c82

Note: this also means that any good refactoring that was done by the
Jabberwock-related commits is lost for now. Once the revert reaches
master, I'll try and restore what we want from those commits. Here
are their references (but obviously they have the opposite conflicts
than those resolved during this revert):

e766842a92b6 [REM] web_editor,website: empty summernote files
08c94c986e09 [REF] web_editor,web: adapt to new jabberwock editor
1546c1b74713 [REF] mass_mailing: adapt to new jabberwock editor
fd0b963c6028 [REF] website: adapt to new jabberwock editor
0113d05c6c94 [ADD] web_editor: add new Jabberwock editor lib
d0c88a396493 [FIX] web_editor: don't change background color out of the website editor
d52d3d67d4e1 [FIX] web_editor : better icon in text style dropdown
61cb2f0d21da [FIX] web_editor: should not ask if want to leave the page twice
c42012b863b5 [FIX] web_editor: trigger a resize when use the mobile preview
d934d05d6e39 [FIX] web_editor: need to build the snippet before commit it into vDom
495bea924745 [FIX] web_editor: remove box shadow on the #wrap container
bffb5612e689 [ADD] field_html: add resizer in most field_html
f3c94e40cccf [IMP] web_editor: update Jabberwock library to commit 41e4063
cc87dea3ef32 [FIX] web_editor: update header change position to work with JW
5d9b25f66704 [FIX] web_editor: do not insert chars around step icon on click
70d3f0e4630c [IMP] web_editor: update Jabberwock library to commit 0bd94881
a57f13891f82 [FIX] web_editor: open media modal in appropriate tab on dblclick media
5b7537397e08 [IMP] web_editor: update Jabberwock library to commit a7ba7c34
a8d7ec235eeb [FIX] web_editor: adapt iframe Qunit test to new editor
5f794eac7209 [FIX] mass_mailing: hide all panels on show themes
551d45641d19 [IMP] website: remove unused reference
10580e1c102f [IMP] wesbite: add comment in tour
c17049f6b764 [FIX] web_editor: Fix description toggle in pricelist snippet
18a428e854b1 [IMP] web_editor: update Jabberwock library to commit 43a10003
58a161c645a5 [REF] web_editor, website: use editor helper setClass
62dd0bd3bc66 [FIX] web_editor: properly deactivate snippets and reactivate the last
99eebcaa34cb [FIX] web_editor: disable snippet in preview mode on mouse leave options
a84216932958 [FIX] web_editor: fix the image gallery snippet
f8dd4ea3e7d5 [FIX] web_editor: fix shadow selector for Safari
e50a4f3a16de [IMP] web_editor: update Jabberwock library to commit de13ed7e
4a2718f7a5ba [FIX] web_editor: ensure dom is properly cleaned at end of save test
03684c004a4e [FIX] website: ensure reset of bg-image on add bg-video
d63397159708 [FIX] web_editor: fix image remove from images wall
82fa5142f1a5 [IMP] note: restyle note without sheet or resizer
8b9f1ce603d5 [FIX] web_editor: properly mock createWysiwygIntance (sic) in tests
fc2183b66305 [FIX] web_editor: image overlay did not update with changes
cd0d2f5791cd [FIX] web_editor: add color preview to color picker
28a168172454 [FIX] web_editor: restore removal of spinner
67c90dd3b946 [FIX] website_forum: properly initialize editor
920dfe2a430a [FIX] website_forum: better css in the JW toolbar
43f33fd651af [IMP] web_editor: update Jabberwock library to commit 6853b60
71246c92f8de [FIX] Web_editor: table options button should be inside the toolbar
12b9e5916692 [FIX] web_editor: properly update the image options on replace image
e889cf8583da [FIX] website, website_sale: properly save filter id of dynamic snippets
e0fd11e36e45 [IMP] web_editor: update Jabberwock library to commit 4b2c903b
8f2b7ba35614 [FIX] web_editor: properly stop snippet option changed event propagation
a30c2c4105c7 [FIX] website: fix megamenu snippet editor behavior
312091cf822b [FIX] web_editor: fix overlay that is not reappearing
9f1d03dda613 [FIX] web_editor: table picker not fully displayed
814ddada6124 [IMP] web_editor: remove message before leaving page if editor is destro
4f38e26af7da [FIX] web: allow saving copyright footer
01e947b6123b [FIX] web_editor: only save translations that changed
103676072c50 [FIX] web_editor: prevent traceback on open crop dialog
5844ff66d4a0 [FIX] web_editor: apply image crop in jw on save dialog
1b435652e4a0 [FIX] website_forum: ensure media modal opens on click button
4f4a6ca0b8ac [FIX] web_editor: ensure valid default html value
51e22026ac7b [IMP] web_editor: update Jabberwock library to commit ab1184f8
2413fa19be0e [FIX] web_editor: Qunit test properly wait for editor stop
aa89e1ea3e97 [FIX] web_editor: properly save view blocks with an id
e2e90b53992e [FIX] web_editor: ensure language selector is non editable
0efd72089d5c [IMP] web_editor: clean useless lines
f54dfc7631f9 [IMP] web_editor: remove useless comment
3995ab1b84f2 [IMP] web_editor: update Jabberwock library to commit b8d73691
0834b1e5740a [IMP] web_editor: withDomMutations
f1459fb7b45c [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
6e8acc6c8cc7 [IMP] web_editor: update Jabberwock library to commit 3bbb175c
18a0c95d51cb [FIX] website, web_editor: #wrapwrap in body
4686a92e742c [FIX] website_form: allow edition of success message
78cc4da075cc [FIX] web_editor: allow edition of branded nodes only
bcffa7353448 [FIX] web: dialog should not use field value footer items
67ff56e14746 [FIX] web_editor,website_mass_mailing: display the popup preview
3cb9bea50c20 [IMP] web_editor: update Jabberwock library to commit a20492ea
518f03e6f1c9 [FIX] web_editor: use withIntangibles to find ZoneNode
d0ad6a568f49 [FIX] website: move sidebar out of theme
d690f5da13ea [FIX] website: properly save popup id
43b3433df3e6 [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
4ee8f4dedc30 [FIX] web_editor: prevent deadlock when removing child snippet of popup
850be198ef6d [FIX] web_editor: prevent traceback on reposition background image
4c3eaba41f5d [FIX] mass_mailing: adapt tour to the new editor design.
496d3ea272ed [FIX] web_editor: properly position sidebar scrollbar
5be4de703074 [FIX] web_editor: Show the toolbar when select the text in forum edition

closes odoo/odoo#63768

Related: odoo/enterprise#15458
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-24 13:36:49 +00:00
6d6f42f489 [REF] website: adapt to new jabberwock editor
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2020-10-14 10:29:11 +00:00
Raphael Collet b951579d31 [FIX] core: non-stored binary fields should have attachment=False
This prevents some code (in controllers) to retrieve an attachment for a
field that is not stored, as the code only relies on `field.attachment`.
This also makes the field definition more consistent.

closes odoo/odoo#57980

X-original-commit: 7325c3f8c538a8b8c0435963cdda3ced6fe4b324
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-09-17 16:54:02 +00:00
Jeremy Kersten c2c2fed0a2 [FIX] website: make test determinist for single install
When running -i website --test-enable, the test was falsy.
The last page created page was present in matching_page wich one is a criteria
to be excluded from last modified page to avoid duplicate suggested page.

Now we substract correctly them before comparison.

https://github.com/odoo/odoo/blob/saas-13.4/addons/website/controllers/main.py#L243

closes odoo/odoo#57777

X-original-commit: 19319a7f88f474a6410ea1dabc6bcc1ac51e97bb
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-15 16:49:40 +00:00
Jeremy Kersten 72753073da [IMP] website: remove extra step of banner tour
Now that we will write tour by theme, this part is useless.
We just keep the old steps that will be not covered by future theme tour.

task-2172208

X-original-commit: 02e1b1f659d5f588cc4e52f48217f8e2c7771ad4
2020-09-11 16:31:49 +00:00
Victor Feyens 2f3dcb8947 [IMP] base,website*: do not store country flags.
1) Avoid the storage of all country flags as ir_attachment (230+
ir_attachment in a new db) to reduce the filestore of databases.

The country flags are nearly static and not expected to be modified on
Odoo instances.

This change is based on the new "image_url" widget logic (see previous commits).

2) Extend the flag coverage for countries

Add the missing country flags & specify a mapping to provide flags
for overseas administrated countries/territories.
2020-09-02 16:43:45 +00:00
Cocographique 118057927e [IMP] portal, website: review sign in templates
Move it in an external view to be able to place it at a different
location depending on the header template.

Part of https://github.com/odoo/odoo/pull/56427
task-2264627

X-original-commit: b4866d192e6f4fdfba15b65fa2c209b35b7eb8c0
2020-08-28 08:19:37 +00:00
Jeremy Kersten cbf8d3b304 [IMP] website: perf - cache public page
closes odoo/odoo#56331

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-08-21 17:50:00 +00:00
Lucas Perais (lpe) 9708c6e992 [IMP] bus: notify user when assets have changed
Use case:
When the server is restarted, the python is updated,
but some users may have an ongoing session in a browser tab
This may lead to code being unsynchronized and ultimately to some
odd bugs.

Purpose:
When we are in such a case, that is, the assets were recomputed
after a update of the code and a restart of the server by the request of another user,
notify connected users that assets have changed.
Then propose them to reload the page.

Known caveats:
- This is not a developer's feature.
Since assets computing is ORM cached, they have limited
opportunities to rebuild. Namely, the feature won't trigger
each time the JS has changed, rather, it will
when JS has changed AND the cache has been reset somehow (e.g. when the server is restarted).

- This not a portal/website feature either, but only in backend.
Business clients won't be notified that the JS has changed.

- While requests debug=assets do trigger a recomputing
of the *components* of bundles, they do not save a bundle
This means that the requests that sends the notification
cannot be debug=assets.

Task 2034462

closes odoo/odoo#39875

Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
2020-08-21 12:16:25 +00:00