Fixes 27280fefa9:
* `partner_id` is an `int` not a recordset
* qweb Response is lazy (the template is only looked up and rendered
when we actually need to send the content over the wire) => the error
would occur outside of the try..except block. Force rendering
(`Response.flatten`) so we can handle the issue here
* Uses the HttpCase interface to contact the server over a new socket
(same as tours & al) because using `werkzeug.test.Client` would not
use the correct cursor (?) and so the test data would not be visible
Before this fix, if a (non-registered) user tried to unsubscribe an
address *not registered*, they'd get an unsub link, click on it, and
get a "Invalid or expired confirmation link." message, usually
wondering what the bloody hell happened.
Provide a clearer message in that case.
Don't add useless routes or route that will return 404.
Improve generate function from ModelConverter to have a better management of
query_string.
Now we have an helper sitemap_qs2dom that will analyse the current route and
check if query string is plausible and if yes, generate a domain, when the
query_string don't seems to match the route, we return a Falsy domain.
Before this commit, if qs was /product/ipad, enumerate_page check for each
modelconverter of the route a name ilike '/product/ipad'.
Now we check all routes that contains product and one converter that match ipad
or routes that contains ipad and one converter that match product.
This commit a new way to declare the sitemap for a route.
def sitemap_xx(env, rule, query_string):
yield {'loc': '/my_url'}
@http.route(..., sitemap=sitemap_xx)
In this case, only the loc returned by this function will be in the sitemap
for all rules.
You can pass sitempa=False, if you don't want that route are into the sitemap
Slug and unslug API is now available in http_routing. Indeed there is no
link to any website or any reason to not support slufigied URLs when
website is not installed. A new unslug_url method is added as a tool
coming from an embedded method from website. Doing it allows to have all
slug related methods defined at the same point.
Support of slug and unslug in qweb rendering is also moved directly in
http_routing version of ir_ui_view instead of website inheritance. This
is done in order to keep things coherent.
Some code from website about ModelConverter is also moved. Indeed both
versions of ir_http uses some kind of placeholder to store the uid
when converting urls to python. This commit unifies it by using the
website one directly in base to simplify the override.
This commit also updates all module importing slug. Enterprise modules
will have to be updated, see related commit.
Since saas-3, website controllers use `request.website.render`
to render the template of a web page. This was kept for retro
compatibility. It's time to stop using deprecated stuff.
Same for `_render` method on website.
'json' route don't use `request.render` since
`JsonRequest` has no `render` method.
Allows public users to unsubscribe to a mailing list.
Before this patch, a user had to be connected with an account with subscribing.
For public users, a confirmation email is sent to subscribe and unsubscribe to
a list.
Use hmac signatures to prevent fake (un)subscriptions.
* ensure groupby domains are normalised, that's significantly more
convenient for subsequent manipulations and combinations (e.g. OR-ing
domains of multiple groups)
* split off "raw" groupby which provides ISO-8601 date and datetime
ranges[0] (half-open) as values for grouped date/datetime fields
for instance when grouping weekwise on a date field, the group
including May 11th, 1930 would have the following value for
the (grouped) date field: `("1930-05-05/1930-05-12", "W19 1930")`[1]
this means callers can access the programmatic date range value
* fix website_mail_channel and website_blog to *not* go and randomly dig
into the domains assuming a bunch of unspecified stuff about its
formatting (such as it not being normalized)
[0] https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
[1] actual week number turns out to be locale-dependent...
- 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`
Since mail.channel user member instead of follower, the frontend widgets required some changes. This commit kind of duplicate follower controller from website_mail for channel member usage. These are now 2 separates widgets. Performance can be improve by removing rpc call when rendering widget, but since this commit is a fix, it does not touch this.
model has been renamed to mail.channel to prepare the slack modeling.
In future commits the mail.group model will be merged with the channel
model from im_chat. The first move is to rename mail.group into
mail.channel to have a model that will unite both features.
renamed to mail.channel.
At this point no model has been renamed; only files have been moved.
n mail, mail_group files have been renamed to mail_channel. The
website_mail_group addon has been renamed to website_mail_channel.
Some internal references have been updated (templates, linked files).