summaryrefslogtreecommitdiff
path: root/addons/test_mail/models/test_mail_models.py
AgeCommit message (Collapse)Author
2019-03-29[IMP] mail, *: don't track fields at createXavierDo
*: project, crm, maintenance, helpdesk, It is useless to track fields during create since they have no initial value and future tracking message will show changes on tracked field. We can log a default creation message instead (as it is now if there is no mail_create_nolog context key) This change will implies - less queries when creating record - cleaner creation messages - less occurence of mail_create_nolog ctx key Removing tracking at create could break the creation subtypes mechanism (example: following task creation subtype on project) Instead of using _track_subtype to give a subtype at create, a new _creation_subtype method can be override. If a creation subtype is set on a specific modlel, creation messages will be create by message_post instead of _message_log. We also need to adapt the message_track_post_template in order to keep this feature whithout tracking. Task: #1916916 closes odoo/odoo#31945 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-28[IMP] mail, test_mail, *: add new email.cc.mixin on main modelsXavierDo
*: crm, project, maintenance, hr_recruitment When a record is created from an email, cc can be lost. This commit proposes a new mixin to keep cc on the record and allows to create partner for each of them when sending a message from the chatter. The mixin is added on the mail recors that can be created from mail.alias: document helpdesk.ticket mrp.eco quality.alert hr.applicant crm.lead project.task mail.channel maintenance.equipment Task: 1925001
2019-02-11[MERGE] forward port branch saas-12.1 up to 93d736e905eChristophe Simonis
2019-02-07[MERGE] forward port branch 12.0 up to a46138cb019Christophe Simonis
2019-02-06[FIX] mail: create partner from template in right companyLucas Perais (lpe)
Before this commit, when creating a partner automatically when creating a message with a template, the company on the partner was wrongly set After this commit, we try to retrieve the company from the model on the template OPW 1934392 closes odoo/odoo#30893
2019-01-04[REF] various: update tracking parametersThibault Delavallée
Purpose is to clean the use of tracking parameters on fields. Parameters are merged and is now tracking=<int> or tracking=True. This commit is linked to task ID 1903814 and PR #28430.
2018-10-18[IMP] mail: Return a browse record in _track_subtype instead of xmlidTWA
Purpose ======= It's possible to gain some requests with returning a browse record instead of an xmlid. It's also cleaner.
2018-09-21[IMP]various: Improvement in model descriptionNimesh Jethva
Purpose of this commit is to give description more "business oriented" because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers. Related Task ID : 37311
2018-08-21[IMP] core, test_mail: improve query count assertionsXavierDo
-remove margin With the spirit of making tests determinists, we can remove margins to have a real test of query count. -mock random on assert query count bus gc is triggered using random. Therefore, when send_many is called, we have 1% chance to have more query. Mocking random.random to 1 will disable gc during query count tests (not during warmup). Could be interresting to put gc collection in a cron latter -add more info on querycount Adding file and line number on query count failure/info will help to update the query counts. -update query count based on enterprise Update all query count with enterprise values (exactly) -normalize query counts with enterprise voip module add a read on activity type (during create) in enterprise, leading to one more query but also more information in cache. Therefore, the next assertion will need one more query to access this data in community. Adding an access to activity type in the first assertion will allow to have the same cache state in community and enterprise. Task: #1878588 PR: #26476
2018-08-01[IMP] test_mail: add an active field on activity test modelThibault Delavallée
It will allow to test behavior of activities with archived records in mind.
2018-07-25[IMP] mail : Add possiblities to sequence tracking fields in the chatterlejeune quentin
Fields in the chatter can be organized with a business logic. Here fields for CRM and Website E-commerce have a tracking sequence. For other fields/module just add "track_sequence=x" on model
2018-03-27[IMP] mail: add tool methods to manage activities directly from the mixinThibault Delavallée
This commit adds tools methods related to activities in the mail.activity mixin. It gives to models inheriting from the activity mixin an easy-to-use API to schedule, unlink or mark activities as done. Purpose of those methods is to avoid having people manually managing activities in the code to hide the technical details of the activities model, notably access rights or activity types. A field is added on activity model to indicate they have been generated automatically. This way when rescheduling or unlinking based on some specific activity types we do not change user-created activities. Those methods include scheduling activities, changing their dates, marking them as done or unlinking them. Future commits will use those methods in various addons to automatically generate activities based on workflow we want to implement. This commit also adds tests for the newly added code. Future commits should probably have a look at activity security and add some tests cases to check it is correctly taken into account. It is considered a bit out of scope for this task. Thanks to @jem-odoo for its in-depth review of this commit. Well thanks for other commits also.
2017-12-12[IMP] test_mail: move some data into demo and update tests accordinglyThibault Delavallée
Creating data directly in tests was done when tests were located in mail module to avoid creating real data or demo. Now that mail tests have their own module we can create demo data and use them in tests. It is simpler to have demo data for things like subtype and email templates to ease understanding and reuse.
2017-11-29[MOV] (test_)mail: move tests into their dedicated moduleThibault Delavallée
Purpose: avoid having useless tables for test models in a production environment.
2017-11-29[SPLIT] test_performance: split between base and mail performance testsThibault Delavallée
Test performance will now hold the base class for performance tests as well as tests related to the ORM, depending only on base. A new module test_mail is introduced at this commit that contains performance tests related to mail module. This commit contains only code move and should not impact anything. Future commits will move mail tests into test_mail so that all mail related tests are located in the same optional module. This allows notably to avoid creating a lot of unnecessary tables when installing mail module on production databases.