Commit Graph
26 Commits
Author SHA1 Message Date
Christophe Simonis e918271f76 [MERGE] forward port branch saas-16 up to 8fdac4b6b2 2017-10-27 14:09:20 +02:00
Christophe Simonis 4873aeb501 [MERGE] forward port branch saas-15 up to 991ba1d861 2017-10-26 20:07:36 +02:00
xmo-odoo f13cab6aa6 [FIX] website_mail_channel: unsubscription
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
2017-10-25 15:31:58 +02:00
Christophe Simonis 6c2ab192ea [MERGE] forward port branch saas-16 up to 88a9980b0c 2017-10-10 16:49:59 +02:00
Christophe Simonis 446ff1baf8 [MERGE] forward port branch saas-15 up to b60a41ce14 2017-10-09 17:54:36 +02:00
xmo-odoo 27280fefa9 [IMP] website_mail_channel: unsubscribing unsubscribed address
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.
2017-10-03 11:19:18 +02:00
Jeremy Kersten 1b52b00d2a [IMP] website*: clean sitemap + add method to declare sitemap function.
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
2017-09-27 21:33:49 +02:00
Thibault Delavallée 014b5c9f7c [MOV] website, http_routing: move (un)slug support to http_routing
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.
2017-08-08 14:23:58 +02:00
Olivier Dony 5afe894f44 [MERGE] Forward-port saas-15 up to 878fbc75ff 2017-05-16 17:09:45 +02:00
Olivier Dony 21482ac263 [FIX] website_mail_channel: filter correct channel type
The public mail channel controllers should only deal with
their own channel types.
2017-05-05 17:02:46 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Christophe Simonis 3bb022d57c [MERGE] forward port branch saas-12 up to 6f8e40c 2016-10-27 18:17:59 +02:00
Nicolas Martinelli 135a5daeb8 [FIX] website_mail_channel: message count
The message count on a mailing list looks incorrect since notifications
are counted but not displayed.

opw-691948
2016-10-25 10:31:59 +02:00
Jérome Maes 8a399930f3 [REF] website_*: remove render method on website
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.
2016-08-04 12:02:14 +02:00
Christophe Simonis 5858dda75f [MERGE] forward port branch saas-11 up to a62b8cf 2016-07-15 16:34:41 +02:00
Olivier Dony 6d3cf9c649 [FIX] website_mail_channel: re-add import dropped by API migration
The migration to new API dropped `from openerp import tools`,
but it was still used.

See also 8250762fe8
2016-07-14 17:07:44 +02:00
Olivier Dony a78c2e3d39 [FIX] website_mail_channel: fix datetime typo in new API migration
The migration to new API changed `import datetime` to
`from datetime import datetime`, subtly breaking existing
calls.

See also 8250762fe8
2016-07-14 16:52:40 +02:00
Martin Trigaux 2407f793a6 [FIX] website_mail_channel: public user (un)registration
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.
2016-07-05 17:24:36 +02:00
Martin Trigaux 26be95592c [IMP] website_mail_channel: better naming of variable
subscribe == True meant to unsubscribe the user...
2016-07-05 17:24:35 +02:00
Keyur Gajjar 8250762fe8 [MIG] website_mail_channel: code migration to new api.
No functional changes, only rewrite the code with
the api.v8 which more pythonic and smooth.
2016-04-13 11:21:06 +02:00
Xavier Morel bc4d10f48d [IMP] groupby domains & unformated dates
* 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...
2016-03-29 10:34:25 +02:00
Raphael Collet 4ddc323139 [FIX] base: fix and complete migration of base/ir
- 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`
2016-03-21 13:46:44 +01:00
Martin Trigaux 6869566fc5 [FIX] website_mail_channel: do not display subscription notifications
Messages about join and leaving channel are displayed in /groups/
2015-12-08 11:39:53 +01:00
Jérome Maes c116a3562a [FIX] website_mail_channel : channel use member and not follower
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.
2015-09-23 14:35:43 +02:00
Thibault Delavallée 2c36354ca9 [RENAME] mail, website_mail, website_mail_group, various: mail.group
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.
2015-07-09 11:12:50 +02:00
Thibault Delavallée a316295e36 [RENAME][MOV] mail, website_mail, website_mail_group: mail.group files
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).
2015-07-09 10:13:41 +02:00