Commit Graph
289 Commits
Author SHA1 Message Date
Martin Trigaux 553954fa82 [ADD] mail: parameter on send_mail method
To avoid to use the context to pass additional arguments just to specify
recipients or other mail.message field values.
2016-07-05 17:24:34 +02:00
Christophe Simonis 93e6316029 [MERGE] forward port of branch saas-11 up to 7153077 2016-06-28 18:05:25 +02:00
Christophe Simonis 5166fbd21b [MERGE] forward port of branch saas-10 up to 6d51bce 2016-06-28 15:12:06 +02:00
Raphael Collet 8be3781501 [REM] ir_actions: remove no-longer-supported field auto_refresh from act_window 2016-06-21 17:56:56 +02:00
Olivier Dony 949c9ffc3a [IMP] mail: remove useless menu cache invalidation
Rev. 15174e9a70 explicitly
cached ir.ui.menu entries, and required an explicit
cache invalidation when users changed their mail.group
subscriptions (mail.group used to override the ir.ui.menu
search(), cfr e.g. 89e404301b)

The menu search() override is gone as of 9.0, so it's time we get
rid of the unnecessary cache invalidation.
2016-06-21 14:34:39 +02:00
Raphael Collet 19561727a7 [MIG] models: convert class BaseModel to the new API 2016-06-16 16:50:47 +02:00
Christophe Simonis 9fe4cf5f72 [MERGE] forward port of branch saas-11 up to dda0d3d
# Conflicts:
#	addons/product_uos/i18n/lo.po
#	addons/sales_team/models/__init__.py
#	addons/website_payment/views/website_payment_templates.xml
#	addons/website_portal_sale/views/templates.xml
#	openerp/addons/base/ir/ir_qweb.py
2016-06-15 13:10:45 +02:00
Christophe Simonis dda0d3d62d [MERGE] forward port of branch saas-10 up to baf494c
# Conflicts:
#	addons/hr_timesheet/project_timesheet.py
#	addons/sale_layout/i18n/es_PE.po
#	addons/sale_layout/i18n/hu.po
#	addons/sale_layout/i18n/lo.po
#	addons/sale_layout/i18n/pl.po
#	addons/sale_service/i18n/es_MX.po
#	addons/sale_service/i18n/es_PE.po
#	addons/sale_service/i18n/lo.po
#	addons/stock/stock.py
#	addons/stock/stock_view.xml
#	addons/warning/i18n/es_PE.po
#	addons/warning/i18n/lo.po
#	addons/warning/i18n/ru.po
#	addons/web/i18n/cs.po
#	addons/web/i18n/ja.po
#	addons/web/i18n/lo.po
#	addons/web/i18n/th.po
2016-06-15 12:59:39 +02:00
Christophe Simonis baf494c67b [MERGE] forward port of branch saas-9 up to 1d81bb0
# Conflicts:
#	addons/account_extra_reports/i18n/ca.po
#	addons/account_extra_reports/i18n/fi.po
#	addons/account_extra_reports/i18n/pl.po
#	addons/account_extra_reports/i18n/te.po
#	addons/account_extra_reports/i18n/zh_CN.po
#	addons/account_full_reconcile/i18n/hu.po
#	addons/account_full_reconcile/i18n/pl.po
#	addons/crm/crm_lead_menu.xml
#	addons/crm_claim/i18n/es_PE.po
#	addons/crm_claim/i18n/hu.po
#	addons/crm_claim/i18n/ja.po
#	addons/crm_claim/i18n/pl.po
#	addons/delivery/views/delivery_view.xml
#	addons/product/product_view.xml
#	addons/project_timesheet/i18n/es_PE.po
#	addons/stock/stock_view.xml
2016-06-15 12:40:59 +02:00
Christophe Simonis f9072c789d [MERGE] forward port of branch 9.0 up to bfbe2d6
# Conflicts:
#	addons/marketing/i18n/es_PE.po
#	addons/marketing/i18n/hu.po
2016-06-14 19:27:16 +02:00
Goffin Simon 133490b4d0 [FIX] mail: forum reply shows as 'False'
When posting a comment after an answer in the forum, a mail
was sent to each subscriber with 'Re: False' as title.

