Commit Graph

297 Commits

Author SHA1 Message Date
Thibault Delavallée d4a1eb4435 [FIX] mail, mail_group: recipients of mail groups
Mailing lists (mail.group) should not send specific notification emails.
Indeed there can be a lot of recipients and customizing each email can
take time to compute. This leads to posting a message on a mail.group
being very slow.

It is now possible for a model to customize the notification email
recipients computation. The first use is to ensure that mail.group
encodes recipients using email_to instead of recipients_ids. This way
less processing is performed on notification emails.
2015-12-11 11:22:40 +01:00
Christophe Simonis 799fff6897 FIX] mail: ignore parent message for forwarded private messages. 2015-07-24 17:56:30 +02:00
Xavier Morel f5b88f6309 [IMP] minor perf improvement during tests
During tests, some creation of user records would unnecessarily trigger
password reset or set a password, both of which would trigger password
hashing which takes some time (for good reasons).

Fix by:
* passing no_reset_password in YAML tests and some Python tests still
  missing it (a number of Python tests already used it)
* removing passwords from YAML records as they're never necessary, the
  test user records are not expected to ever log in
2015-06-26 14:22:29 +02:00
Xavier Morel 11ba4689b1 [IMP] running speed of some tests & new testcase type
Some tests (e.g. mail) have expensive and significant DB setup for a
number of small and cheap tests. Using a TransactionCase, the DB setup
far dominates the tests themselves, by up to 10x (mail unit tests take
~130s on my machine, the tests themselves take ~15s).

The SavepointCase introduced here is an hybrid of SingleTransactionCase
and TransactionCase: it uses a single transaction for all tests in a
class, but each test case is isolated by a rollbacked savepoint. This
allows a common DB setup (via setUpClass) while keeping independent
tests.

TransactionCase should remain the primary test case superclass, but
SavepointCase can be a fair optimisation when setup costs far dominate.
2015-06-23 16:38:14 +02:00
Christophe Simonis 5e7f143c21 [MERGE] forward port of branch saas-3 up to ed76b2a 2015-06-11 13:00:49 +02:00
Christophe Simonis ed76b2a782 [MERGE] forward port of branch 7.0 up to e470385 2015-06-11 12:46:06 +02:00
Jean-Baptiste Quenot 3d35a5d42b [FIX] mail: Strip In-Reply-To header
For emails sent via Office 365, reply-to header could contains additional spaces
or get multiline header.
e.g.:
In-Reply-To:
	<4ba8f246904b4fedb49fbab7945a7f82@AM3PR06MB433.eurprd06.prod.outl$$k.com>

The message lookup fails if header is not stripped
2015-06-03 19:12:12 +02:00
Xavier Morel af90f5f638 [IMP] test experience and documentation
closes #3152
2015-01-15 15:23:08 +01:00
Denis Ledoux 87dd06c941 [MERGE] forward port of branch saas-3 up to 8c150c6 2015-01-15 14:43:32 +01:00
Xavier Morel 65cd4a2a33 [FIX] remove deprecated checks/fast_suite test attributes from standard modules 2015-01-15 14:31:40 +01:00
Denis Ledoux a692c6e934 [MERGE] forward port of branch 7.0 up to f406847 2015-01-15 11:49:28 +01:00
Olivier Dony 005e24fada [FIX] mail.thread: correct matching when finding author + test
The previous matching rules were too fuzzy and allowed random
prefix-match or tail-match of other user's emails.
For example when looking up a partner matching 'foo@bar.com'
the system would sometimes find 'dom.foo@bar.com' instead,
or 'foo@bar.com.tw'.

Fixed by only allowing direct case-insensitive email match
of an addr-spec, or substring match of the addr-spec enclosed
in angle brackets, within a name-addr pair.
See also RFC5322, section 3.4

Also adapted related message_find_partner_from_emails() method
to factor out the partner email resolution mechanism to avoid
the same problem.

Adds corresponding regression test.
2015-01-07 17:50:42 +01:00
Raphael Collet f2e4a10e1a [IMP] use model._fields instead of model._all_columns to cover all fields
The old-api model._all_columns contains information about model._columns and
inherited columns.  This dictionary is missing new-api computed non-stored
fields, and the new field objects provide a more readable api...

This commit contains the following changes:

 - adapt several methods of BaseModel to use fields instead of columns and
   _all_columns

 - copy all semantic-free attributes of related fields from their source

 - add attribute 'group_operator' on integer and float fields

 - base, base_action_rule, crm, edi, hr, mail, mass_mailing, pad,
   payment_acquirer, share, website, website_crm, website_mail: simply use
   _fields instead of _all_columns

 - base, decimal_precision, website: adapt qweb rendering methods to use fields
   instead of columns
