<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web/static/src/js/core/ajax.js, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[FIX] *: bunch of mismarked translation specifiers</title>
<updated>2021-04-29T05:46:03+00:00</updated>
<author>
<name>Xavier Morel</name>
<email>xmo@odoo.com</email>
</author>
<published>2021-04-28T11:46:52+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=251b77c959af37fa0da6739ea978ca4f198414cb'/>
<id>251b77c959af37fa0da6739ea978ca4f198414cb</id>
<content type='text'>
`_(xyz)` will wrap them in an underscore.js object, which when used in
a string context will just return the string. So it's basically a
no-op, but it certainly doesn't translate the terms.

closes odoo/odoo#70000

Related: odoo/enterprise#18001
Signed-off-by: Xavier Morel (xmo) &lt;xmo@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`_(xyz)` will wrap them in an underscore.js object, which when used in
a string context will just return the string. So it's basically a
no-op, but it certainly doesn't translate the terms.

closes odoo/odoo#70000

Related: odoo/enterprise#18001
Signed-off-by: Xavier Morel (xmo) &lt;xmo@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website: an erroneous Google font makes website not editable</title>
<updated>2021-01-19T08:32:14+00:00</updated>
<author>
<name>nie</name>
<email>nie@odoo.com</email>
</author>
<published>2021-01-18T14:32:46+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=604c07edcd4da8cf2a663d06ba91f137eb74691b'/>
<id>604c07edcd4da8cf2a663d06ba91f137eb74691b</id>
<content type='text'>
Steps:
- Go to "Website" &gt; "Go to Website"
- Click Edit in the top right corner
- Click Options
- Select "Add a Google Font" in the Font Family field
- Insert an erroneous Google Font link (e.g. https://fonts.google.com/specimen/Robotoj )
- Save &amp; Reload
- Click Edit again

Bug:
The Edit button is not responding anymore

Explanation:
We try to `@import` the link in multiple files.
For example, here: https://github.com/odoo/odoo/blob/70eb39b0cf30c1acf9a7116e109874b60e27aa2c/addons/website/static/src/scss/website.scss#L10
An erroneous font family results in an error 400 from the Google Fonts
server. This prevents parts of the JS to load and makes it impossible to
enter the edition mode.

`EditPageMenu` handles the behavior when clicking on the Edit button.
This menu depends on `website.compiled_assets_wysiwyg` as seen here:
https://github.com/odoo/odoo/blob/b02a99bec709b5a6dc4dabb6cb81435dadc24e7e/addons/website/static/src/js/menu/edit.js#L10-L14
Since there is an error generating the file, the Promise fails but the
error is not handled:
https://github.com/odoo/odoo/blob/70eb39b0cf30c1acf9a7116e109874b60e27aa2c/addons/web/static/src/js/core/ajax.js#L164-L168
This commit prevents CSS loading errors from silently failing. The crash
screen will only show up if the user is logged in and has edition
rights.

This commit also prevents the user from posting the form if the font is
not accessible. At the moment, querying an unknown Google font from a
script will result in a CORS error. A valid one will pass just fine. In
case Google changes the behavior of these queries and allows the 400 to
be sent, the fix also checks if the query returned an `ok` status code.

opw:2439073

closes odoo/odoo#64695

Signed-off-by: backspac &lt;backspac@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steps:
- Go to "Website" &gt; "Go to Website"
- Click Edit in the top right corner
- Click Options
- Select "Add a Google Font" in the Font Family field
- Insert an erroneous Google Font link (e.g. https://fonts.google.com/specimen/Robotoj )
- Save &amp; Reload
- Click Edit again

Bug:
The Edit button is not responding anymore

Explanation:
We try to `@import` the link in multiple files.
For example, here: https://github.com/odoo/odoo/blob/70eb39b0cf30c1acf9a7116e109874b60e27aa2c/addons/website/static/src/scss/website.scss#L10
An erroneous font family results in an error 400 from the Google Fonts
server. This prevents parts of the JS to load and makes it impossible to
enter the edition mode.

`EditPageMenu` handles the behavior when clicking on the Edit button.
This menu depends on `website.compiled_assets_wysiwyg` as seen here:
https://github.com/odoo/odoo/blob/b02a99bec709b5a6dc4dabb6cb81435dadc24e7e/addons/website/static/src/js/menu/edit.js#L10-L14
Since there is an error generating the file, the Promise fails but the
error is not handled:
https://github.com/odoo/odoo/blob/70eb39b0cf30c1acf9a7116e109874b60e27aa2c/addons/web/static/src/js/core/ajax.js#L164-L168
This commit prevents CSS loading errors from silently failing. The crash
screen will only show up if the user is logged in and has edition
rights.

This commit also prevents the user from posting the form if the font is
not accessible. At the moment, querying an unknown Google font from a
script will result in a CORS error. A valid one will pass just fine. In
case Google changes the behavior of these queries and allows the 400 to
be sent, the fix also checks if the query returned an `ok` status code.

opw:2439073

closes odoo/odoo#64695

Signed-off-by: backspac &lt;backspac@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] *: convert to private methods</title>
<updated>2020-05-14T11:59:10+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@odoo.com</email>
</author>
<published>2020-02-14T10:22:15+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d9287caf9408bb4ff85ad734cbca08e44321e205'/>
<id>d9287caf9408bb4ff85ad734cbca08e44321e205</id>
<content type='text'>
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web, web_editor: allow editor instantiation from public user</title>
<updated>2020-04-10T11:54:03+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2020-04-03T15:26:58+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e4a710351758e94a0743160050e50320546e6b07'/>
<id>e4a710351758e94a0743160050e50320546e6b07</id>
<content type='text'>
If for some reason someone wanted to develop a textarea using the
editor which is supposed to work as a public user (like we are trying
to do on Odoo.com), it was not possible. The code was "designed" to
allow it but there was one problem: the lazy loading of the editor
assets required a `render_template` call to the server... which cannot
be done from a public user.

This commit solves the issues by allowing the lazy loading of assets
to use a custom route if required. That route is then used by the editor
"root". That route performs the render_template as a superuser provided
that the view's xmlid is whitelisted.

Note: there was another unauthorized call for public user: the
colorpicker. This was solved by disabling the colorpicker template rpc
for public user, they will still get the default summernote one.

Part of https://github.com/odoo/odoo/pull/48981

closes odoo/odoo#48981

closes odoo/odoo#49398

X-original-commit: e84a0bfdc99c21406861b88c02b11c925d92f927
Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If for some reason someone wanted to develop a textarea using the
editor which is supposed to work as a public user (like we are trying
to do on Odoo.com), it was not possible. The code was "designed" to
allow it but there was one problem: the lazy loading of the editor
assets required a `render_template` call to the server... which cannot
be done from a public user.

This commit solves the issues by allowing the lazy loading of assets
to use a custom route if required. That route is then used by the editor
"root". That route performs the render_template as a superuser provided
that the view's xmlid is whitelisted.

Note: there was another unauthorized call for public user: the
colorpicker. This was solved by disabling the colorpicker template rpc
for public user, they will still get the default summernote one.

Part of https://github.com/odoo/odoo/pull/48981

closes odoo/odoo#48981

closes odoo/odoo#49398

X-original-commit: e84a0bfdc99c21406861b88c02b11c925d92f927
Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: fix ajax.loadAsset cache</title>
<updated>2020-04-10T11:54:02+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2020-04-03T13:33:44+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=cf85f3b082c49a21cfde0d04299a80724a40f420'/>
<id>cf85f3b082c49a21cfde0d04299a80724a40f420</id>
<content type='text'>
The caching system which was implemented was not working if the
same asset was asked twice "at the same time" = "if the second demand
occured while the first demand's RPC loading was taking place".

Part of https://github.com/odoo/odoo/pull/48981

X-original-commit: ba0ac348a3700331cec6955625ca2b6c72600ced</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The caching system which was implemented was not working if the
same asset was asked twice "at the same time" = "if the second demand
occured while the first demand's RPC loading was taking place".

Part of https://github.com/odoo/odoo/pull/48981

X-original-commit: ba0ac348a3700331cec6955625ca2b6c72600ced</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website, *: lazy load widget assets of the correct website</title>
<updated>2020-02-05T10:48:44+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2020-02-03T18:06:39+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=6f4c60fe1bb6e460ec6da00c59a9825271893729'/>
<id>6f4c60fe1bb6e460ec6da00c59a9825271893729</id>
<content type='text'>
*: web

Before this commit, when a widget declared assets to lazy load through
the assetLibs key, the asset was loaded through a context-less call to
the server through the base `rpc` function. This caused problems in
website: the website ID was not given to the called route and the loaded
assets were then stripped of their specific-website parts.

This commit solves the problem by allowing the `loadLibs` and
`loadAsset` functions to receive an extra argument: an extra `context`
to use for the actual call to the server. The method is now available
in the ajax service, so that website can add its custom context
automatically, the same way it does it for normal `_rpc` calls.

Part of https://github.com/odoo/odoo/pull/44596

closes odoo/odoo#44596

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
*: web

Before this commit, when a widget declared assets to lazy load through
the assetLibs key, the asset was loaded through a context-less call to
the server through the base `rpc` function. This caused problems in
website: the website ID was not given to the called route and the loaded
assets were then stripped of their specific-website parts.

This commit solves the problem by allowing the `loadLibs` and
`loadAsset` functions to receive an extra argument: an extra `context`
to use for the actual call to the server. The method is now available
in the ajax service, so that website can add its custom context
automatically, the same way it does it for normal `_rpc` calls.

Part of https://github.com/odoo/odoo/pull/44596

closes odoo/odoo#44596

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: client-side RPC error to have an arguments data member</title>
<updated>2020-01-21T06:56:14+00:00</updated>
<author>
<name>Xavier Morel</name>
<email>xmo@odoo.com</email>
</author>
<published>2019-12-06T08:58:04+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=f9c8a7e7d8347b8f217da5c4f3ef05fbf1948ba4'/>
<id>f9c8a7e7d8347b8f217da5c4f3ef05fbf1948ba4</id>
<content type='text'>
Several XHR error handlers expect a data.arguments member which holds
the args tuple from the Python exception.

Some have alternate codepaths for "xhr errors" but several
don't (e.g. addons/payment/static/src/js/payment_form.js:142,
addons/web/static/src/js/services/crash_manager.js:229,
addons/website/static/src/js/content/website_root.js:167) and will
thus blow up on synthetic client-side xhr errors.

