* The compiled templates are cached per user, lang, inherit context values
* ir.ui.fields: attributes method return an dict, and record_to_html return only the content value of the field
* all rendered text use build_text and all attributes use build_attribute
* t-esc-options is removed and replace by format_value method
* AssetsBundle receive the list files and remains
When installing website or one of its dependencies directly, the website
attribute is not defined on request. If the installation triggers qweb
rendering [1], we need to correctly check the presence of the website
attribute, which this commit does.
[1]: This is the case in website_blog since
4a132e2afb
- Merge debug mode in dev mode.
- Allow to select dev feature ony by one
--dev=all will active all dev tool
--dev=
xml will read template in xml file and not in db
if not updated meanwhile
reload Add a watcher to reload the server if python code is modified
qweb Allow to add t-debug in template qweb
werkzeug Active the werkeug debugger console when an exception is raised
(i)p(u)db Allow to break before that the error is raised (old --debug mode)
To NEVER uses in production, since it give a console access in frontend.
request.website.get_languages returns a list of tuple in the form:
(`language code`, `language name`)
With this commit the code first check if there is a language exactly
matching, and only if failed check if there is a match on the short
form.
closes#11613
opw-672412
- add or fix decorators on methods
- fix most compute methods (wrong dependencies)
- revert changes in `eval_context` of `ir.actions`
- various code simplifications and improvements
- migrate methods that were not
- ir_qweb: modify `QWebContext` to take an environment instead of `cr`, `uid`, `context`
- ir_qweb: convert `AssetsBundle` to use new API `env`
- ir_ui_view: use decorator `multi` on method `read_combined`
- ir_ui_view: ensure that method `render` is never called with an xml_id
- ir_ui_view: factor out part of the `ormcache` key of method `_read_template`
customize_template_get which gets template inheritence informations was
not taken into account by website version, so at one time we could get
an erroneous view version instead of the wanted one.
This commit refactor some of the code adding a function to sort view and
find the most suitable one (based on website and version in request).
This function is then used in ir.ui.view `_view_obj`'s function to
select the correct view.
related to opw-667225
The alternate languages links set in the page `<head>`
were not translated in each language, but within the language
the user is browsing the website.
This leaded to SEO referencing issues, as these links leaded
to (30x) redirections if followed, to translate the URL slug
within the new current language.
e.g.
`/fr_FR/shop/product/bose-mini-bluetooth-speaker-7`
automatically redirected to
`/fr_FR/shop/product/mini-haut-parleur-bluetooth-bose-7`
And it was the first link which was displayed as alternate link
when being in another language than French, while it should
be the second (to avoid the useless redirection).
opw-669979
get_template should accept ids or xml ids. However the id or xml_id is given
to IrUiView.get_view_id that waits for an xml_id. get_template crashed if it
received an id.
This commit solves this by setting view_id to the given id, or resolve the xml_id
through get_view_id.
Checking url_list for duplicates is O(n).
Use url_set instead of url_list to improve to O(1).
Otherwise sitemap generation even for a million products will never finish.
Close#11106
To match the current website, we should compare the request http_host to the domain and not
to the website name. That was working luckily because name and domain in demo was the same.
close#10870
Users are tempted to enable all features they
see under the former "Speed" section of the
website settings, even if they have no idea
what they do.
One of them was `CDN Base URL` and had a default
value that was wrong and very likely to break
your website if enabled by mistake.
This commit replaces the default value with
a placeholder that looks more like a `sample`
URL, and makes the fields required when the
CDN option is enabled.
It also moves the whole "Speed" options to
technical features / debug mode.
When rerouting from a lang path token to the given route (eg:
/en_US/route_path to /route_path) it is better to keep request variable
clean.
opw-668563