Commit Graph
356 Commits
Author SHA1 Message Date
Raphael Collet 214a59845f [MIG] base/tests
Convert YAML tests into Python tests:
 - translation tests moved to test_translate.py
 - test phases tests moved to test_phase.py
 - safe_eval tests moved to test_base.py
 - parent_store tests moved to test_base.py
 - float rounding tests moved to test_float.py
 - `ir.rule` tests moved to test_acl.py
 - search tests moved to test_expression.py
2016-05-11 11:40:25 +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
Raphael Collet 84cf3ceb44 [FIX] base_action_rule, mail, membership, point_of_sale: do not mix cache format with record format 2016-04-25 13:37:11 +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
Jigar Patel 253d4eccf0 [IMP] mail: Add counter in starred 2016-04-08 13:41:01 +02:00
Thibault Delavallée f4481ff74e [IMP] mail: gateway: CIDs
Finally add support of CIDs in incoming emails. Inline images are recognized
and added as attachments. Image links are updated from src=cid: to src=link
using the /web/image controller.

It has been decided to keep the image in atttachments instead of putting them
in base64, like proposed in various PRs. Indeed we prefer to store this data
into the attachments instead of directly putting it in the mail_message table.
Moreover this enable the display of attachments in the chatter and record views.
2016-03-03 15:56:09 +01:00
Thibault Delavallée cb8c2d2b7e [IMP] tools: sanitizer: quote detection
Quote detection is now done in the sanitizer itself. It tags nodes that are
inside quotes (signature, text quotes, email quotes). The purpose is to remove
html_email_clean and have all the html cleaning / sanitizing inside a single
function. When a node is tagged, data-o-mail-quote is set on the node.
This attribute is added in the whitelist of valid attributes for the
sanitizer.

[REM] Support of shortening messages. The read more / read less will only
display or hide detected quotes and signatures. Shortening messages above
a given amount of characters is not supported anymore. Indeed it adds much
complexity to the sanitizer without adding much value to the result. The
primary purpose of the sanitizer is indeed to remove noise and unnecessary
content.

[TESTS] a lot of test are not necessary anymore, as read more / read less
display will be moved in the front-end and as the shortening has been
removed.Tests have therefore been cleaned and simplified.

[DEMO] mail: small demo update to include a bit quote detection
2016-03-03 15:44:56 +01:00
Christophe Simonis 5f997bc4ef [MERGE] forward port of branch saas-7 up to 7fa6f73 2016-01-12 16:11:28 +01:00
Thibault Delavallée a69c2bab0a [FIX] mail, mail_channel: recipients of channels
Mailing lists (mail.channel) 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.channel
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.channel
encodes recipients using email_to instead of recipients_ids. This way
less processing is performed on notification emails.

This is a manual cherry-pick of commit d4a1eb4435
that was not forard ported. Mail has indeed evolved since 8.0 and its
forward port was not an easy task.

This commit also includes the fix of mail.channel recipients. All are now
considered as equal and receive a simple notification email. No distinction
is done between partners and users. The notification emails for channels
should be as simple as possible.
2016-01-08 16:40:40 +01:00
Christophe Simonis 99b6cd8119 [MERGE] forward port of branch saas-7 up to 2a834c2 2016-01-07 18:19:52 +01:00
Martin Trigaux 5ca043b86c [FIX] mail, purchase: forwardport
Missing parts, I only blame rerere
2016-01-06 08:11:45 +01:00
Martin Trigaux 8b4f052a38 [MERGE] Forwardport of branch saas-6 up to c649bb0df 2016-01-05 18:28:06 +01:00
Denis Ledoux aef8a4d618 [MERGE] forward port of branch 8.0 up to f9f7669 2015-12-21 18:24:22 +01:00
Thibault Delavallée 3f758e2fab [FIX] tools, mail: do not strip name from email_to
When sending a mail.mail with email_to, the processing split the email_to into
a list of addresses. However if the found addresses use the form name <email>
the name if lost in the process. A new email_split_and_format method is introduced
in tools and used to avoid loosing that information.
2015-12-11 11:22:40 +01:00
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
Yannick Tivisse 56cec604e6 [ADD] mail: Test on email template on scheduled dates 2015-11-24 18:50:27 +01:00
Nicolas Martinelli db68f9c4be [FIX] mail, project: define search method for message_is_follower
In order to be able to search on a non-stored computed field, a search
method must be defined.