Modify the synthetic errors so they provide that member as an array.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Several XHR error handlers expect a data.arguments member which holds
the args tuple from the Python exception.

Some have alternate codepaths for "xhr errors" but several
don't (e.g. addons/payment/static/src/js/payment_form.js:142,
addons/web/static/src/js/services/crash_manager.js:229,
addons/website/static/src/js/content/website_root.js:167) and will
thus blow up on synthetic client-side xhr errors.

Modify the synthetic errors so they provide that member as an array.</pre>
</div>
</content>
</entry>
<entry>
<title>[MERGE] Forward port of saas-12.4 to master up to 1f5a4649a67908</title>
<updated>2019-07-15T08:12:26+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@odoo.com</email>
</author>
<published>2019-07-15T07:07:48+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=fd15ca19183a765e1307c4d197bf0dda30b73ab7'/>
<id>fd15ca19183a765e1307c4d197bf0dda30b73ab7</id>
<content type='text'>
closes odoo/odoo#34850

Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes odoo/odoo#34850

Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[MERGE] Forward port of saas-12.3 to saas-12.4 up to 87fc1554d6a1823</title>
<updated>2019-07-12T13:59:35+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@odoo.com</email>
</author>
<published>2019-07-12T13:09:45+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=1f5a4649a67908ecb6acfec37673c8149de0471f'/>
<id>1f5a4649a67908ecb6acfec37673c8149de0471f</id>
<content type='text'>
closes odoo/odoo#34820

Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes odoo/odoo#34820

Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[MERGE] forward port branch saas-12.2 up to be5e8fdab80</title>
<updated>2019-07-05T14:14:48+00:00</updated>
<author>
<name>Christophe Simonis</name>
<email>chs@odoo.com</email>
</author>
<published>2019-07-05T14:14:48+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=66bb578ac9f0cc260a5b7f859fc0bb4fcfab6e25'/>
<id>66bb578ac9f0cc260a5b7f859fc0bb4fcfab6e25</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
