Commit Graph

770 Commits

Author SHA1 Message Date
Denis Ledoux 02459f8d4a [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9929 revid:dle@openerp.com-20140325104921-x8zjx5p71l1o3uif
bzr revid: dle@openerp.com-20140310133913-465x5t3n1bo7fu98
bzr revid: dle@openerp.com-20140311164146-2s599kogbqj8e94l
bzr revid: dle@openerp.com-20140312111149-u6y036aej3ywq7et
bzr revid: dle@openerp.com-20140312121145-06s1jvct9v4m7l6s
bzr revid: mat@openerp.com-20140313084409-c0kckxemy3in0mlo
bzr revid: chs@openerp.com-20140313163420-ifa4hyixj722d6jo
bzr revid: chs@openerp.com-20140314102034-g0nzryvwhrpzdas9
bzr revid: chs@openerp.com-20140314104803-19c5snl2fcuih91o
bzr revid: odo@openerp.com-20140314143519-x6rzcfkkqxwc0e1g
bzr revid: chs@openerp.com-20140318110229-y8098w3shdpmoig2
bzr revid: dle@openerp.com-20140318151824-sscl4m8p87emjl8s
bzr revid: dle@openerp.com-20140320112618-yfyihlwz66ryeqf5
bzr revid: dle@openerp.com-20140320161003-j01cc6sqves2wnp2
bzr revid: dle@openerp.com-20140320181252-4gqcog22p1ex0pz7
bzr revid: dle@openerp.com-20140321140450-8ulnhr76qybiadks
bzr revid: dle@openerp.com-20140324104743-ubvu8st7emq9pg1q
bzr revid: dle@openerp.com-20140325112413-xs5z7y81rhyjt0rd
2014-03-25 12:24:13 +01:00
Olivier Dony 9e002d9233 [FIX] mail.thread: avoid error if `message_unread_count` has been popped 1 line earlier
bzr revid: odo@openerp.com-20140314104605-qi7eqj2g37dvxvc3
2014-03-14 11:46:05 +01:00
Christophe Simonis 44a99c0976 [FIX] calendar: correct recurrency end date computation
bzr revid: chs@openerp.com-20140314094809-0wuus62tob8vtyi0
2014-03-14 10:48:09 +01:00
Denis Ledoux 0ef17beed0 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9846 revid:dle@openerp.com-20140217124044-o8sgz1esfqeha01f
bzr revid: dle@openerp.com-20140214100922-m6rf7c6x85nv67sl
bzr revid: dle@openerp.com-20140214114713-oab4kbearvv7g3nh
bzr revid: dle@openerp.com-20140214131810-9abebxpfeoga1crn
bzr revid: dle@openerp.com-20140217124230-ov201kfep88f5tn7
2014-02-17 13:42:30 +01:00
Thibault Delavallée ec5291c130 [IMP] fetchmail: try / except the processinf of each email and log any exception
found during processing. This way, all emails in the queue are managed and
all failed emails have their own exception in the logs, allowing easier
debugging.
Note that a failed email is set as seen to avoid processing it every time
the scheduler runs.

bzr revid: tde@openerp.com-20140213095717-tcwgkl143i3ujw8h
2014-02-13 10:57:17 +01:00
Thibault Delavallée dca7f71d71 [DOC] mail_thread: docstrings to add raised exceptions in message_process and message_route
bzr revid: tde@openerp.com-20140213090122-0gwin1pjigwu42sz
2014-02-13 10:01:22 +01:00
Thibault Delavallée 150d5a9e18 [IMP] mail: mail_thread: message routing: raise exceptions instead of using asserts.
Indeed assert are statements meant to be used when developping, for
debug purpose. In a production environment it is safer to use real
exceptions that can be managed accordingly.

bzr revid: tde@openerp.com-20140212152737-c7q339psd9hi4iwd
2014-02-12 16:27:37 +01:00
Denis Ledoux 0043f81e33 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9824 revid:dle@openerp.com-20140210134603-ck0jr56xhl8xgzg2
bzr revid: dle@openerp.com-20140210141704-sjzjwhe7fh5gszxr
2014-02-10 15:17:04 +01:00
Thibault Delavallée 759ed5bbb6 [IMP] mail: subscription: if no-one to (un)subscribe, already return. This is not
necessary for computation, but saves some browse / access right checking.

bzr revid: tde@openerp.com-20140210115827-2y451i0edgve59mi
2014-02-10 12:58:27 +01:00
Martin Trigaux 54a1ffc480 [FIX] mail: priority -10 on message_follower_ids to make sure executed before other function field that may use the followers (eg: note.note for access rights)
bzr revid: mat@openerp.com-20140210083130-ag95lqwlpkv7ceqc
2014-02-10 09:31:30 +01:00
Olivier Dony f7c1afffcb [FIX] mail.thread: avoid tracking multiple temporary changes during copy
bzr revid: odo@openerp.com-20140206173251-1njroiu08fzgdbyp
2014-02-06 18:32:51 +01:00
Denis Ledoux 15c105d95f [FIX] mail: re-apply security fix correctly from 9812 revid:mat@openerp.com-20140206121438-epghqo042ync24v5 of 7.0 branch
bzr revid: dle@openerp.com-20140206170829-918bxb88qh415w9e
2014-02-06 18:08:29 +01:00
Denis Ledoux 8e4279835b [FIX]mail: fix indentation problem from previous forward port
bzr revid: dle@openerp.com-20140206165630-13w44y6iewdrsl02
2014-02-06 17:56:30 +01:00
Denis Ledoux 041f1db4a6 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9814 revid:dle@openerp.com-20140206163444-ckcmurcwk2vhi5vp
bzr revid: dle@openerp.com-20140206164522-fi05cb4mpg22rkv2
2014-02-06 17:45:22 +01:00
Martin Trigaux 5ebcb64c34 [IMP] mail: in case of creation, still check creation access rights for subscription
bzr revid: mat@openerp.com-20140206120109-6h2vz1ulu33t1509
2014-02-06 13:01:09 +01:00
Martin Trigaux 922836d8cd [IMP] mail: check at least access_rights in case of creation
bzr revid: mat@openerp.com-20140206110327-zar4yl03r1lympx6
2014-02-06 12:03:27 +01:00
Martin Trigaux 7407f3c888 [FIX] mail: backport of saas-2 revision 9065 and 9081.
Make sure the user is subscribed before the super() call in mail_thread. This allows to have follower based record rules working (eg: note.note)

bzr revid: mat@openerp.com-20140206104714-anpehaik4wajnfrw
2014-02-06 11:47:14 +01:00
Thibault Delavallée 4d73f955a9 [FIX] mail: mail_thread: fixed a bug in subscription, new followers
could overwrite the subscription of previous followers.

This has already been fixed in saas-2 branch at revision 9079 (revid
tde@openerp.com-20140109131748-hgtflp40pmjhlhu2). But the fix is also
valid for the 7.0 stable branch.

bzr revid: tde@openerp.com-20140115115825-fniobvz33sssvrwd
2014-01-15 12:58:25 +01:00
Martin Trigaux b7f393da31 [FIX] mail: do not check access rights for autosubscription after create.
This is required for models using message_follower_ids in their record rules (eg: note.note)

bzr revid: mat@openerp.com-20140110100133-wemcu6ou8avk6rpi
2014-01-10 11:01:33 +01:00
Thibault Delavallée 3e95a42690 [FIX] mail: fixed auto subscription overriding subscription of other followers
bzr revid: tde@openerp.com-20140109131748-hgtflp40pmjhlhu2
2014-01-09 14:17:48 +01:00
Christophe Simonis c0117351a8 [MERGE] forward port of branch 7.0 up to revid 9735 mat@openerp.com-20140106153818-lsy030btlzminvw9
bzr revid: chs@openerp.com-20140107142554-lx0ls3fly7cxmahj
2014-01-07 15:25:54 +01:00
Martin Trigaux d106d54ade [FIX] mail: check access rules of related documents when subscribing to it
Fix tests to execute actions with user that are allowed to

bzr revid: mat@openerp.com-20140106141157-0tp2bgw2d40ynrag
2014-01-06 15:11:57 +01:00
Martin Trigaux 964dae2311 [FIX] mail: subscribe user at creation as a default value instead of post processing.
This allows to have a value for the _set_followers call and be able to have record rules based on followers (eg: note.note).
Set the priority of message_follower_ids fields to -10 to be sure it will be executed before other function fields using these followers (eg: _set_stage_per_user from note.note does a browse which would trigger record rules to read the note)

bzr revid: mat@openerp.com-20140106100010-jl4cuvgvpsw26v28
2014-01-06 11:00:10 +01:00
Denis Ledoux 4305522776 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9728 rev-id: dle@openerp.com-20140102161149-x268xj7bzvvsit2h
bzr revid: dle@openerp.com-20140102164522-og7f932e50kzz7z6
2014-01-02 17:45:22 +01:00
Denis Ledoux bc50cd3558 [FIX] mail: mails with attachments containing special chars (such as é) were not delivered properly
get_filename method from email lib returns sometimes decoded value, sometimes still encoded.
for instance, get_filename cannot decode iso encoded filename

Recently, decode method has been applied on filename string, to handle iso encoded file. 
Sadly, one cannot decode already decoded values.
Therefore, decoding already decoded windows or utf-8 encoded filename with special chars failed.

bzr revid: dle@openerp.com-20140102161149-x268xj7bzvvsit2h
2014-01-02 17:11:49 +01:00
Denis Ledoux 20be322c45 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9684 rev-id: dle@openerp.com-20131209145652-3g9rgnfz1w8k0whw
bzr revid: chs@openerp.com-20131202105848-33gcz1715w370rve
bzr revid: dle@openerp.com-20131204150643-is3y0b9n8enh3yql
bzr revid: chs@openerp.com-20131206152726-pirikn7v8pev90ic
bzr revid: dle@openerp.com-20131206162437-b9niay99mirk44qm
bzr revid: tde@openerp.com-20131209102019-kjeg0rx2au1d5e5v
bzr revid: dle@openerp.com-20131209155721-589zihxx8jmvlpvp
2013-12-09 16:57:21 +01:00
Thibault Delavallée fcd5f7d960 [MERGE] Sync with 7.0
bzr revid: tde@openerp.com-20131209090903-al4o6uhrhhw4cqcl
2013-12-09 10:09:03 +01:00
Thibault Delavallée 2382710f6f [REV] mail: removed some changes to be done in trunk, not in 7.0
bzr revid: tde@openerp.com-20131209090802-q8fzn88ia9w6o5pq
2013-12-09 10:08:02 +01:00
Thibault Delavallée 5859d84dc1 [MERGE] Sync with saas-2
bzr revid: tde@openerp.com-20131128094037-j59xo6sbj7k00fbf
bzr revid: tde@openerp.com-20131129092306-t0nb7tgyoqovx101
2013-11-29 10:23:06 +01:00
Denis Ledoux 2a9de8ba6f [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9654 rev-id: dle@openerp.com-20131127151815-gzk9py9wtzmndziw
bzr revid: dle@openerp.com-20131127152136-5p0lkz4vpfn9qxxx
2013-11-27 16:21:36 +01:00
Martin Trigaux 7c1bf0dd29 [FIX] mail: decode filename at email reception (if non-ascii characters) (opw 591729)
bzr revid: mat@openerp.com-20131127124021-bliapaggdjd1xnuz
2013-11-27 13:40:21 +01:00
Christophe Simonis 6b05beecc1 [MERGE] forward port of branch 7.0 up to revid 9651 chs@openerp.com-20131127104459-jb77x7quwcvtifm7
bzr revid: dle@openerp.com-20131126171210-jovr7e7efehuq3s2
bzr revid: chs@openerp.com-20131127110046-4ow36dkuuyzgf1pl
2013-11-27 12:00:46 +01:00
Thibault Delavallée ae7fcfb564 [IMP] [FIX] mail: mail_thread :
- avoid having to browse the record in message_subscribe: refactored message_subscribe
to work on ids without browsing, try to lessen the number of queries to do
- update _set_followers, method of the function field message_follower_ids, to use
message_subscribe and message_unsibscribe
- in create: add author as follower in creation values, not after create, allowing
create access rules based on followers
- updated message_unsubscribe to be the lower method, not calling _set_followers anymore

bzr revid: tde@openerp.com-20131126171752-1irizm7mhv2y1wrn
2013-11-26 18:17:52 +01:00
Thibault Delavallée cf214ed724 [FIX] mail: when generating pure email mass mailing
we have to process attachments as well as attachment_ids in the values generated
by the composer and the optional template.
As this behavior is the same as the one already implemented for message_post, this
feature has been moved into its dedicated method to be called by message_post
or before calling mail_mail.create().
This also allows to have attachments in pure email mass mailing that are attached
to mail.message, not to mail.compose.message model. When unlinking those emails,
the attachments will be also removed, and not lost in the database anymore.

bzr revid: tde@openerp.com-20131126110942-h8p0d9sbjtk0hwlu
2013-11-26 12:09:42 +01:00
Thibault Delavallée 4be6ac800b [FIX] mail: in some cases tracking is called
without the context (some workflows for example). In that case use the
current user lang when generating the automatic message. This is done
by adding it in the context if not present.

lp bug: https://launchpad.net/bugs/1219163 fixed

bzr revid: tde@openerp.com-20131125163808-bbbqwvx22my38zdj
2013-11-25 17:38:08 +01:00
Olivier Dony 2cba6a5355 [MERGE] Forward-port of latest 7.0 fixes up to rev 9629 rev-id odo@openerp.com-20131121153230-keie85rmes2zh2o8
bzr revid: chs@openerp.com-20131121112139-aw2ara1i1xymue62
bzr revid: odo@openerp.com-20131121154205-ul9hf9tz3h0x2n7m
2013-11-21 16:42:05 +01:00
Thibault Delavallée 1761086ad7 [FIX] mail: auto_subscribe: fix subscription, could have subtypes linked to another model than the current model
bzr revid: tde@openerp.com-20131120154320-gf67wbv3en2f7ral
2013-11-20 16:43:20 +01:00
Olivier Dony 44664076da [MERGE] Forward-port of latest 7.0 fixes up to rev 9618 rev-id: dle@openerp.com-20131120142131-s333lyva85cyn41o
bzr revid: odo@openerp.com-20131120144059-yyh7emvgdarff09b
bzr revid: odo@openerp.com-20131120144318-11nmn1zj00zmi10z
2013-11-20 15:43:18 +01:00
Thibault Delavallée 20f10d574a [FIX] mail: auto_subscribe: domain for fetching followers was wrong, forgot an AND
bzr revid: tde@openerp.com-20131114121746-lqqr4nzpduk4lfdq
2013-11-14 13:17:46 +01:00
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
Olivier Dony d1d35b3f57 [FIX] mail.thread: message_redirect_action should not crash when the message has been deleted
bzr revid: odo@openerp.com-20131028160100-yhebao3adbzz00cn
2013-10-28 17:01:00 +01:00
Thibault Delavallée 62e88a16e4 [FIX] mail: mail_mail: fixed url embedded in notification emails.
When having emails not linked to a notification (mail.notification = False)
the link is generated without any clue about the source record.
However we can try to use model and res_id defined on the mail_mail record
to correctly format a link.

Added support of model and res_id in message_redirect_action. This method
now can redirect based on a message_id, or based on model / res_id.

bzr revid: tde@openerp.com-20131018144924-j4f22hen3lsua7cb
2013-10-18 16:49:24 +02:00
Olivier Dony 748ac8626c [FIX] mail: typo during earlier fwd-port merge
bzr revid: odo@openerp.com-20131015181331-97k21d3xooox8z1j
2013-10-15 20:13:31 +02:00
Christophe Simonis 273face907 [MERGE] forward port of branch saas-1 up to revid 8791 chs@openerp.com-20131009175454-j06y1ngylfbqyrpj
bzr revid: chs@openerp.com-20131009180337-cxgdt6zzd1z68ga9
2013-10-09 20:03:37 +02:00
Olivier Dony 8ac110c4dd [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5098 rev-id: odo@openerp.com-20131011123914-7zuvd9mch21yxgj8
bzr revid: dle@openerp.com-20131009131902-a93nsbou4w8y0vlx
bzr revid: chs@openerp.com-20131009175454-j06y1ngylfbqyrpj
bzr revid: dle@openerp.com-20130918160049-fo88fl7uyhfoofkv
bzr revid: dle@openerp.com-20130924130544-kmkyr0d73cusvdav
bzr revid: odo@openerp.com-20131011134433-nyfjipvlql4xu127
2013-10-11 15:44:33 +02: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 1d76129a22 [FIX] mass_mailing:
- fixed forgottent import of mail_thread in mass_mailing, to enable bounce and replied tracking
- fixed replied computation in message_route_process, adding the original email in parameters
- fixed form view of campaign, to add edit and dlete now that clicking on it redirects to the waves
- added track field on mail_mail, to avoid creating too mush entries in mail.mail.statistics
- fixed mass_mailign controller

bzr revid: tde@openerp.com-20130916114706-b9zyhp0ha6mr9fzg
2013-09-16 13:47:06 +02:00
Thibault Delavallée fbc6443692 [CLEAN] mail: cleaned some read -> browse + forgotten statement to remove
bzr revid: tde@openerp.com-20130913122956-6zkk9ucewbt6w407
2013-09-13 14:29:56 +02:00
Thibault Delavallée ed62d1dac7 [REF] mass_mailing: first refactor
Mail statistics are now stored onto a separated object (mail.mail.statistics), allowing to
handle emails separately from statistics (among other removing mail.mail entries while keeping
statistics).

Everything linnked to opened/replied/bounce is not managed by mass_mailing, removed added code
in mail module.

bzr revid: tde@openerp.com-20130913115408-322cyjipdg680as6
2013-09-13 13:54:08 +02:00
Thibault Delavallée ce8c987089 [IMP] mail, email_template, mass_mailing: improvev mass mailing management in mail.compose.message + form view cleanings + some fixes in mail_mail about set_opened/replied/bounced, now checking that ids effectively exist
bzr revid: tde@openerp.com-20130910151901-nhuwvtrkbwekyh7x
2013-09-10 17:19:01 +02:00