2014-11-04 13:47:57 +01:00
Christophe Simonis 2e3f59181d [MERGE] forward port of branch saas-3 up to db75994 2014-10-14 15:13:14 +02:00
Olivier Dony edd94b623e [MERGE] Forward-port 7.0 up to 1b49a87 2014-10-10 19:21:18 +02:00
Martin Trigaux bd52298073 [IMP] mail: parsing emails with several html parts
If an email contains several text/html parts inside a multipart email, the previous code was only keeping the last content part.
The Content-Type: multipart/mixed allows several independent part (RFC1341 7.2.2), so two html is technically valid.
With this patch, the two parts are concatenated. (opw 614755)

Modify append_content_to_html regex to make sure the regex keeps the content of the html instead of removing it.
e.g.: "123 <html> 456 </html> 789" used to be stripped to "123  789" while we expect "123 456 789"
2014-10-09 13:53:23 +02:00
Olivier Dony e11eddf753 [MERGE] Forward-port of saas-5 up to 20cc18d 2014-08-13 20:46:47 +02:00
Denis Ledoux fe83c11301 [MERGE] forward port of branch saas-4 up to b49755b
The forward port of the fix 3609ba10f2 will be done separately, as the mrp scheduler has been completely refactored from saas-5.

Conflicts:
	addons/l10n_be_coda/wizard/account_coda_import.py
	addons/point_of_sale/static/src/xml/pos.xml
	addons/procurement/schedulers.py
2014-08-13 10:45:36 +02:00
Denis Ledoux fc74431c1a [MERGE] forward port of branch saas-4 up to 7ecaab9 2014-08-12 16:27:57 +02:00
Denis Ledoux 7b0eb9b1a8 [FIX] mail: forward-port of rev 245bb4ebdf 2014-08-12 15:16:49 +02:00
Denis Ledoux 2c9a116c74 [MERGE] forward port of branch 7.0 up to 245bb4e 2014-08-12 14:16:35 +02:00
Denis Ledoux 245bb4ebdf [FIX] mail: to/from/reply-to addresses formated according to RFC2822
Use formataddr method from email.utils lib, which do the job correctly
2014-08-12 13:40:45 +02:00
Thibault Delavallée c64b077362 [FIX] mail: fixed bounce email recognition + invite email headers + mass mailing statistics not lost anymore
- [FIX] bounce regex: too many emails were considered as bounce and therefore
not displayed in the chatter and lost for the communication history. The regex
was not correctly looking for the bounce alias in the email_to.
- [FIX] invite email: replying to the invitation email (invitation as new
follower) now replies to the user sending the invitation.
- [FIX] mass_mailing: added a column to store the id of the original email
in addition to the many2one column. The many2one is set to null when deleting
the original email. As the information is necessary, it is saved on another
field. The many2one is necessary for indexes purpose as the inverse of
a one2many.
2014-08-11 15:39:26 +02:00
Thibault Delavallée 7f0353974d [REF] mail: same_thread field changed into no_auto_thread, its contrary, to avoid migration issues (adding a 'always False' column is easier than an 'always True'). 2014-08-04 14:46:47 +02:00
Olivier Dony ef53a831c6 [MERGE] Forward-port saas-5 up to a5f7891 2014-07-23 16:58:00 +02:00
Denis Ledoux a5f7891b68 [MERGE] forward port of branch saas-4 up to 5739aebfb1 2014-07-23 13:18:30 +02:00
Olivier Dony 6ac1deccf6 [FIX] mail, website_mail: specific mailing-list footer + better unsubscribe option
- remove the default footer for mail.group messages,
  replace with specific footer with archive and unsubscribe
  link
- remove the automatic addition of user signature in
  mail.group messages, as many of them will be posted
  via the mail gateway and already contain a user signature.
- make it easier to unsubscribe even when not logged in,
  as followers who have not signed up will have no
  way to login short of signing up.
