On res.config.settings for website, when removing a language from language_ids, if this language is defined as default_lang_id, the default language will be updated by an onchange to prevent any inconsistency.
The same should happen when doing this directly on the form view of a website record.
closesodoo/odoo#27727
Since Odoo saas-11.3, copying a record with it's inherited record in the copy
dict values will trigger translation of the inherited record's fields which it
shouldn't.
This issue will be fixed with #27108
In the meantime, we can avoid this issue by not copying the view separately
from the page as this code is a residue from the old implementation (no
inheritS between `website.page` and `ir.ui.view` + they both had `name` field)
and is not usefull anymore.
An ir.attachment record can be served as a request's reponse if:
- a request triggers a 404
- the ir.attachment record has its url field matching the url of
the failed and is of binary type
Following rev[1], portal users have the right to create these kind of
records, and it is a security concern.
This patch restrict the ability to create and write on the ir.attachment
records that may be served through the dispatch's exception mechanism to
settings users.
As the asset bundles files are served through the use of these special
ir.attachment, we make sure to retrieve only ir.attachment records
created by the superuser in the `get_attachment` method.
As website administrators often need to play with these special
ir.attachment, we also let to this group the permission to manage them.
[1] 61065b6d04
Refactoring of qweb to call _post_processing_att for each nodes. This
change remove the crappy ovewrite in website module. The website overwrite
only the _post_processing_att to add the cdn parameters.
The static node (without t- attributes) can stay static (remove overwrite
of _is_static_node), the cdn is applied at the compile time for this
nodes instead of at the running time like the dynamic node.
res_config_settings.website_id should be ondelete='cascade', however
that is not suitable for stable, so we emulate the ondelete cascade
with an SQL query during ir.model unlink (website uninstallation).
Fixes#25078
Before this commit:
1. If a menu was used as a container (dropdown) and had an unpublished page_id
(website.page), we would never show that menu (and so its submenus) even if
it has visible submenu.
Some users are stuck with this since they:
a) create a new page 'A' (unpublished by default) included in menu.
b) create a new page 'B' (unpublished by default) included in menu.
c) set 'B' as a submenu of 'A' in the menu manager
d) decide to publish the website.page linked to menu 'B'
Then, since menu 'A' is linked to an unpublished page, the menu 'A' and 'B'
are never visible.
2. If a menu is being created with an URL that match a website.page URL, the
m2o relation will automatically be set (website.menu.page_id).
Still, if the user type the URL without the leading slash, the m2o won't be
set.
This could be misleading since on the page property in the page manager the
URL is being shown without the leading slash even if it is stored in DB.
Now:
1. We always show menu container if they contains visible submenu, even if the
container menu is linked to an unpublished page
2. The page URL search is more clever and will match URL even if the only
difference is the leading slash.
This closes#24635
web (tagged with `openerp-web`) translations are loaded in the backend, in
`odoo.addons.web.controllers.main.WebClient.translation(mods=None, lang=None)`
method (through `/web/webclient/translations` controller).
In website, the controller `/website/translations` is called used, fetching
the translations from modules with the (fragile) clause `name ilike 'website'`
This commit fixes two bugs:
1. Install `website_sale`, activate discussion on products
-> the chatter is not translated as the portal translations not loaded in the
`/website/translations` controller
2. Install `helpdesk` but not `website`, go to portal view of a ticket
-> the heldesk chatter is not translated as the `/website/translations`
controller is not called (only provided by the website module)
This patch implements a modular approach to translate the web resources of the
right modules only.
The controller /website/translation is moved to http_routing and each module
override the new _get_translation_frontend_modules_domain method to adds its
translatable module
Closes#23618Fixes#23610
Before this commit if /foo redirect to /bar?a=1
/foo?debug=1 was redirectd to /bar?a=1
After this commit,
/foo?debug=1 is redirected to /bar?a=1&debug=1
Website Versioning module (website_version) is applied when displaying
views by interfering when doing the "render the view of this `key`" and
showing the view with the same `key` but of the currently displayed
version.
The website.page model when directly rendering a page would directly
specify its `id`, thus website version was bypassed and just the master
page was displayed.
With this commit website.page has a "get_view_identifier" that can be
overrided in website_version and has the same previous behavior
otherwise.
This changeset also solves a conflict (`website().get_current_website`
also modify `request.context`) when modifying the context which also
disabled versions.
opw-1824957
closes#23847
Currently some base context used for evaluation is computed when rendering
QWeb templates. Evaluation context is build in base and improved notably
in website module.
This commit adds an option to skip this context build and have a minimal
evaluation context based on given values. Purpose is to avoid having to
search and browse unnecessary content when evaluating some custom templates.
When we know precisely what we need when rendering a template there is no
need to add unnecessary items in the evaluation context.
This commit is related to task ID 1817951. Closes#23291 .
Purpose of this commit is to standardize portal user behavior and creation.
As all portal required features (user, group, support) have moved to
base let us move the template user used to create portal users to base.
'Portal User Template' is therefore moved from auth_signup to base module.
Various config parameters are updated due to the change in xml id.
This commit is related to task ID 31399 .
Before this commit:
When editing a page URL through page properties it would redirect to that new
url afterward. If the url was not starting with '/' and had multiple level
before and after edition (eg: page/action to page/realaction) it would then
redirect to a wrong relative URL.
Now, we ensure that we redirect to the correct URL: the one slugified and
cleaned in the backend.
Step to reproduce:
- Create a page '/page/action'
- Go to that page and open Page Properties
- Edit the URL to 'page/someaction'
- You will be redirected to the incorrect relative URL /page/page/someaction
Before this commit, model that create ir_ui_view via _inheritS was ignored in --dev xml
The arch_fs was not set. Because it was not ir.ui.view, and because xml_id was suffixed by _ir_ui_view.
Now we manage the case of inherits. So if model model.name inherits ir_ui_view
class MyClass(models.Model):
_name = 'model.name'
_inherits = {'ir.ui.view': 'view_id'}
view_id = fields.Many2one('ir.ui.view', string='View', required=True, ondelete="cascade")
...
<record name='model.name' xmlid='pok'>
<field name='arch' type='xml'>content</field>
</record>
will be read from xml in dev mode.
parsing the xml file for xml_id pok_ir_ui_view and pok.
The orm by default will add this suffix.
The 'dynamic' view created when we update the groups is a special case, which we don't want the arch_fs
for dev mode because the xml only contains by default and an empty container and btw the imd was wrong
since we had the res.group model a xml_id into the _inverse_arch.
The page create via a template (method new_page) will automatically remove the arch_fs since we don't
want to see the empty container if we are in dev_mode.
Before this commit, it was possible to create redirect with empty values.
Now, for new db, that will be required.
Fix usability according to first feedback
- Redirect / menu should be visible without debug mode
because user need it when they start their website and
dont know at the beginning how to enable it (fgi)
- fa icon in page manager was for blind people
- missing widget on sequence field