Before this patch, if some view had both `inherit_id` and `website_id`,
its inheritances were being applied even in different websites.
After this patch, if a view inherits from another, inheritances will only apply
when both views belong to the same (or none) website.
Refactoring based on the pr #17635
This closesodoo/odoo#17635
If the website default language is not en_US, qweb fields are not
translatable in en_US (and thus can't be translated) because:
- the code expected en_US to be the default language.
- there was a error in website _dispatch
opw-746776
closes#17939
Steps to reproduce the bug:
-Change the default lang on the website to be different than en_US
-Edit the name of a product in the website
Bug:
The name of the product is changed in en_US and not in the language
set on the website. The lang is in fact removed from the context in
function saveElement(in addons/web_editor/static/rte.js).
opw:747084
This reverts commit 174d7e8e49.
The default language is the language if no lang corresponding to
the current language is found. Thus the browser language if available in
languages has priority over the default language.
opw-746776
closes#17637
Attempting to read the field `website_price` directly
with the XMLRPC API failed because, in such a case,
the request is unbound, and attempting to read
anything from it (`request.session` whatever)
resulted to the raise of an exception.
e.g.
This prevented to perform a `search_read`
with all fields on the `product.product` model
Closes#14939
opw-745733
- Set a google analytic key with the admin user (in the settings for
module website admin)
- Give the right to demo user for website as 'Editor and designer'
- Give the right to demo user for administration as 'settings'
- Login as demo user
- Modify the google analytic key in the settings.
Security restrictions error on (Document type: ir.values, Operation: unlink)
This is a complement of commit 6c89b2bdd2
opw-727807
This reverts commit 2d10c5eb43.
The fix was only needed up to saas-14. In saas-15 and over there is
another fix which adds the `uid` parameter back: 65ac6b8ae
When forcing another language that the current one (the cookie one) in an
url, the requested lang wasn't set correctly in redirect url, but the
cookie was, resulting in multiple redirect which ends with initial lang.
A side effect of this error was the inability to edit website page when
default lang is not en_US and user not in default lang.
The request context must be reset before being used by
`request.redirect` (in `url_for` method).
The current user was used to generate the sitemap. So if a user with
more permissions than `public user` goes on the sitemap, he could
generate it (if he is the first to see it or the last generation was
more than 12 hours ago (by default)) and have pages unavailables for
a user with lower permission in the sitemap (until the sitemap is
generated again).
The issue was solved in 8.0 with d08facdcb but was introduced back in
10.0 with fd09ddb6f because the `uid` argument was dropped from
`generate` method on `ModelConverter`.
Ths fix add the `uid` parameter back.
opw-708456
The current user was used to generate the sitemap. So if a user with
more permissions than `public user` goes on the sitemap, he could
generate it (if he is the first to see it or the last generation was
more than 12 hours ago (by default)) and have pages unavailables for
a user with lower permission in the sitemap (until the sitemap is
generated again).
The issue was solved in 8.0 with d08facdcb but was introduced back in
10.0 with fd09ddb6f because the `uid` argument was dropped from
`generate` method on `ModelConverter`.
From 10.0 up to saas-14 the fix introduced is to use a `use_public_user`
key in `request.context` but in master we will keep the fd09ddb6f fix
by adding uid to the `generate` method.
opw-708456
note: to forward-port only up to saas-14
This commit merge the two website menu items in order to ease user flow
inside Odoo. When clicking on the Website item a server action is called
that decides to redirect the user either to the dashboard if the user is
an admin or a website publisher, either to the website for other people.
Overriding this method allows to define a specific behavior. Future commit
will also redirect sales people to the website dashboard.
Dashboard itself is customized to add a header used to display a website
button. It will be used in future commits to add other new stuff to the
dashboard.
When a new page is created, we want to allow the definition of the xml_id
as 'website.XXX' in order to have clean url in the frontend and not always
take the same module name than the template module name. Since the page
with url 'page/website.XXX' are parsed by the website controller to be
displayed as 'page/XXX'.
e.g. in studio we create page on the fly and don't want url as:
'www.odoo.com/page/website_studio.XXX'
Commit a2ae219d4e fixed the customize_template_get
function(s) which had been modified for the 10.0 web_studio release.
While the fix also reorganized the structure to make it more efficient
and understandable, it promised that the function would be refactored
in master. This is what this commit does.
The customize_template_get route of the website module was also removed
with commit 5a030db3eb as it was an useless
duplicate of the web_editor customize_template_get route.
The old route handled two totally different features of odoo: getting
all the page-related views to allow their edition with the HTML editor
and getting the "toggable views" which appear in the "Customize"
website menu. The parameter "full" allowed to determine which one the
route was supposed to do and was useless until website was installed to
add its feature (by extending the route behavior). In both cases, views
informations are returned, only the number of views differs. The
above-mentionned fix already did part of the refactoring by returning
the same info structure for each view in both cases.
Now, the function has been split. The web_editor customize_template_get
route is renamed as get_assets_editor_resources and returns the info the
HTML editor needs to work (the "assets" term is in prevision of the
new LESS editor).
A new website route "get_switchable_related_views" has been created to
return the info the "Customize" website menu needs.
Both use the renamed ir.ui.view function "get_related_views" (old
ir.ui.view customize_template_get function) which now returns a
recordset and not a list of dictionnaries.
Specification
=============
- no boxes around fields
- use regular form style for input fields
- don't split page/URL into two fields, just do one URL field, with autocomplete
- Add alpha, beta, gamma, delta and epsilon color in color selection because they are used in mass mailing and themes also.
- Add a selection option with label "L" inside circle for link.
- Add Color selector for choosing button color
- Remov select2 page selector and used jquery autocomplete on same input
- Fix issue of page search in ir.http
The GeoIP resolver keeps a permanent open file descriptor on the
GeoIP database file, for example /usr/share/GeoIP/GeoIPCity.dat
Because we initialize a resolver for each registry, servers with
many databases may easily blow up the open file descriptor limit
of multi-threaded workers (gevent or no workers multithread mode).
The Maxmind GeoIP API appears to be thread-safe since v1.1.4, so
it is much less wasteful to use a shared resolver for each process.
This patch keeps the _geoip_resolver class attribute on `ir.http`
for compatibility, but it will be removed for the next version.
The forward-port of the above revision missed
the conversion to the new api and that
`context` had to be replaced by `self.env.context`
Fixes#14922Closes#14923
The revision
8f48baeda6
broke the ability to search pages in the dialog
allowing to add a menu to the website from the website
(From the website, Content > Edit menu)
as `request.website` was not defined in this case
opw-702020