summaryrefslogtreecommitdiff
path: root/addons/mail/tests/test_mail_features.py
AgeCommit message (Collapse)Author
2017-11-29[MOV] mail: reorganize content of tests, separate tests from models and dataThibault Delavallée
Purpose of this commit is to reorganize the mail tests. Containing * move test models into mail/tests/models/; * move data into mail/tests/data even if it is python code, as it is likely that some additional data will appear soon; * split test_mail_features into test for discuss app and test related to message post and composer, to better identify test target; * split and remove test_portal, those tests are now integrated in the other tests; There is no change in this commit. Only some renaming and file move or split. mergeup: remove / split test portal
2017-08-20[FIX] P3: text model in various mail bitsXavier Morel
No formal decision there, and the stdlib API seems like a PITA as it's based around native strings, not bytes and not text. * try to use cross-model API instead of random encode/decode * unicode all the mail_template things * formataddr *requires* a text tuple now In P2, formataddr((False, False)) "worked" (generated "False <False>"), in P3 it will fail and blow up. * attachments are quite definitely bytes * remove try_coerce_ascii because it's garbage
2017-08-20[FIX] P3: fix base64 and StringIO usesXavier Morel
* StringIO removed from stdlib, replace with io * try to correctly handle BytesIO/StringIO (one is for bytes the other is for text) * fix base64: Python 3 removed bytes-encoding and bytes-bytes codecs (via #encode) so replace all calls to str.encode('base64'), also b64encode is a bytes->bytes conversion so attempt to properly handle that issue #8530
2017-02-21[IMP] mail: improve notification management, either email either inboxAline Preillon
Currently partners have a boolean field to choose whether to receive notifications only in their Odoo inbox or to receive them in their inbox and by email. This leads to several issues : * if a customer is configured to not receive emails he will not receive any notification on sales orders, leads, ... This is not clearly indicated to the salesman and it is not easy to know how to change that behavior * if an user chooses to receive emails and does not use its inbox a lot of notifications stay in Odoo. The user has to manually set them as done to make them disappear which is redundant. This commit changes that behavior. From now on customers will always receive all notifications by email. Indeed Odoo is not a customer oriented mailbox. Moreover sales orders or discussions on leads send to customers should always be sent by email as it is the standard communication mechanism. Users will be able to choose to receive notifications in Odoo or by email. The choice is no longer inbox or inbox + email, but inbox or email. Choosing one option or the other one depends on the way the user wants to work. Technically the field is moved on the users model and selection keys are renamed. Notification process is modified * notified_partner_ids contains as before specified recipients as well as followers matching the subtype * customers and users working with emails are notified. During that process customers notifications are marked as done to be able to track the email state without having needaction. Users notifications are currently deleted as we do not track their email state. The removal of partner field implies changes in various addons that define partner data with this field set in the values.
2017-02-21[IMP] mail: small code linting in notification methodsThibault Delavallée
This commit cleans code to separate recipients computation in mail message from notification mechanism in partner. There is no functional change. Some variables have been renamed notably to know that some of the record sets are sudoed during computation.
2017-02-21[IMP] mail: make tests less dependent on mail.channel modelThibault Delavallée
Currently almost all mail tests run on mail.channel model. Indeed it is the only model inheriting from mail.thread and mail.alias when having only mail installed. However channel model have several specific features and is not totally a standard mail.thread model. For example notification recipients are computed a bit differently. Since 4f9105a4ef40bccd3b27a6a10cc612636a6499f7 mail module has a test model allowing to perform tests on a very simple mail.thread-like model. This commit make mail tests use this test model instead of mail.channel everywhere it is possible. Channel model should be used only when tests are channel-dependent.
2017-02-21[IMP] mail: notify author of internal notes when replied through gatewayThibault Delavallée
Currently if an user mentions someone in an internal note he is not notified of any reply as replies create internal notes. This commit ensure the author of the first note is notified of the reply even if it is still an internal note. Tests have been updated accordingly.
2017-02-21[IMP] mail: add tests about replies to internal note through mailgatewayThibault Delavallée
Replying to internal notes should create internal notes and should not notify anyone. Future commit will change that behavior. This commit ensure the current behavior is working as intended.
2017-01-23[MERGE] forward port branch 10.0 up to 6804085b8ceChristophe Simonis
2017-01-17[MERGE] forward port branch saas-11 up to a0aca47feffChristophe Simonis
2017-01-17[MERGE] forward port branch saas-6 up to 7cb977fc3c2Christophe Simonis
2017-01-16[MERGE] forward port branch 8.0 up to 082495240f5Christophe Simonis
2017-01-12[FIX] mail, purchase: avoid full cache invalidation when possible (#14934)Raphael Collet
* [FIX] mail: avoid full cache invalidation when possible * [FIX] purchase: avoid full cache invalidation when possible
2016-12-05[REM] *: remove ir.needaction mixinJérome Maes
ir.needaction_mixin is not used anymore by the webclient. From 9.0, the concept has changed: this feature is now available in mail module, with the mail.thread mixin, and message_neeadction field. Remove all code handeling needaction bullet and counter on ir.ui.menu, knowing that since 9.0 webclient does not display the counter anymore. This code was, thus, useless and some RPC calls were done for nothing, and adapt accounting reconcialiation widget.
2016-11-23[IMP] mail: composer in mass mail mode does not use search domain by defaultThibault Delavallée
It now uses active_ids (checked records) by default. Composer allows you to change and use active_domain (search criterion) instead.
2016-09-02[FIX] adapt logger namesRaphael Collet
2016-09-01[REF] mail: remove required alias on usersThibault Delavallée
This commit remove required alias on res.users model. It also removes the inheritance of mail.alias.mixin. The field alias_id is kept and allow people to use aliases on users if they want. However there is no default void alias created for each user anymore. Default from of mail.message does not use user alias anymore. Indeed this creates issues with aliases not being correctly configured and can be confusing compared to private channels. Using user aliases is therefore now done manually instead of being a default behavior.
2016-08-10[IMP] various: use odoo for imports instead of openerp and update class namesThibault Delavallée
2015-09-01[FIX] mail: disable testsJérome Maes
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-08-28[IMP] mail: notification emails with buttonThibault Delavallée
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-21[REF] mail: model update for NewChatterThibault Delavallée
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[REF] mail: mail_thread: followers updateThibault Delavallée
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-07-09[CLEAN] mail: tests: reduce a bit the boilerplate of tests to lessenThibault Delavallée
the testing time.
2015-07-09[RENAME] mail, portal: updated actions and views xml idsThibault Delavallée
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[RENAME] mail, website_mail, website_mail_group, various: mail.groupThibault Delavallée
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-06-25[MERGE] forward port of branch saas-6 up to 81b5c60Christophe Simonis
2015-06-24[MERGE] forward port of branch 8.0 up to b8bf1e0Christophe Simonis
2015-06-23[IMP] running speed of some tests & new testcase typeXavier Morel
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-05-21[IMP][ADD] mail, various: timeline view.Valerie Pirenne
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-19[IMP][FIX] mail: tests: updated mute loggers (moved files) + added loggers ↵Thibault Delavallée
were necessary.
2015-04-27[MIGR] mail: migration to the new APIThibault Delavallée
2015-03-24[REF] mail: migrated tests to the new API and refactored them.Jignesh Rathod
Tests have been migrated to the new api to prepare the migration of the mail module itself. Moreover tests have been cleaned: redundant tests and unnecessary tests have been removed. As the base test class in mail is used in other addons, other addons have been updated : - portal - project - portal_project - website_project_issue - sale - purchase Future commits will come with somes fixes for issues detected when cleaning the tests.
2015-02-24[REF] mail: _track update.Thibault Delavallée
_track is now a method that returns the subtype to trigger in a given tracking context. A tracking will now lead to only one subtype being trigerred, instead of having multiple possible subtypes. Now, one tracking leads to one message with one subtype, or without subtype if there is none matching. This simplifies the model for future evolution of chatter and mail. [IMP] project, project_issue: cleaned task and issue subtypes, now having opened for created / assigned.
2015-01-07[IMP] Mass mailings send in cronJulien De Coster
1. The merge of the "email_template" module into the "mail" module. 2. The send action of the mass mailing has been moved from the frontend to a cron, because it was too slow to send over 10,000 mails (the user's browser was blocked for 15 - 20 minutes). Mass mailings have now their own process in the kanban view. 3. Mails sent from the mail form are sent immediatly instead of from the mail queue (for instance, when you go to sales > customers > list view > select 2 -3 customers > More > Partner Mass Mailing). 4. Users have now the choice from which mailing list they want to unsubscribe when they click on the unsubscribe link at the bottom of the mail. 5. Mass mailings inherit from their campaign UTMs and mass mailing campaigns are linked to an UTM campaign. 6. Many little improvements
2014-11-05[MERGE] forward port of branch 8.0 up to 491372eChristophe Simonis
2014-11-04[IMP] use model._fields instead of model._all_columns to cover all fieldsRaphael Collet
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-09-05[MERGE] forward port of branch 8.0 up to ed1c173Christophe Simonis
2014-08-22[IMP] Use radio widget in various viewsssh-odoo
+ some UI messages improvements (Closes #1913)
2014-08-13[MERGE] Forward-port of saas-5 up to 20cc18dOlivier Dony
2014-08-13[MERGE] forward port of branch saas-4 up to b49755bDenis Ledoux
The forward port of the fix 3609ba10f2d00a608d8f32334ae1b9a25b34f037 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-12[MERGE] forward port of branch saas-4 up to 7ecaab9Denis Ledoux
2014-08-12[MERGE] forward port of branch 7.0 up to 245bb4eDenis Ledoux
2014-08-12[FIX] mail: to/from/reply-to addresses formated according to RFC2822Denis Ledoux
Use formataddr method from email.utils lib, which do the job correctly
2014-07-30[MERGE] forward port of branch 8.0 up to fd4fd35Christophe Simonis
2014-07-23[MERGE] Forward-port saas-5 up to a5f7891Olivier Dony
2014-07-23[MERGE] forward port of branch saas-4 up to ↵Denis Ledoux
5739aebfb1711bb94c2f94bfb03ec12f17e9430d
2014-07-16[FIX] mail, website_mail: specific mailing-list footer + better unsubscribe ↵Olivier Dony
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-08[IMP ]add failure_reason field and counting number of fail mailAmit Vora
[IMP] improve help and change field name fail_mail to fail_counter and change method name of counting fail mail
2014-07-06[MERGE] new v8 api by rcoRaphael Collet
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-06-27[MERGE][IMP] Enable HTML in emails signatureAmit Vora
Closes #801