- remove tests looking for user signature in mail.group posts
2014-07-16 23:21:30 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Amit Vora b592f9e13a [MERGE][IMP] Enable HTML in emails signature
Closes #801
2014-06-27 11:31:24 +02:00
Thibault Delavallée 719a4f02c9 [REF] mail, crm, hr_recruitment, project, project_issue: simplified reply-to of notification emails (now displaying 'YourCompany -docname- <email>' instead of 'Followers of ...'; added same_thread directly on the mail.message model to ease the reply_to and message-id computation; factorized a bit the reply-to generation for a batch of records; udpated tests accordingly. 2014-06-23 10:47:47 +02:00
Amit Vora e6f8666b52 [MERGE] [IMP] mail: Inbox usability improvements :
- notficiation_email_send field, renamed into notify_email, has now 2 values: always or never, in
order to ease the choice and simplify options.
- inbox: removed 'compose a new messages or write to my followers', because those 2 options are
already available. The first one is accessible using the top-right email icon, the second one
is accessible with the 'write to my followers' text box alread present in the inbox.

bzr revid: tde@openerp.com-20140417094133-8ip7vuy6b30xlc32
2014-04-17 11:41:33 +02:00
Thibault Delavallée fe8a745b02 [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20140416082925-eph1x8vnwj6o31rt
2014-04-16 10:29:25 +02:00
Olivier Dony fb19b54ff9 [MERGE] Forward-port of 7.0 bugfixes up to rev 9976 rev-id: odo@openerp.com-20140411142429-y0rpkzqbrsabxqsg
bzr revid: odo@openerp.com-20140411142800-t8sbcmfkj3qgmrh3
2014-04-11 16:28:00 +02:00
Olivier Dony 9861b5cada [FIX] mail.thread: avoid overwriting thread_id/model with foreign values when reply-to hostname does not match + fix tests
This improve previous commit by making sure we
never consider the thread_id/model values in the
In-Reply-To/References header if the host name
did not match.
Also fixes the tests that were using the
6.1 compatibility mode to post in a mail group
thread instead of specifying the right
message-id.

bzr revid: odo@openerp.com-20140411142429-y0rpkzqbrsabxqsg
2014-04-11 16:24:29 +02:00
Amit Vora cfbd8ae9f8 [IMP] change field name notificatio_email_send to notify_email and none selection key instead of never
bzr revid: avo@tinyerp.com-20140409101604-1l8ltrcpjps8pazi
2014-04-09 15:46:04 +05:30
Thibault Delavallée dc33134b02 [FIX] mail: fixed a test using a field tha does not exist anymore
bzr revid: tde@openerp.com-20140321171514-fp1amjhmn63vr0qg
2014-03-21 18:15:14 +01:00
Chirag Dodiya (OpenERP) fa30038c2c [MRG]Merge with lp:openobject-addons
bzr revid: cod@tinyerp.com-20140321050817-31v8k14za5w60pjh
2014-03-21 10:38:17 +05:30
Thibault Delavallée 48deceb6c6 [IMP] [REF] mail_compose_message: slightly cleaned wizard code to lessen the number of corner cases and
to remove unnecessary code.
post and filter_id fields have been removed as they are not necessary.
Updated tests accordingly to new mass mailing tests: mass mailing create
emails, no message_post anymore using followers.

bzr revid: tde@openerp.com-20140317115315-ws8dvjbiv5rspk43
2014-03-17 12:53:15 +01:00
Thibault Delavallée 4b5b4e86d7 [REM] mail_message: removed dead code: quote context is not planned
to be used anymore.

bzr revid: tde@openerp.com-20140314171213-0v3t7c1akbviu99e
2014-03-14 18:12:13 +01:00
Atul Patel (OpenERP) 33b99c8a07 [MERGE]: Merged with addons
bzr revid: atp@tinyerp.com-20140218055618-r36w29vat7zig9ar
2014-02-18 11:26:18 +05:30
Olivier Dony 0227d6a056 [FIX] mail: adapt `assertRaises` test after corresponding code change in last forward-port
bzr revid: odo@openerp.com-20140217095143-ibhqyzflle2hbimy
2014-02-17 10:51:43 +01:00
Olivier Dony 76d89c0477 [MERGE] Forward-port of latest saas-2 bugfixes, up to rev. 9133 dle@openerp.com-20140214131810-9abebxpfeoga1crn
bzr revid: odo@openerp.com-20140217091203-kmeg4qsn2qyvll23
2014-02-17 10:12:03 +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 e09f5cd264 [FIX] mail: fixed tests, no more assertionerror, but valueerror
bzr revid: tde@openerp.com-20140212153141-ajwmd26of69tfoer
2014-02-12 16:31:41 +01:00
Mahendra Barad caa3510ea4 [IMP] Mail Improvements
bzr revid: kjo@tinyerp.com-20131218131805-e97d5tmq2tr6pvh2
2013-12-18 18:48:05 +05:30
Thibault Delavallée d9343e2d27 [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20131213094016-ylqkilyo4190g81w
2013-12-13 10:40:16 +01:00
Thibault Delavallée 89bc58bae6 [TESTS] mail: mute logger back in mail tests
bzr revid: tde@openerp.com-20131209160923-3yisgzqmns6pviud
2013-12-09 17:09:23 +01:00
Thibault Delavallée d10f471019 [FIX] [TESTS] mail, portal: fixed tests, because the error raised by the OROM has changed in some cases.
bzr revid: tde@openerp.com-20131206121432-mz2jpj535tmcmftl
2013-12-06 13:14:32 +01:00
Thibault Delavallée 1037874e15 [CLEAN] mail: removed modifications that have nothing to do with website in mail.js + typo introduced in a test file
bzr revid: tde@openerp.com-20131206101716-08q6f4ufhj50e239
2013-12-06 11:17:16 +01:00
Christophe Matthieu fd2821086f [MERGE] sync with trunk
bzr revid: chm@openerp.com-20131202150925-eqsi0uu0fqtwimhj
2013-12-02 16:09:25 +01:00