<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/test_website/tests/__init__.py, 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] test_website: add tests for website.rewrite</title>
<updated>2021-01-12T10:13:40+00:00</updated>
<author>
<name>Romain Derie</name>
<email>rde@odoo.com</email>
</author>
<published>2021-01-11T19:27:02+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=afc74fa8a85cade6f1342d4d9141f70ed8258d42'/>
<id>afc74fa8a85cade6f1342d4d9141f70ed8258d42</id>
<content type='text'>
Basic tests &amp; tests of the 3 fixes of #64328</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Basic tests &amp; tests of the 3 fixes of #64328</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor, test_website: will fix the deletion of custom snippets</title>
<updated>2020-12-09T12:24:26+00:00</updated>
<author>
<name>Benoit Socias</name>
<email>bso@odoo.com</email>
</author>
<published>2020-11-27T15:42:23+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=4de0519d5b54634604e22b32d91a099695378088'/>
<id>4de0519d5b54634604e22b32d91a099695378088</id>
<content type='text'>
Before this commit the deletion of custom snippets failed because the
button click event got intercepted by the drag'n'drop mechanism.
The currentTarget of the event was used in an asynchronous call where it
had already been replaced by the jQuery's event bubbling mechanism when
invoking the other handler.

After this commit the deletion of custom snippets works again and a test
tour is introduced to make sure it does not get broken again

task-2405854

closes odoo/odoo#62555

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit the deletion of custom snippets failed because the
button click event got intercepted by the drag'n'drop mechanism.
The currentTarget of the event was used in an asynchronous call where it
had already been replaced by the jQuery's event bubbling mechanism when
invoking the other handler.

After this commit the deletion of custom snippets works again and a test
tour is introduced to make sure it does not get broken again

task-2405854

closes odoo/odoo#62555

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] website: clean and add perf tests</title>
<updated>2020-03-26T18:12:47+00:00</updated>
<author>
<name>Romain Derie</name>
<email>rde@odoo.com</email>
</author>
<published>2020-03-26T18:06:08+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=af68fcde4858b6a1e6c672b55f1465bf29e371cc'/>
<id>af68fcde4858b6a1e6c672b55f1465bf29e371cc</id>
<content type='text'>
  - Refactor for easier readability
  - Add a test to ensure menu hierarchy scale correctly.
  - Add tests for image controllers
  - Add test for assets controllers

task-2211013</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  - Refactor for easier readability
  - Add a test to ensure menu hierarchy scale correctly.
  - Add tests for image controllers
  - Add test for assets controllers

task-2211013</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website: match get/post in is_multilang_url</title>
<updated>2019-11-26T14:35:46+00:00</updated>
<author>
<name>Jeremy Kersten</name>
<email>jke@odoo.com</email>
</author>
<published>2019-11-15T08:19:43+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=dc77f67cad95d0b0bd316cbdfc36a380f2daf73d'/>
<id>dc77f67cad95d0b0bd316cbdfc36a380f2daf73d</id>
<content type='text'>
Old heuristic is not more True:
Force to check method to POST. Odoo uses methods : ['POST'] and ['GET', 'POST']

We have some controller that only allow 'GET' method, so we need to check GET
also when we try to know if an url is multilang or not.

This commit fix case where a controller '/test' only allow GET and you were in
another language that the default, in this case, the rendered url in qweb was
/get instead of /&lt;lang&gt;/get.

Closes #37223

closes odoo/odoo#40519

X-original-commit: c7650106f8588083be12812600a6c94ba703fd6f
Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Old heuristic is not more True:
Force to check method to POST. Odoo uses methods : ['POST'] and ['GET', 'POST']

We have some controller that only allow 'GET' method, so we need to check GET
also when we try to know if an url is multilang or not.

This commit fix case where a controller '/test' only allow GET and you were in
another language that the default, in this case, the rendered url in qweb was
/get instead of /&lt;lang&gt;/get.

Closes #37223

closes odoo/odoo#40519

X-original-commit: c7650106f8588083be12812600a6c94ba703fd6f
Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website: allow authenticate in json multidb</title>
<updated>2019-10-17T15:35:11+00:00</updated>
<author>
<name>Jeremy Kersten</name>
<email>jke@odoo.com</email>
</author>
<published>2019-10-07T08:56:02+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=3a7033463ea98def2e3fb85333c4f00f7c7d6925'/>
<id>3a7033463ea98def2e3fb85333c4f00f7c7d6925</id>
<content type='text'>
Before this commit launch a server with --db-filter that match at least 2 dbs name
Try to authenticate

You will have an error request is unbound when you try to access request.env

Now we retrieve the user from self instead of the request.

New test to ensure rpc authentication is tested.

Related to commit 245ef4b1

closes odoo/odoo#38969

X-original-commit: 4b3400c430bec7539aada0619fd203978daca2d8
Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit launch a server with --db-filter that match at least 2 dbs name
Try to authenticate