This also reverts commit fd38fc0a02.

Fixes #8920
2015-10-13 10:15:21 +02:00
Christophe Matthieu 0300e0b7ba [FIX] mail: onchange_template_id return a valid command of commands
Use convert_to_cache and convert_to_read to format onchange values.
Fix: default value can be a command list, the onchange convert the comand list into a wrong comand list of command list.
2015-09-11 11:07:07 +02:00
Christophe Simonis 5e1eb5f34c [IMP] mail: avoid followers with dissociative identity disorder 2015-09-09 15:38:12 +02:00
Jérome Maes 7674536713 [IMP] mail : message_post_with_template helper
Create `message_post_with_template` helper method to factorize the simulation of a mail.compose.message wizard.

Also, fix the generated attachments of mail.compose.message wizard by returning ORM command (6, 0, ids) instead of the list of attachments ids. In order to standardize the behavior of the wizard, and since the ORM support command assignation in onchange api.v8, all the x2many fields of the wizard return a command.

FYI, that was tde's idea !
2015-09-04 15:55:38 +02:00
Jérome Maes f83f2d97d7 [FIX] mail: disable tests
mail.channel doesn't have the normal behavior of mail.thread,
but the test are based on mail.channel (which is thus a not so good idea).
res.partner is the other model available in mail module, implementing
 the correct behavior of mail.thread, but trigger AccessError. The tests
are commented from now, since TDE and I rewrite the test with a complete
 module dedicated to the test and implementing the expected behavior of a mail.thread.
2015-09-01 21:04:33 +02:00
Thibault Delavallée 01ab75f597 [IMP] mail: notification emails with button
Notification emails have been redesigned. They notably include buttons
allowing to perform some action directly from the email.

The notification creation and sending has been partially rewritten
and improved. The purpose is to lessen the number of rendering to perform
when sending emails to recipients. Recipients are first categorized into
groups. Basic groups are partners and users. The notification template
is then rendered twice, one for followers and one for not-followers. In most
cases there will be few rendering to perform. Through inheritance it
is possible to further categorize users. For example HR users / officers
that have approve / refuse buttons in their email.

A custom data structure is used to store data about buttons and actions.
URLs, follow / unfollow are added in the structure and used in the
template to render the email for a given group.

New routes are added in mail. Those allow to perform some action, like
going to a form in create mode, following / unfollowing, executing a method,
sending a signal for a workflow. Those routes are for users only and rely
on classic access rights.

A generic route for viewing records is added. It replaces the old redirect
action. According to some specific action given by the already-existing
get_access_action, the record will be visible for everybody (forum, blog)
or restricted (going on the Inbox / login / form view, according to access
rights).

The next commit will add the various inherits necessary to add the actions
in the main addons.
2015-08-28 17:30:42 +02:00
Christophe Matthieu 6baf611df1 [IMP] web: create generic controller '/web/content' and '/web/image'
Replace deprecate controllers like /web/binary/image, /web/binary/saveas...
Use ETag for all content with 'unique' option to cache the content if the content is never changed.
2015-08-21 22:06:52 +02:00
Thibault Delavallée 88b8cd0587 [REF] mail: model update for NewChatter
Main changes :
- mail.notification model is removed. People do not receive notifications
anymore. Instead two ways of following documents exist
  - using a channel; messages will be displayed on the channel itself
  in a near future commit
  - following with its partner; messages will all be considered as
  needaction, using a new m2m table. People should receive less
  needaction messages by following less records by themselves.
There is no more read / unread state anymore. Instead only needaction
messages are considered. Todo (Favorites) messages still exist, and are
stores on a new m2m table instead of using decorated notifciations.
- the main filter for documents is not message_unread anymore, but
message_needaction. A lot of views and filters have been updated
accordingly.
- the vote feature has been removed
2015-08-21 12:11:56 +02:00
Thibault Delavallée c02982b4c4 [REF] mail: mail_channel update
Some features from live_chat have been moved to the mail module :
- channels now have members, replacing followers;
- a decorated m2m is used to link channels and members. It stores the last
seen message on the channel for a specific partner;
- channels do not create menu entries anymore, because the
NewChatter will have its own display and use of channels;
- access rights have been updated accordingly, using members instead of
followers
2015-08-21 12:11:56 +02:00
Thibault Delavallée e6f038a821 [REF] mail: mail_thread: followers update
Followers can now be partners or channels. Partners following a document
will receive needaction, as previously. However people can follow documents
through channels. Members of a channel are able to listen to a stream
of messages using the channel. Those messages do not create needaction
messages. It is therefore possible to follow documents without receiving
too much notifications. For interesting documents subscribing with its
partner will create notification.