In fact the title has to be 'Re:' + the name of the parent
record of this message.

When a mail is sent from the post, a link to access the subject
of the forum must be included in the mail.

opw:679073
2016-06-14 17:40:44 +02:00
Goffin Simon ca8a38d201 [FIX] mail: forum reply shows as 'False'
When posting a comment after an answer in the forum, a mail
was sent to each subscriber with 'Re: False' as title.

In fact the title has to be 'Re:' + the name of the parent
record of this message.

When a mail is sent from the post, a link to access the subject
of the forum must be included in the mail.

opw:679073
2016-06-14 14:44:58 +02:00
Jeremy Kersten 6f223edf4f [FIX] mail: display date and datetime in tracking value with the right timzeone.
When tracking value is converted to be rendered as a message_post, we convert
the date/datetime with the current local from momentjs.

Related to #12327

Courtesy of @aab-odoo for help and review.
2016-06-09 10:45:35 +02:00
Denis Ledoux 3ddb446b3b [FIX] crm, mail: Convert to opportunity in mail notification
The button "Convert to opportunity" in the mail notifications
sent when posting a message on an opportunity just coudln't
work as it attempted to call the `convert_opportunity`
method without one of its required method parameter.

opw-680017
2016-06-08 17:15:15 +02:00
Jeremy Kersten 4a4c4e1b95 [FIX] mail: display date and datetime in tracking value with the right timzeone.
When tracking value is converted to be rendered as a message_post, we convert
the date/datetime with the current local from momentjs.

Related to #12327

Courtesy of @aab-odoo for help and review.
2016-06-08 15:43:52 +02:00
Jeremy Kersten 039e182fe3 [REF] mail: avoid duplicated code for old and new value. 2016-06-08 15:43:52 +02:00
Christophe Simonis ac5023060c [MERGE] forward port of branch saas-10 up to 2f948c7 2016-06-08 12:19:23 +02:00
Christophe Simonis e54fb3eb22 [MERGE] forward port of branch saas-9 up to 30864b6 2016-06-03 12:33:58 +02:00
Christophe Simonis a36f6dbc29 [MERGE] forward port of branch 9.0 up to 928bc26 2016-06-02 15:12:47 +02:00
Nicolas Lempereur bc34fe481d [FIX] mail: don't reset subscriptions before adding one
When posting on a thread the user can be auto-subscribed to its default
types. But if the user has previously been subscribed to other subtypes,
those are lost.

With this commit, user mentionned (@{username} in message) or added as
follower for default subtypes are not subscribed if they were already
followers of the record.

So if default subtype is "Comment" and user was only following subtype
"Alarma!" (by checking it and then un-checking "Comment"), then if the
user comment:

-> before this commit, the user would then follow subtype "Comment" and
   not follow anymore "Alarma!"

-> after this commit, the user would follow the subtype "Alarma!"

closes #12008
opw-669127
opw-673766
2016-05-27 12:00:47 +02:00
Christophe Simonis e641d740d7 [MERGE] forward port of branch saas-10 up to fac4cc7 2016-05-24 14:08:42 +02:00
Martin Trigaux 17e144f51b [FIX] mail,website_forum: set SELF_WRITABLE_FIELDS on model's class
Otherwise it is not visible when set on an instance of the new API.
self is a recordset instead of the model `res.users`

Without this patch a low priviledge user was not able to modify its own value
of `notify_email` through the preference window.
2016-05-23 15:36:12 +02:00
Martin Geubelle 91acf0ab51 [FIX] mail: typo
This `,` at the end creates a tuple and `if (False,)` will be evaluated to True.
This leads to invalid `Notification Email`.