You will have an error request is unbound when you try to access request.env

Now we retrieve the user from self instead of the request.

New test to ensure rpc authentication is tested.

Related to commit 245ef4b1

closes odoo/odoo#38969

X-original-commit: 4b3400c430bec7539aada0619fd203978daca2d8
Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] test_website: add test tour for the website errors</title>
<updated>2019-06-28T08:53:52+00:00</updated>
<author>
<name>fja-odoo</name>
<email>fja@odoo.com</email>
</author>
<published>2019-06-11T12:26:53+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=90818fd083774988c331d741d34181a5af5ecd3a'/>
<id>90818fd083774988c331d741d34181a5af5ecd3a</id>
<content type='text'>
The purpose of these tests is to verify that errors informations
are displayed correctly on the website.

Part of https://github.com/odoo/odoo/pull/32132
task-1894820</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The purpose of these tests is to verify that errors informations
are displayed correctly on the website.

Part of https://github.com/odoo/odoo/pull/32132
task-1894820</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] test_website: Add multi-company test</title>
<updated>2019-06-27T08:24:32+00:00</updated>
<author>
<name>lul-odoo</name>
<email>lul@odoo.com</email>
</author>
<published>2019-06-27T08:22:55+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7ea21adabe007eff6b5b69aa451d756dff54442b'/>
<id>7ea21adabe007eff6b5b69aa451d756dff54442b</id>
<content type='text'>
Purpose
=======

This commit tests some behaviors with multi company
mode after changes brought by f847a46.

Specification
=============

The website company should be automatically set in the
context as 'allowed_company_ids'.

That way, we can remove the switch company menu on the
website, which doesn't make a lot of sense.

This test enforce this behavior.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purpose
=======

This commit tests some behaviors with multi company
mode after changes brought by f847a46.

Specification
=============

The website company should be automatically set in the
context as 'allowed_company_ids'.

That way, we can remove the switch company menu on the
website, which doesn't make a lot of sense.

This test enforce this behavior.
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] odoo: ignore unsupported args from controller</title>
<updated>2019-06-08T13:53:57+00:00</updated>
<author>
<name>Jeremy Kersten</name>
<email>jke@odoo.com</email>
</author>
<published>2019-06-07T06:22:41+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=521f7d36c1ff929ea52e9ed6fd4170bd3b968b19'/>
<id>521f7d36c1ff929ea52e9ed6fd4170bd3b968b19</id>
<content type='text'>
Before this commit, call a controller defined as:

```
@http.route('/route', type='http', auth='public')
def controller_func(self, foo):
do_it()
```

and called with url like /route?foo=1&amp;bar=2

will crash with an exception:
`TypeError: controller_func() got an unexpected keyword argument 'bar'`

Now, we remove the extra parameters if the controller doesn't support it.
This case is not uncommon, you can easily arrive in this case with utm or
debug as extra parameter.

closes odoo/odoo#33962

Signed-off-by: Christophe Simonis &lt;chs@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, call a controller defined as:

```
@http.route('/route', type='http', auth='public')
def controller_func(self, foo):
do_it()
```

and called with url like /route?foo=1&amp;bar=2

will crash with an exception:
`TypeError: controller_func() got an unexpected keyword argument 'bar'`

Now, we remove the extra parameters if the controller doesn't support it.
This case is not uncommon, you can easily arrive in this case with utm or
debug as extra parameter.

closes odoo/odoo#33962

Signed-off-by: Christophe Simonis &lt;chs@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website: delete cow view on module update</title>
<updated>2019-03-05T11:04:52+00:00</updated>
<author>
<name>Romain Derie</name>
<email>rde@odoo.com</email>
</author>
<published>2019-02-20T19:05:28+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=5a81d88837c30365c9f06843715dfc9cbb2397f3'/>
<id>5a81d88837c30365c9f06843715dfc9cbb2397f3</id>
<content type='text'>
Before this commit, when a view was removed during a module update (eg: the
record was deleted from the file), its COW views would not be deleted.

This could lead to unwanted behaviors including tracebacks(1).

This commit is somehow related/an extension of b5fe23055d that handle COW view
write during module update and 2e32cc5aa3 that remove COW views during module
uninstall.

task-1931683

Note: Some existing tests had to be run post install

(1) A view doing a t-call is COW'd, then that view and its t-called view are
    removed. If the cow view is not removed, the t-call will crash (see tests
    in this commit for detailed case).

closes odoo/odoo#31295

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, when a view was removed during a module update (eg: the
record was deleted from the file), its COW views would not be deleted.

This could lead to unwanted behaviors including tracebacks(1).

This commit is somehow related/an extension of b5fe23055d that handle COW view
write during module update and 2e32cc5aa3 that remove COW views during module
uninstall.

task-1931683

Note: Some existing tests had to be run post install