message_follower_ids fields is udpated. It is now a many2many to
mail.followers, not to res.partner anymore. A subscription can be either
a partner (partner_id) or a channel (channel_id).

Some access rules have been updated accordingly.
2015-08-21 12:11:56 +02:00
Christophe Simonis ea5ee871d4 [FIX] mail: adapt test introduced during previous forward-port 2015-07-28 15:08:54 +02:00
Christophe Simonis 97073e2a73 [MERGE] forward port of branch saas-6 up to 51040b6 2015-07-28 13:56:16 +02:00
Christophe Simonis 9d6786bc43 [MERGE] forward port of branch 8.0 up to 5e6ec89 2015-07-27 14:56:49 +02:00
Christophe Simonis 799fff6897 FIX] mail: ignore parent message for forwarded private messages. 2015-07-24 17:56:30 +02:00
Thibault Delavallée d52bf613d6 [CLEAN] mail: tests: reduce a bit the boilerplate of tests to lessen
the testing time.
2015-07-09 11:13:03 +02:00
Thibault Delavallée d931aa3825 [RENAME] mail, portal: updated actions and views xml ids
for channel-related stuff. mail.channel views as well as timeline views
and actions have been renamed. Now the names follow the guidelines and
will be used in the upcoming refactoring of mail and chat.
2015-07-09 11:13:02 +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
Thibault Delavallée 9bd8c00b01 [IMP] mail: moved methods called by mail_followers.js to controllers,
updated their code accordingly.

Subtype display in the follower widget has been improved: now displaying correctly
subtypes ordered by related model, then internal / not internal, then sequence.
2015-07-02 13:33:59 +02:00
Thibault Delavallée 9cd9aaaa17 [IMP] mail: new internal-only subtype feature.
Starting from now, subtypes can be internal. This means that only employees
(group_user members) can see the messages with this subtype. This feature
replaces and enhances the 'log a note = no subtype = internal only'
feature.

Public and portal users cannot see internal messages. This allows to have
subtypes and a follow mechanism that works for employees and is not
visible for external people.

Its first use will be for Crm Activities, allowing to have custom
subtypes visible only for salesman and not send to the customer.
2015-07-01 12:52:52 +02:00
Christophe Simonis b16fd16e90 [MERGE] forward port of branch 8.0 up to 7d01029 2015-06-30 15:29:03 +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
Christophe Simonis a304194936 [MERGE] forward port of branch saas-6 up to 81b5c60 2015-06-25 00:26:31 +02:00
Christophe Simonis 704a11ddee [MERGE] forward port of branch 8.0 up to b8bf1e0 2015-06-24 12:45:14 +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 4647778758 [MERGE] forward port of branch 8.0 up to ea59856 2015-06-15 12:28:32 +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
Valerie Pirenne c24332e6da [IMP][ADD] mail, various: timeline view.
This commit introduces a new view type, the timeline view. This view is
intended to display messages like the previous chatter. This is now a view
like the form or list view. Like other views it will be possible to have
custom templates for some specific needs, allowing customization.

[IMP] mail: the value tracking is modified. Previously messages were created
containing the modified values. Those values are now stored, using a new
model mail.tracking.value. The message body is dynamically build based on
the values. Tests have been updated.

This version is temporary. Indeed two main modifications will come in a short
future :

 - the new design will improve the display
 - the slack mode will change the way the Inbox and notifications are managed

All glory to the Hypnotoad.

Special thanks to Valerie Pirenne (vpi), Jerome Maes (jem) and Richat Mathot
(rim) that did not code but said a lot of things. Martin Trigaux (mat) did
nothing, a bit like for the slides modules, but he is busy sending emails.
2015-05-21 12:10:25 +02:00
Thibault Delavallée 63f435a1d0 [FIX] mail: mail_template: fixed create_action method that creates the
more menu action linked to an email template.

[TESTS] mail: added a test for this method.
2015-05-19 16:05:33 +02:00
Thibault Delavallée 9d3a5ec72a [IMP][FIX] mail: tests: updated mute loggers (moved files) + added loggers were necessary. 2015-05-19 16:05:32 +02:00