Commit Graph
8 Commits
Author SHA1 Message Date
Guillaume (gdi) be90d8abae [IMP] test_website: add a test of multi websites settings
In the website settings, one of the fields allows you to switch settings
from one website to another. Unfortunately, as soon as the user did this
the record was considered to have changed (dirty) and therefore required
a save when it wasn't necessary. The previous commit prevents the header
settings (like the website switcher) from dirtying the record. This was
really necessary because as soon as a user had several websites, it was
impossible for him to access certain settings on all these websites
(except the first one). As soon as the setting performed an action, a
save was required (because the record was dirty) and the user was
redirected to the settings again.
Steps to reproduce the issue before the previous commit:

Install website
Have multiple websites
Go to Settings > Website Settings
Change the website
=> The user is notified that the record has changed and needs to be
saved, which is not true. So far it's annoying but not critical, but if
the user continues:

Activate the "Extra step during checkout" option
Click on "Configure Form"
=> The Save/Discard dialog appears because the record is dirty.

Click on "Save"
=> The user is redirected to the settings page again and cannot access
the form configuration of the second website. (it is the same issue for
most of actions).

The previous commit fixes the issue and this commit adds a test to
ensure that the users are able to change settings of multiple websites.

task-3265100

closes odoo/odoo#126387

X-original-commit: bed37396839891da04126a71b3d6a6e5e56672b0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-06-26 22:15:17 +02: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
Benoit Socias 28f0853a2d [FIX] web_editor, test_website: will fix the deletion of custom snippets
This commit is a manual forward port of #62555. The tour test needed to
be adapted because the navigation flow is slightly different: upon
custom snippet creation, the editor page used to be saved and reloaded
in 14.0 but this is not the case anymore.

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#63108

X-original-commit: 4de0519d5b54634604e22b32d91a099695378088
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-10 08:28:14 +00:00
Jeremy Kersten dc77f67cad [FIX] website: match get/post in is_multilang_url
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 /<lang>/get.

Closes #37223

closes odoo/odoo#40519

X-original-commit: c7650106f8588083be12812600a6c94ba703fd6f
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-26 14:35:46 +00:00
Jeremy Kersten 3a7033463e [FIX] website: allow authenticate in json multidb
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) <jke@openerp.com>
2019-10-17 15:35:11 +00:00
fja-odoo 90818fd083 [IMP] test_website: add test tour for the website errors
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
2019-06-28 08:53:52 +00:00
Romain Derie fdbf11643f [IMP] *: move test and tour files to new folder hierarchy and asset
As we now have a new debug mode 'tests' which load a new asset bundle
containing tour-test files, we moved those files to a new folder hierarchy.
That will clean the .js files trees.
Also, those files should be included in the new asset.

Basically, the .js tour files (not test) should be inside /static/src/js/tours
while .js tour test files (test=true) should be inside /static/tests/tours next
to QUnit tests, inside a tours folder.

+ test_new_api: don't run the test in debug assets

task-1934445
Comes with https://github.com/odoo/enterprise/pull/4281
Closes #33213
2019-06-05 05:56:33 +00:00
Romain Derie"Romain Derie <rde@odoo.com>""Jérémy Kersten <jke@openerp.com>"
ef03db9edd [FIX] website: restore reset_templates functionality
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 <rde@odoo.com>"
Co-authored-by: "Jérémy Kersten <jke@openerp.com>"

closes odoo/odoo#29957
2019-02-13 20:33:18 +00:00