Code from delete_page has been spliited (functions, templates, ...)
to be re-usable by rename_page
Change default input type from website.prompt.
Old default value 'text' had no sense, there are no tag <text>.
The implementation of ormcache does not work on methods that take a context
parameter. Because of the decorator decorator, the arguments of the call are
passed positionally to the method ormcache.lookup, and positional arguments
are used in the cache key.
The fix consists in removing the context parameter from the faulty methods,
either directly, or by caching a private method called by the public method.
Commit 540b753bf8 introduced
support for resources stored as ir.attachment records in
asset bundles too.
This is specifically useful for customizations.
However the HTTP route for reaching those resources
when they are *not* in a bundle was originally created
in the `website` module (as a special handling for
404 requests)
This means that these dynamic resources would only
be partially supported when `website` is not installed,
causing various problems:
- missing resources in debug mode where bundles are skipped
- errors when trying to define new client-side Qweb templates
via XML resources - which are loaded with a direct request
- ...
This commit moves back the supporting code to the web module.
The `mimetype` column is not present in ir.attachment without
the `website` module, but sniffing it based on the attachment
name works fine at serving time too.
Closes#6002
The implementation of `ormcache` does not work on methods that take a `context`
parameter. Because of the decorator `decorator`, the arguments of the call are
passed positionally to the method `ormcache.lookup`, and positional arguments
are used in the cache key.
The fix consists in removing the `context` parameter from the faulty methods,
either directly, or by caching a private method called by the public method.
- Translations lookup normally uses the namespace of the current
QWeb template, after merging all inherited views.
But when a QWeb template is "cloned" by a child view using
inheritance with `primary` mode, the translations are more
likely to exist for the original (parent) template, and would not
be found when using only the "child" namespace.
This patch adds support for looking up each translation
also in the parent namespace in this case, if none was found
for the child template in the first place.
- ir.translation's _get_source() now supports a list of res_id
to search for, in addition to a single res_id
- Also moved the logic of routes /website/customize_template_get
and /website/get_view_translations to the ir.ui.view model where
it belongs.
opw: 615241
Closes#5325
Without this fix, you cannot use html_editor to edit page create
with the front end.
Since we don't store the new page in field `xml_id´ but in field `key´,
we need to search also into this field.
Clear cache after delete view
Move menu to keep all 'New page', 'New blog', 'New forum', ... together
Disable continue button from popup while user don't confirm with checkbox
English typo
and website_url fields. This will allow to remove custom code in every website
addons that redefine those two fields and the URL getter method.
The published button in backend has also been cleaned. It is now a link button
that redirects to the website_url. It does not change the publish status
anymore. Indeed it makes sense publish and unpublish website documents
directly in the website, while checking that everything is correct, instead
of doing it in the backend.
Next commits will update the Odoo addons to use this mixin and the new button
in the form view.
When url_for was looking for a route which match, it was only looking for GET route.
So routes which were restricted to be used only with a POST method, were never found.
The result was that urls in website for route post (form in most cases) was never prefixed with the lang.
So the request.lang was always the default lang from website...
If you was creating a sale order (in ecommerce), the lang used in sale order was wrong and the description not in the current lang.
on links in forum posts.
This is now done when creating / updating posts instead of updating the display
of the post. This means that old posts may contain nofollow attribute altough
the user has sufficient karma; however it is acceptable compared to the computation
we save by avoiding processing every post to display.
The website name is by default "localhost" (used in the page title in the format
"Current Page | Website Name") but there were no way to change it.
Fixes#3493
website introduces two new stored function fields, which depend on the attachment data
The thing is, these two fields are pertinent for website attachments only
Therefore, we avoid to read the datas field when the attachment is not a website attachment(when not needed), as this is the most costly field to read
way links displayed in posts and answers. A nofollow attribute is
added is the author has not enough karma, adding a protection for
spammer tryign to improve their SEO.
The old-api model._all_columns contains information about model._columns and
inherited columns. This dictionary is missing new-api computed non-stored
fields, and the new field objects provide a more readable api...
This commit contains the following changes:
- adapt several methods of BaseModel to use fields instead of columns and
_all_columns
- copy all semantic-free attributes of related fields from their source
- add attribute 'group_operator' on integer and float fields
- base, base_action_rule, crm, edi, hr, mail, mass_mailing, pad,
payment_acquirer, share, website, website_crm, website_mail: simply use
_fields instead of _all_columns
- base, decimal_precision, website: adapt qweb rendering methods to use fields
instead of columns
Commit 57ad514b makes the function preserve the aspect ration of the
original picture. Error of mine because the expected behavior was to
lose it for kanban view purpose.
For backward compatibility sake, this commit will keep the old behavior
by default.