Hum..
2016-05-19 15:35:34 +02:00
Christophe Simonis 0fbc92e0c4 [MERGE] forward port of branch saas-10 up to 1e86774 2016-05-04 17:09:51 +02:00
Christophe Simonis 1e86774207 [MERGE] forward port of branch saas-9 up to 89873cb 2016-05-04 15:42:26 +02:00
Aaron Bohy 03a764891c [ADD] mail: command /who
available in channels and chats, but not livechats as the public user isn't
really "in" the channel (the command would reply that you are alone in the
channel, which isn't necessarily the case)
2016-05-03 10:34:41 +02:00
Aaron Bohy 9865d3c0b7 [ADD] mail: command /leave
Required some changes for the client_action to correctly remove the left
channel from its sidebar, and switch to Inbox.
2016-05-03 10:34:41 +02:00
Aaron Bohy de6fa69774 [ADD] mail: commands support
Use the mention mechanism to autocomplete on commands (keyword /).

A first command /help has been implemented.
2016-05-03 10:34:41 +02:00
Aaron Bohy 2264378739 [ADD] im_livechat,mail: canned responses support
Use the mention mechanism of the composer to autocomplete on canned responses
(keyword :) with fuzzy search.

Directly perform the string replacement in the composer, instead of
server-side as before.

Add a menu item to access an editable list view to create and edit canned
responses.

Add two canned responses as demo data.
2016-05-03 10:34:41 +02:00
Olivier Dony 7c177d9143 [FIX] mail queue: wrong condition for test mode
Rev. 56cec604e6 modifies
the auto-commit behavior of the mail queue scheduler,
to allow using it within tests.

The condition was wrong and always True as soon as
the registry was loaded, permanently disabling
auto-commit, both during tests and outside tests.

This broke the duplicate emails protection.
2016-04-29 11:39:29 +02:00
Christophe Simonis 7b12757780 [MERGE] forward port of branch 9.0 up to 4f7d0da 2016-04-28 11:12:06 +02:00
Géry Debongnie 7922370f12 [FIX] mail: fix performance issue with large channels
When a user is subscribed to a channel with many messages,
the discuss initial rpc /mail/client_action can become very
slow (in production, the rpc took > 20s when subscribed to
the Community mailing list).  This is due to the query in
_get_message_unread, counting the number of unread messages.

This commit adds an index on the relation mail_channel_partner,
this allows postgres to perform only index lookups, and speeds
up the query by 2 order of magnitudes.
2016-04-27 17:00:20 +02:00
Christophe Simonis 28e9256912 [MERGE] forward port of branch 9.0 up to 3108a49 2016-04-26 14:11:20 +02:00
Olivier Dony e1ed2c6ddc [FIX] mail: visibility rules for channel notifications
Avoid raising an access denied error for messages that
the user has indeed be notified about.

The issue arose when a message posted on a document inaccessible
to the user was notified to one of the channels the user
is subscribed to.

The access control logic on messages relies on 2 heuristics
to grant read access to a message:
 a. either the user was notified about the messages, by being
    a follower of the document, or a subscriber of a channel
    following the document (in that case the user can see the
    message but not the document)
 b. or the user has read access to the document on which the
    message is posted (in that case the user can see both
    the message and the document)

Case `a.` sometimes fail to match when a message got notified
to several channels including one the user was not subscribed
to. Depending on the order of the returned rows in the SQL
query, the "foreign" channels could shadow the channels of
the user, making `a.` a non-match.

If case `b.` did not match either, the user would have the
`read` access denied, even though the message was visible by
the `search()` method.

The fix explicitly makes case `a.` match if the user was
notified in *at least* one channel.
This was not done through a change of the SQL query ORDER,
for readability reasons.
2016-04-25 18:22:44 +02:00
Christophe Simonis 2dcbdd0778 [MERGE] forward port of branch saas-10 up to bb8f0f1 2016-04-25 15:48:31 +02:00
Christophe Simonis bb8f0f1fc3 [MERGE] forward port of branch saas-9 up to 4d337f7 2016-04-25 14:43:44 +02:00
Olivier Dony ee804e1d32 [MERGE] Forward-port 9.0 up to 74d8cbc190 2016-04-21 18:05:14 +02:00
Olivier Dony 74d8cbc190 [FIX] mail: fix bounce email addressing
- The "From" should not be the administrator user but
  the postmaster/system, and should be an address that
  ignores double-bounces. Using the default bounce
  email accomplishes both.

- The "To" recipient should be the "envelope from"
  sender when available, usually as provided by
  the "Return-Path" header set by the upstream MTA.
  If not present, fall back to the "From" of
  the original email.

- adapt tests to verify the behavior wrt Return-Path
2016-04-21 17:26:45 +02:00
Mansi Gandhi be232e69da [REM] mail: subtype dropdown in chatter
The possibility to choose a subtype when logging a note was added with the
activities mechanism in CRM. However as the user should not use the chatter
but a dedicated wizard in order to do this, the dropdown is removed.

The internal subtype mechanism is kept. Only the possibility to log something
else than a note through the chatter UI has been removed.
2016-04-19 15:25:51 +02:00
Denis Ledoux 7bde7b9016 [FIX] mail: message_post requires record write access
By default, users are supposed to be able to write messages
in threads only if they have the write access on the record.

This behavior is the behavior defined in Odoo 8.0.

This behavior can be changed by defining
`_mail_post_access` on the model,
to allow the creation of new messages
if the user has only the read access, for instance.

This is the case on `project.issue`, for instance.

Since 9.0, @ revision 88b8cd0587,
this behavior was broken: Any users having the read
access on the record was allowed to write messages in the thread,
while this should not be the case, except if
`_mail_post_access = 'read'`
has been defined on the model.

This is because the SQL query which is performed in order
to know the thread messages the user has been notified of
was expected to return only the ids of the notified message,
while it actually always returned all the message ids of the thread,
because of the LEFT JOINS, e.g.

```
LEFT JOIN "mail_message_res_partner_rel" partner_rel
ON partner_rel.mail_message_id = m.id AND partner_rel.res_partner_id = (%%s)
```

Instead of just checking the ids of the messages returned by this
query, it must check that one of the two columns
`partner_rel.res_partner_id` or `channel_partner.partner_id`
is filled, meaning the partner has been notified of the message or
is a member of the channel the message has been posted to.

opw-668589
2016-04-19 15:16:32 +02:00
Thibault Delavallée f5772c5e8d [FIX] mail: fix issue when processing several CIDs having the same file name 2016-04-14 14:03:55 +02:00
Jigar Patel 253d4eccf0 [IMP] mail: Add counter in starred 2016-04-08 13:41:01 +02:00
Christophe Simonis 658989868c [MERGE] forward port of branch saas-10 up to aa6ebd1 2016-04-05 20:08:50 +02:00
Christophe Simonis aa6ebd146a [MERGE] forward port of branch saas-9 up to 549daaa 2016-04-05 19:27:34 +02:00
Olivier Dony b5a7491b64 [MERGE] Forward-port of saas-7 up to rev. 83a08c4791
Conflicts:
	openerp/addons/base/res/res_partner.py
2016-04-02 01:09:07 +02:00
Olivier Dony 83a08c4791 [MERGE] Forward-port 9.0 up to rev. 7a483a85d4 2016-04-02 01:03:59 +02:00
Raphael Collet 7a483a85d4 [FIX] *: do not use computed fields for resizing images
Otherwise recomputation may fail with "record does not exist or has been
deleted" when creating records with a value directly set for e.g.
'image_mediun' on a new product.

The issue comes from the storage of the images.  When creating a product, the
creation of an attachment for storing the field `image_medium` triggers the
recomputation of that field before its dependency `image` is set.  As `image`
is initially null, `image_medium` is recomputed as null, and this deletes the
attachment just created before the latter has completed its creation!  As a
consequence, some code at the end of `create` for the attachment crashes
because the record has been deleted.

The following models have been fixed: `fleet.vehicle.model.brand`,
`hr.employee`, `im_livechat.channel`, `mail.channel`, `payment.acquirer`,
`pos.category`, `product.template`, `product.public.category`, `res.partner`.

opw 666330
Closes #11516
2016-04-02 00:47:57 +02:00
Christophe Simonis 79976bd779 [MERGE] forward port of branch saas-10 up to 6e95659 2016-04-01 19:10:34 +02:00
Christophe Simonis 6e95659a08 [MERGE] forward port of branch saas-9 up to f4d1adc 2016-04-01 18:51:55 +02:00
Christophe Simonis 6c8141a1df [MERGE] forward port of branch saas-10 up to 2483327 2016-04-01 16:15:35 +02:00