(1) A view doing a t-call is COW'd, then that view and its t-called view are
    removed. If the cow view is not removed, the t-call will crash (see tests
    in this commit for detailed case).

closes odoo/odoo#31295

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website: restore reset_templates functionality</title>
<updated>2019-02-13T20:33:18+00:00</updated>
<author>
<name>Romain Derie</name>
<email>rde@odoo.com</email>
</author>
<published>2018-12-28T15:24:33+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=ef03db9edd9472201cb2c08a32d20ff0f33a5fdf'/>
<id>ef03db9edd9472201cb2c08a32d20ff0f33a5fdf</id>
<content type='text'>
Since AST was introduced to compile Qweb templates, the reset templates
functionality is not working anymore.
Actually, it does not even appear anymore as the conditions to trigger and show
the reset view behavior can't be True anymore.
Indeed, the code is still importing the old QWebException from odoo.exceptions
which is now just an empty class.
The QWebException that should now be used is the one from odoo.base.models.qweb

More than just a wrong import, the QWebException properties have completely
changed.

Since its last working version (Odoo 9.0), a lot of changes occured, mostly:
  - Odoo 11.0: new model website.page, which completely changed the pages
    behavior and changed the models.
  - Odoo 12.0: multi-website, which introduced the Copy On Write (COW) that
    redefined how we write on view in a website context. We now need to reset
    copied/specific views that have no model_data_id.

This fix is for a stable version. There is some flows that can't be fixed
without a refactoring or new fields (mainly because of the arch_fs being
erased when writing on `arch`, plus we can't introduce a module reload in
stable).
The goal of this commit is to fix the basic and standard case of broken views,
which is when non-technical users are breaking the views through HTML editor.

To reset the views, we will read the original arch in the XML file, as the
dev mode is doing.
To be eligible for the reset, the broken view need an `arch_fs` set. If the
view arch has been modified anywhere else than the frontend, the `arch_fs`
will be erased and the view wont be able to be reset.
As the broken views will be specific views, we will simply read the generic
view in the XML file and write it on the specific. We can't simply remove the
specific view as we might be on a specific tree.

Specific case, in case of custom views create dropping a snippet in an oe_struc
we just delete this inehrited view to allow end user to have their page back.

In some case of bad compilation in sub template, we try to guess which inherited
view, t-called view is broken by string matching based on 'last_path_node' xpath.

Add new module test_website to add tests, it will be usefull for futur test of
install/uninstall and ...

Todo in master:
  - try to track on QWebException the real template that is broken and not only
    the last node from the main template.

Co-authored-by: "Romain Derie &lt;rde@odoo.com&gt;"
Co-authored-by: "Jérémy Kersten &lt;jke@openerp.com&gt;"

closes odoo/odoo#29957</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since AST was introduced to compile Qweb templates, the reset templates
functionality is not working anymore.
Actually, it does not even appear anymore as the conditions to trigger and show
the reset view behavior can't be True anymore.
Indeed, the code is still importing the old QWebException from odoo.exceptions
which is now just an empty class.
The QWebException that should now be used is the one from odoo.base.models.qweb

More than just a wrong import, the QWebException properties have completely
changed.

Since its last working version (Odoo 9.0), a lot of changes occured, mostly:
  - Odoo 11.0: new model website.page, which completely changed the pages
    behavior and changed the models.
  - Odoo 12.0: multi-website, which introduced the Copy On Write (COW) that
    redefined how we write on view in a website context. We now need to reset
    copied/specific views that have no model_data_id.

This fix is for a stable version. There is some flows that can't be fixed
without a refactoring or new fields (mainly because of the arch_fs being
erased when writing on `arch`, plus we can't introduce a module reload in
stable).
The goal of this commit is to fix the basic and standard case of broken views,
which is when non-technical users are breaking the views through HTML editor.

To reset the views, we will read the original arch in the XML file, as the
dev mode is doing.
To be eligible for the reset, the broken view need an `arch_fs` set. If the
view arch has been modified anywhere else than the frontend, the `arch_fs`
will be erased and the view wont be able to be reset.
As the broken views will be specific views, we will simply read the generic
view in the XML file and write it on the specific. We can't simply remove the
specific view as we might be on a specific tree.

Specific case, in case of custom views create dropping a snippet in an oe_struc
we just delete this inehrited view to allow end user to have their page back.

In some case of bad compilation in sub template, we try to guess which inherited
view, t-called view is broken by string matching based on 'last_path_node' xpath.

Add new module test_website to add tests, it will be usefull for futur test of
install/uninstall and ...

Todo in master:
  - try to track on QWebException the real template that is broken and not only
    the last node from the main template.

Co-authored-by: "Romain Derie &lt;rde@odoo.com&gt;"
Co-authored-by: "Jérémy Kersten &lt;jke@openerp.com&gt;"

closes odoo/odoo#29957</pre>
</div>
</content>
</entry>
</feed>
