Commit Graph

594 Commits

Author SHA1 Message Date
Thibault Delavallée cf40f4e9b0 [FIX] [IMP] mail: refactored code of message_auto_subscribe.
This new code allows faster computation, because it avoids
- searching in a many2many relationship that is very costly in production
databases, because it is replaced by an 'id in [ids]' equivalent leaf
that can be huge.
- browsing in a create/write (should also lessen the number of issues
about read access rights in create)

A new optionnal parameter is given to the method, that are the
modified values. If this is not given (compatibility-mode) the
records are browsed to fetch the value.

bzr revid: tde@openerp.com-20131114113231-oyk16t9i3m3wul6k
2013-11-14 12:32:31 +01:00
Denis Ledoux d32c663fbe [FIX]mail: mail_thread, trying to send a message in the chatter while the emails where all mal-formed raised an error.
bzr revid: dle@openerp.com-20131008111845-tx3bpp8snfl03cnk
2013-10-08 13:18:45 +02:00
Thibault Delavallée d874d9980d [FIX] mail: fixed wrong parsing of multipart/mixed emails.
alternative mode is computed when browsing the parts, not from
the message content type.

Added tests.

Also added some notification_email_send to none to avoid sending
emails in demo/data/update.

bzr revid: tde@openerp.com-20130823120611-0n4ull3c8gvwug2u
2013-08-23 14:06:11 +02:00
Thibault Delavallée b7f4ddb880 [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20130621092424-supbxu8mwm2qtu6b
2013-06-21 11:24:24 +02:00
Thibault Delavallée ff00a84d33 [FIX] mail: fixed a glitch in message_subscribe sometimes overriding specified subtypes
bzr revid: tde@openerp.com-20130620135718-qi0d8fpqvombq3v1
2013-06-20 15:57:18 +02:00
Thibault Delavallée cd9efe1f99 [FIX] mail: take into account default_ context values for auto subscribe
bzr revid: tde@openerp.com-20130619123829-gr1rkgp490bdci9u
2013-06-19 14:38:29 +02:00
Thibault Delavallée 41311b9f33 [FIX] mail: fixed id of record in a loop (record.id, not all ids).
bzr revid: tde@openerp.com-20130613095228-b4r8kca7hkjd6ppa
2013-06-13 11:52:28 +02:00
Thibault Delavallée 2652bd586d [FIX] mail: message_subscribe_users: refactoring of the algorithm to achieve better computation time.
Previous implementation did a search on mail.followers with subtype_ids=False, leading
to a very bad computation time. This search is now avoided.

bzr revid: tde@openerp.com-20130613082029-lmd63s3mqwxasy4j
2013-06-13 10:20:29 +02:00
Denis Ledoux 75ed151ad9 [FIX]mail: mail_thread, method message_capable_models was not returning all message capable models
bzr revid: dle@openerp.com-20130611133314-pq9bmj7af61k7swe
2013-06-11 15:33:14 +02:00
Martin Trigaux d626d3cb61 [MERGE] backport saas-1 rev 8728
[FIX] mail, project, project_issue, crm_lead: fixed 'XX Created' subtype not triggered because of condition
based on state=new and not state=draft.
For tasks, issues and leads, no generic 'Document created' message is posted anymore
because of the 'XX Created' message with subtype automatically logged.
Generic creation message is logged before automatic subscription to enable
message pushing to responsibles.

bzr revid: mat@openerp.com-20130529143022-wy76srwb2nwkspe3
2013-05-29 16:30:22 +02:00
Thibault Delavallée ea0316e3f1 [FIX] [FIX] mail: fixed subscription of an already subscribed follower erasing already existing subtypes + added tests
bzr revid: tde@openerp.com-20130508102304-p52bq0qux9s7rses
2013-05-08 12:23:04 +02:00
Thibault Delavallée c2f02f6798 [FIX] mail, crm: fixed some access rights issues when using chatter on a document without access rights with portal users.
bzr revid: tde@openerp.com-20130417085927-wg07siehk2uhrkpu
2013-04-17 10:59:27 +02:00
Thibault Delavallée f8a2299525 [MERGE] [FIX] mail, email_template: fix attachment duplication and clean attachment management
The way attachments are linked to the document has been cleaned. Posting method message_post may receives 2 arguments:
- attachment_ids: those linked to the wizard model (mail.compose.message) are linked to the document (res_model, res_id)
- attachments: the tuples are used to create new attachments linked to the document
The wizard does not set the res_model and res_id of attachments anymore, delegating this job to message_post.

The mail.message and mail.compose.message now use their respective attachment_ids field when possible. This is done instead of reading/creating new attachments based on the attachments tuple each time a mail.compose.message is processed. Email templates now also use attachment_ids, in particular when generating emails, instead of using the attachments tuple. Only reports are still generated on the fly and put into attachments instead of attachment_ids.

A cron job has been added to unlink 'lost' attachments. Those are attachments:
- linked to 'mail.compose.message'
- with res_id=0 (due Chatter used in minimal mode or reports generated by templates before the wizard has an ID)
- with no activity for more than one day (create_date and write_date)

bzr revid: tde@openerp.com-20130411112033-mqph9vjlcjkoolfs
2013-04-11 13:20:33 +02:00
Thibault Delavallée 8c7cf300eb [MERGE] [FIX] mail: bettersuggested recipients based on email address. It tries to find a partner that is in the related document followers, or a user, or the first partner with matching email.
bzr revid: tde@openerp.com-20130411104151-wi5ru54b362pv957
2013-04-11 12:41:51 +02:00
Thibault Delavallée fe2ea997a2 [MERGE] Sync with trunk.
bzr revid: tde@openerp.com-20130411103645-rmr3sa8p9ropx2gc
2013-04-11 12:36:45 +02:00
Thibault Delavallée f994529725 [IMP] mail: finding partner based on email: improved code for suggested partners, added somme comments and tests.
bzr revid: tde@openerp.com-20130411101720-mumz152dsxvv1xbj
2013-04-11 12:17:20 +02:00
Thibault Delavallée 8b97805621 [FIX] mail: fixed some translation issues.
Document created text was not translatable
Subtype was fetched without context, therefore not translated
Removed odd override of _t introduced in mail_followers at revision 7885

bzr revid: tde@openerp.com-20130408092447-3ri41v6xluuj0wha
2013-04-08 11:24:47 +02:00
Thibault Delavallée 37bec9643d [FIX] mail: fixed recipients of private discussion, that were not correct. Author could be notified of their own reply independently of the specified recipients. Added tests for private discussions.
bzr revid: tde@openerp.com-20130403121307-4rixx7ct6y86spoz
2013-04-03 14:13:07 +02:00
Thibault Delavallée a173caa0f4 [FIX] Fixed wrong parameter name given to astimezone introduced at revision 8954; correct parameter name is tz, not tzinfo.
bzr revid: tde@openerp.com-20130403120926-xfxtj5hsva6jzb1u
2013-04-03 14:09:26 +02:00
Christophe Matthieu 767fe2458a [FIX] mail: issue: After receiving inbox messages from external emails, when clicking on reply button the external email is listed in the form. However when clicking on send the external email is removed! and instead of email what we get is an internal note.
bzr revid: chm@openerp.com-20130403085116-m2kyiem0r2dnjwov
2013-04-03 10:51:16 +02:00
Thibault Delavallée c6bf1f1af3 [MERGE] Sync with 7.0
bzr revid: tde@openerp.com-20130329103315-ico83ec57l2dzx4v
2013-03-29 11:33:15 +01:00
Chris Biersbach fd84a4dec4 [FIX] the functionality to save the original mail fetched by the fetchmail module now correctly works
bzr revid: cbi@openerp.com-20130327112517-evcxdkedguka6y8a
2013-03-27 12:25:17 +01:00
Thibault Delavallée f3a976fd53 [FIX] mail: fixed suggested recipients, not taking into account followers; when having multiple email addresses, this could lead to people being suggested based on email although they already are followers.
bzr revid: tde@openerp.com-20130326125311-xlt1lt1te28fcm1o
2013-03-26 13:53:11 +01:00
Thibault Delavallée 682089878f [IMP] mail: message_process: updated logger (debug -> info, email_from and email_to in logger messages).
bzr revid: tde@openerp.com-20130322134410-2kjptxqrc3bmcbyj
2013-03-22 14:44:10 +01:00
Thibault Delavallée 6cfb01d7c9 [FIX] mail: message_process: do not process incoming emails with a message_id already existing in database.
Before trying to find possible routes, check that the incoming email's
message_id is not already present in mail.message table.
If it is the case, return False.

Parsing of the message has been moved before routing, to avoid looking
for routes for emails we will discard.

Tests have been added and updated.

bzr revid: tde@openerp.com-20130322124809-ven2p5kxpqfjqxb5
2013-03-22 13:48:09 +01:00
ajay javiya (OpenERP) 8ecb77a59d [FIX]: mail chatter issue
bzr revid: aja@tinyerp.com-20130321125508-ixlskc9rnnalwcwl
2013-03-21 18:25:08 +05:30
Thibault Delavallée 88b39119b8 [MERGE] [FIX] mail_gateway: better algorithm to find the partner of an incoming email when having multiple matching partners for a given email address.
The mailgateway tries to find a partner that is also an user with the email_from.
If none is found, it takes the first partner with matching email.
In message_post, it tries to find the author based on the document's followers.
Indeed it is very likely that an answer comes from a follower of a document.

The whole process is not done inside the mailgateway because document
and followers related stuff belong to message_post, not to the mail gateway.

Tests have been added in mail.

bzr revid: tde@openerp.com-20130321120451-qk524qayq28sw3th
2013-03-21 13:04:51 +01:00
Thibault Delavallée f02e8bfd61 [FIX] Broltch
bzr revid: tde@openerp.com-20130321112823-nmqzcjzigiwt09q7
2013-03-21 12:28:23 +01:00
Thibault Delavallée 62fc6f7cd7 [CLEAN] Cleaned code of fix.
bzr revid: tde@openerp.com-20130320164202-yy13qg8pdx09ie9z
2013-03-20 17:42:02 +01:00
Thibault Delavallée 30a1d99d07 [MERGE] Sync with trunk + fixed the fix and tests.
bzr revid: tde@openerp.com-20130320161045-41bpe36b09tgcxpo
2013-03-20 17:10:45 +01:00
Thibault Delavallée 82b3e9b5fd [FIX] mail: mail_create_nosubscribe context key also supported in message_post: allows to avoid subscribing the author to the document.
bzr revid: tde@openerp.com-20130320084011-coyf9p1il2ue04bb
2013-03-20 09:40:11 +01:00
Chris Biersbach 9e6d14a289 [IMP] Removed unnecessary code in project_issue.py, fixed a small error in mail_thread
bzr revid: cbi@openerp.com-20130319103822-ss4y3na3i4hip4e0
2013-03-19 11:38:22 +01:00
Chris Biersbach 31d218cc67 [IMP] Project issue: Improved handling of thread_model context value in message_post. Replaced a read by a browse in Project issue write
bzr revid: cbi@openerp.com-20130313083808-o75djyctnj5sgngx
2013-03-13 09:38:08 +01:00
Thibault Delavallée fcea61b6eb [IMP] mail: added a cron job to delete mail attachments (lost user input or reports generated on-the-fly). They have: res_model = mail.compose.message; res_id 0; more than one day of inactivity.
bzr revid: tde@openerp.com-20130307132517-4xivu90dzn3o744a
2013-03-07 14:25:17 +01:00
Thibault Delavallée 9cf7f70d15 [MERGE] Sync with 7.0
bzr revid: tde@openerp.com-20130307102507-4agvd08e07wu5grq
2013-03-07 11:25:07 +01:00
Thibault Delavallée 5e59420989 [FIX] mail_thread: fixed a list that should be a set. This has nothing to do with the previous commit. Seriously.
bzr revid: tde@openerp.com-20130307093414-wcdakf017sskj35l
2013-03-07 10:34:14 +01:00
Thibault Delavallée 000042ac68 [FIX] mail_thread: fixed set that should not be a set.
bzr revid: tde@openerp.com-20130307093115-9jmflmnf420iiz21
2013-03-07 10:31:15 +01:00
Thibault Delavallée e57ffc4836 [FIX] mail: added wrapper for message_Create_patners_from_emails in mail_thread and res_users; cleaned message_post signature to match the pre-merge signature. Also fixed a wrong argument name in message_post_user_api.
bzr revid: tde@openerp.com-20130307075216-kk0m304405ohm7ua
2013-03-07 08:52:16 +01:00
Thibault Delavallée 445c1aa412 [FIX] mail: added wrapper because of changes introduced in the API recently.
bzr revid: tde@openerp.com-20130306162811-t4505m08nep2jlz4
2013-03-06 17:28:11 +01:00
Thibault Delavallée 4665d10f05 [IMP] mail, email_template: better consistence of mail.compose.message mdoel ans 0 or res_id res_id for attachments on composer; generate_email_for_composer should avoid returning keys for void values.
bzr revid: tde@openerp.com-20130306134612-yazwi6cgwvw8suyw
2013-03-06 14:46:12 +01:00
Quentin (OpenERP) c450d0abe7 [FIX] mail: fixed error when the reference is given as False in teh message dictionary in message_parse() of mail_thread.py
bzr revid: qdp-launchpad@openerp.com-20130301114630-y4ynidvhh9pj29s9
2013-03-01 12:46:30 +01:00
Thibault Delavallée 6de2650299 [IMP] Suggested recipients: check whether an email is linked to a partner.
bzr revid: tde@openerp.com-20130228170546-t04n73pvuwtp20jh
2013-02-28 18:05:46 +01:00
Thibault Delavallée 718d38f056 [FIX] Chatter: mail_post_autofollow can be completed with mail_post_autofollow_partner_ids, that filters the recipients to subscribe. Purpose: suggested partners are added as followers, not people that could have been added after in the compose wizard.
bzr revid: tde@openerp.com-20130228164054-e3y3pdrygqph0dm2
2013-02-28 17:40:54 +01:00
Thibault Delavallée 68545cf6ae [DOC] mail: added some comments.
bzr revid: tde@openerp.com-20130226151531-3zmtcdodmpnh74zh
2013-02-26 16:15:31 +01:00
Thibault Delavallée 53dc52a5c1 [CLEAN] mail_thread: cleaned _get_message_data method. Maybe not the best way, but we tries to avoid using group_by and count because of spurious timing results. Also added some comments.
bzr revid: tde@openerp.com-20130226150707-hzyb8unhsz1i2hh3
2013-02-26 16:07:07 +01:00
Thibault Delavallée 6c3aa520c7 [IMP] mail_followers: improved _notify, to better manage notifications. An optional (to provide compatibility) parameter has been added, that allows to notify partners of a given messages. It checks whether a notification already exists, setting it back as unread, or create a notification pushed by email.
bzr revid: tde@openerp.com-20130226105755-gvkn1ocpwkcndzpl
2013-02-26 11:57:55 +01:00
Thibault Delavallée 0193a29335 [REV] auto_subscribe: back. Added setting first email or message as unread for auto subscribed people.
bzr revid: tde@openerp.com-20130222125610-atovl540kvkv0bq7
2013-02-22 13:56:10 +01:00
Thibault Delavallée 95cd6600da [CLEAN] mail: remove print statements, uncommented a line.
bzr revid: tde@openerp.com-20130222094921-yjdc82lm3m9olvqt
2013-02-22 10:49:21 +01:00
Thibault Delavallée 4c98128d11 [IMP] mail: remove auto_follow on user_id field. Replaced by partner suggestion on user_id, based on message_get_suggested_partners called in Chatter. Improved JS code, to handle various case (partner without email, email without partner, partner with email).
bzr revid: tde@openerp.com-20130221184243-pu2tgtlanh34onpr
2013-02-21 19:42:43 +01:00
Thibault Delavallée c0b4bf55d8 [IMP] [CLEAN] mail: incoming emails have an email_from even if an author is found (do not loose data); fixed author subscription, delegated after message creation (otherwise allows to by-pass most of the access rules); code and comments cleaning.
bzr revid: tde@openerp.com-20130221150849-cydhns582qwrqznz
2013-02-21 16:08:49 +01:00