Avoid redirect from /favicon.ico to /<lang>/facivon.ico at each request
closesodoo/odoo#40535
X-original-commit: 94bcbc92e5e5a6fd3de7267e3c01f8c11fb045f4
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
load_lang was a kind of hybrid method trying to active or creating a
language if not found. This was error prone.
Instead rely on two methods with clear purpose:
ResLang._create_lang(lang, lang_name=None)
- create a new res.lang entry using the locale of the server
return the res.lang record to match the API of _activate_lang
ResLang._active_lang(code)
- activate the given code lang
Most of the time, _active_lang is what is expected
tools.trans_load_data and IrTranslation._load_module_terms no longer
activate the language if not active.
Loading the translations should be explicit on an activated language,
it is too error prone to silently activate/create a language if not
found.
Remove lang_name from trans_load_data as no longer needed.
This commit introduces a nicer 404 page, which is basically the same layout as
the one used on Odoo.com.
Also, the 404 is now fully customizable, blocks can be drag'd & drop'd.
task-1966460
closesodoo/odoo#38901
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Previously, background size and position for snippets was configured in
a modal, the user could choose a "focus point", which is rather
unintuitive. They could also choose to use the "contain" background
mode, with or without repeat, or a third option, where they could
customize everything, from the background size in both directions to
whether to repeat the background in only one or in both directions.
This commit streamlines the background-sizing options, only the "cover"
and "repeat pattern" options have been kept, as they cover almost every
use case. Their configuration has been moved into the options menu for
consistency with the rest of the editor, and the background's position
is now chosen by clicking on the corresponding menu option, and dragging
the background to the desired place.
Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2088304
* web_editor
This commit adds a slide counter in carousel snippets option menu, as
well as left and right buttons, this way the user can manage their
slides entirely from the options, instead of having to go to the block
itself to navigate to where they want before going back to the option
menu to add or remove a slide.
Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2088291
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Currently we have:
- a colorpicker for background color of snippets
- a colorpicker for foreground and background text (topbar)
- a colorpicker for menu/footer/navbar/etc
These 3 are separate colorpickers with different options.
After this Commit
All 3 will use the same color palette wich allow you to select
theme color, common colors, custom color and transparent filter.
Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2087383
* web_editor
Previously, the user could choose their anchor names using a modal
window, anchor names also have weird rules, this was not a great user
experience.
This commit makes the anchor button generate anchors automatically based
on the first title in a section, or the snippet name if there are none.
If the anchor name is already taken, it is suffixed by a number. After
it has been generated, it is also copied to the clipboard and the user
is shown a toast to tell them the anchor has been generated and copied.
The anchor is displayed in the toast along with an edit button that will
open the same edition modal as previously, but it is now less
restrictive.
Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2088270
This commit adds buttons to move sections up or down and to move columns
left or right, which is more user-friendly than drag-and-drop in some
cases.
Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2088265
* website
Now snippet options can be defined as a button which can be placed next
to the clone and delete buttons, through a new "isTopOption" method.
This commit also review the buttons and title design and take advantage
of the feature to review the way snippets options are added in their
container (that code indeed contained useless part since 13.0).
Part of https://github.com/odoo/odoo/pull/38959
task-2066614
* web_editor, website_blog, mass_mailing
In preparation of the new left panel UI, remove all snippet options UI
icons as we do not want them anymore to simplify the UI.
Part of https://github.com/odoo/odoo/pull/38959
task-2066614
Changing the filter color and its intensity was not working anymore
because of failed JS refactoring when the logic was shared for both
blog posts and events in website.
closesodoo/odoo#40227
X-original-commit: 3296468beded14d4ef52d221ef8683941f12291c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In 4d5c3b9fc1c5 the arguments of the MenuEntryDialog widget were
altered, and one instantiation of this widget was not adapted, resulting
in the last parameter being undefined and causing a crash. This commit
adapts that call.
closesodoo/odoo#40187
X-original-commit: ab7f501ff401cc1a85a95dd3cc65d80ecfeec2cc
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
View creation/edition represent a important part of an install and a lot
of possible view errors are not detected, like fields used in domain
filters. Some part of the code a difficult to maintain, and view checks
are splitted in multiple places.
This commit aims at refactoring view validation by regrouping most part
of the logic in ir_ui_view and trying to optimize the overall process.
Since most of the lines were touched, this task was also an opportunity
to modernize the API.
Main changes on method `check_xml`:
- extract node processign and validation to individual postprocessor
- add validation for filter node, buttons, ...
- fix accessibility checks (and improve their performance)
- move xpath check to specific Python node validator
- clarify error messages (wip to continue)
Main changes on method `read_combined`:
- optimize the search for inheriting views in a single query doing the
whole recursive search
Indeed, after removing xpath validations, `get_inheriting_views_arch`
was the most expensive method in `check_xml`, spending most of the time
in `search` because of recursive calls to retrieve children views.
The view Backend Assets is a good example of the latter point, since a
line is added in the view for almost every module. 70 views (community)
are added at first level, `get_inheriting_views_arch` is efficient and
returns all 70 views. Then at the second level, the method
`get_inheriting_views_arch` is called 70 times for nothing. 70 calls to
`search` (squared/2 since each view is checked independently) are almost
useless. The same case applies to the settings view.
As a result, the average module installation time is 25% faster, and the
average time spent in `read_combined` is almost divided by 2.
When the user changed the parallax option, it was only updated on save.
So, the user was not able to have a preview of what he chose.
Note: this commit is made in saas-12.3 but does not fully solve the
problem there... and unfortunately I don't know why. It fully solves
the problem in 13.0 though and this is more important.
closesodoo/odoo#39995
X-original-commit: 4b633949cd4fd1cae807b95d233879ac4adc01ce
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
- Create 2 companies A & B
- Create a website A
- Create a user U with access to company B only
- Connect as U and go to the website
An internal server error is raised.
This is due to 7bfcb53db37f385a99 which verifies if the user isn't
granted access to companies he is not supposed to access.
This is exactly what was done before this commit: the website is in a
company not allowed to the user.
opw-2116539
closesodoo/odoo#40004
X-original-commit: debc516c47b522bd9b4b9fef365ad11462916174
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When computing time statistics, we need to look for
archived website visitors also to avoid a KeyError
if we use the default 'Archived' filter.
closesodoo/odoo#39970
X-original-commit: fe4d9bd25de45f1748ea010c51c8871bb3d14b9a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Adapt website for 13.0 9996d04fd2 change of LinkDialog constructor
arguments (to get back to same arguments as in 12.0).
opw-2086444
closes#39888closesodoo/odoo#39910
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Purpose
=======
This is the first huge step to improve the test suite in several ways:
- Make them demo data independent, allowing to modify the demo data without having to adapt the tests depending on it. It also allows to have a beautiful + convenient demo dataset to make a demonstration, and to configure complex data in the tests to manage the corner cases.
- Improve the test performances by converting them into SavepointCase. Each test will be rollbacked to it's initial state, after the setUpClass call. That way the different data are not re-created at each test for nothing.
- Introduce several test classes in base/tests/common.py to launch a TransactionCase, HttpCase or SavepointCase test with an available demo user, portal user or a large set of partners.
- This is the first step to tend to a rolling release process, allowing to execute the tests (or a subset of the tests) on a migrated base, for example.
closesodoo/odoo#39868
Taskid: 2075739
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, when an user clicked on a control button to go to
another carousel slide, the overlay ended at the wrong position and
multiple scrollbars appeared. This occured because bootstrap fires the
'slid.bs.carousel' event too soon, because it emulates the transition
end event with a setTimeout. So on a normal computer, this occured:
- User click on control button, transition starts.
- slid.bs.carousel is fired -> we retarget the edition to the new active
slide and reposition the overlay... but that slide is still moving
as the transition is not really finished.
- The transition finishes, the overlay is at the wrong position, outside
of the screen.
Actually, this is more complex than than because our own system checks
transition end events to reposition the overlay. Even if unperfect,
we now have:
- User click on control button, transition starts.
- slide.bs.carousel is fired -> we enable the parent carousel instead of
the current slide (this DOM element is not moving).
- slid.bs.carousel is fired -> we know it is fired too soon, so we wait
an extra 20% of the time between 'slide' and 'slid' before retargeting
edition.
- The transition finishes, the overlay is still over the carousel and
not the active slide.
- Our extra 20% duration ends, we retarget edition to the current slide
and reposition the overlay (should not move since normally at the same
position as the carousel itself).
Part of https://github.com/odoo/odoo/pull/38997
task-2090180
Previously, the carousel and quotes carousel snippets were the only ones
that were not enclosed in section blocks. This had a number of
undesirable side effects, such as editing the anchor on the carousel
breaking the carousel functionality, and the inability to separately
choose a background for the carousel itself and individual slides.
I also used this opportunity to move controls relative to the entire
carousel onto the carousel itself rather than the individual slides. The
sizing_y (vertical padding) will however keep targeting individual
slides, as the carousel uses the height of its tallest slide, and also
because padding on the carousel will not get covered by slide
backgrounds and saty blank, which is unwanted.
Lastly, most of the snippet options for the carousel were rewritten, as
they were quite broken. There was some compatibility code for saas-3
left, some useless events were bound to the controls, even though they
were already handled through event-delegation at the document level.
Finally, most of the edition features were broken on duplicated
carousels since the onClone method wasn't reassigning most of the things
it needed to.
Part of https://github.com/odoo/odoo/pull/38997
task-2090180
In the editor, the snippets from uninstalled module are shown with the
possibility to install the module to get snippet.
Before this commit:
When clicking on it, it will redirect to the module page, in the backend from
where you can install the module.
Now:
A popup will be shown to save current changes and install the module.
The installation will be done without changing page, in the editor. Once done,
the page will reload in editor enabled mode.
task-2089285
closesodoo/odoo#39138
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When loading a page on an existing starting database, registry is not
fully loaded causing potential error when trying to access model
existing in database (views, menitem, ...) since model added in last
loaded module does not exist in registry.
Thus, executing browser js test may lead to errors when executed during
an update on a database with other modules installed.
HTTPCase should be executed post_install to ensure that registry is
fully loaded to avoid this problem.
Since HTTPCase are slower than other test, it is also a good idea to
execute them at the end, in order to prioritize fast fail.
With this commit, a warning is isued if such a test class is tagged to
run at install time.
While at it, remove deprecated at_install and post_install helpers and
remove the deprecated phantom_js alias.
closesodoo/odoo#39462
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Before this commit, if you had a page_id set on a menu, and that you
fork this page, the page_id from the menu was always pointing to the
previous one, so you see old page, but edit new page.
> Reproduce:
> Fork Contactus (Page_id on menu become wrong)
> Refresh contact us (done on save btw)
> You see old content
> Edit with Html Editor, you sill see that forked view exists!
Bug was hidden before that we set page_id on menu, but it is needed if
we want to support the groups visibility on the menu item.
closesodoo/odoo#39472
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Now, you can define a Visibility mode between:
Public (All poeple)
Connected (Portal or Employee)
Restricted Group (Has this group or is Employee)
With Password (Know password or is Employee)
Internal Users (Is Employee)
It is a 'fair' feature, but without really warranty that the content is
really unreadable via others methods, ...
It is more for frontend display, that real secret. Dont use this like
a keychain ;)
We only catch the visibility on the main view and not the t-call inside.
Even if it should work on controller too, it is only display now on the
page property menu. (Or on the view directly in backend)
task-2091365
From now, you need to explicitely add sitemap=True if you want your controller
into the sitemap.
It's the default value, but if you forgot it, it will raise a Warning on runbot.
It will avoid wrong controller in sitemap and duplicate (empty) content.
From now, if your model contains a field website_id, the modelConverter for
sitemap will automatically add the domain:
"[('website_id', 'in', (False, current_website_id))]"
It avoid redundant declaration and ugly url in redirect/rewrite view.
Migration: need to remove it from url_from in website.rewrite
task-2065018
closesodoo/odoo#39427
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
* web_editor
Commit https://github.com/odoo/odoo/commit/7e2b0ebe7996c9fa35f75949b7fc8cd5a58d7c36
broke the website JS loading as it added a dependency to a lazy loaded
JS module which was not even always lazy loaded.
A test so that this does not happens anymore will be made in another
commit.
Related to task-2092386
closesodoo/odoo#39391
X-original-commit: 5ac269d722f9ff8c206215dd1c07b8544cfd5382
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: website
Inherited colorpicker were not used due to the context missing the
website_id and the method call being used instead of call_kw.
task-2092386
closesodoo/odoo#39357
X-original-commit: 7e2b0ebe7996c9fa35f75949b7fc8cd5a58d7c36
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
`_` is not available when loading this part of the template, leading to
an error on `_.str.trim()`.
We can simply use `trim()` to do so. By the way, `google_analytics_key`
is now trimmed automatically when adding it in the settings, so this is
only useful for migrated databases.
Fixes#38891
opw-2089296
closesodoo/odoo#39269
X-original-commit: a492047e9a064beecbe0611c3f7aef5172406eb1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Since saas-12.3, deferred actions use native promises. This has the
annoying side-effect of force-deferring promises even if they are
resolved at once... and we relied on the opposite behavior for some
call made in _setActive or option methods.
In master, we should review the async logic of snippet options. Right
now we will rely on the fact those promises are resolved at once but
that we need to avoid for their "async part" anyway. The _setActive
method and the option methods are thus still working synchronously in
stable, despite the new force-deferring promises.
Also, with old promises, when we waited for the resolution of multiple
deferred, the resolve handler received the multiple results as
individual arguments. Now it receives all the results in an array as
a single argument. The resolution of action demands had to be adapted.
closesodoo/odoo#39171
X-original-commit: 30d15315a73c1fa34ada86371b06c02b6375db89
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
You need to provide a small part of the code, because to avoid fraud, google
make several request to be sure that you don't allow all codes :)
So the 'WPS' solution was dropped, now we take the first request from google
that match the part provided, as the good one, and refuse all others requests.
task-2086915
closesodoo/odoo#39186
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
The XML file homepage view record is not supposed to be deleted as it is used
to bootstrap newly created website.
If that view is deleted, everything's fine. But if that view's page is not
found (m2o link broken somehow), then the code would crash.
This would only appear if the user is playing in the backend in technical but
it seems to happen more than it should.
This commit will prevent the code to crash in such a case.
Step to reproduce:
1. Go to settings > technical > views (debug)
2. Find the xml homepage view (with xml_id)
3. Go to its website.page and break the m2o view_id
4. Try to create a new website, it will crash
opw-2081894
closesodoo/odoo#39149
X-original-commit: 1d4dd200c664b99dbdb3e65e3950be1cb5e79a0a
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Those tests were raising an assert error if the DB has other websites than the
data/demo ones.
As we have a new module in Odoo 13.0 (odoo/design-themes#178)
which is creating 25 websites, and since the design-themes runbot is now
running tests, we were having a red design-themes runbot.
closesodoo/odoo#39145
X-original-commit: 67df6b91ddb6cb83d558137691481f50834f7fca
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This test was raising an assert error if the DB has other websites than the
data/demo ones.
As we have a new module in Odoo 13.0 (https://github.com/odoo/design-themes/pull/178)
which is creating 25 websites, and since the design-themes runbot is now
running tests, we were having a red design-themes runbot.
closesodoo/odoo#39008
X-original-commit: 5c7b446363fbec7b2a76a579794e0fac20d05271
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>