summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_tracking_value.py
AgeCommit message (Collapse)Author
2019-04-17[IMP] mail: Rename groups field of mail.tracking.valueLucas Lefèvre
This commit renames the `groups` field into `field_groups`. The previous name was impossible to grep as the word `groups` is everywhere in the code base. Also the new name better follows the implicit convention that fields related to the tracked field all start with `field_`.
2019-04-17[IMP] mail: Delete tracking values when uninstalling moduleLucas Lefèvre
Purpose ======= mail.tracking.values should be deleted when the corresponding field is deleted (when the module which defined it is uninstalled). Firstly because we don't want useless data in db. Secondly because the groups associated with the field can no longer be checked if it was deleted. As we don't know to whom the value was restricted, the value should not be displayed anyway. Note: this case was fixed in saas-12.2 by b9e96b7 but the proper way to fix it is to delete the tracking values. Specification ============= Delete `mail.tracking.value` when the associated `ir.model.fields` is deleted. Two alternatives were considered: 1. Change the `field` field of `mail.tracking.value` from Char to a m2o to `ir.model.fields` which allows to use delete oncascade. This implies to modify existing code, but more importantly it adds database queries. 2. Override the unlink method of `ir.model.fields` to first unlink associated tracking values. The first method is probably cleaner but the second method was nonetheless chosen as we don't want to impact performance in the main tracking flow only to better support module uninstalls which happens rarely. Note: when a module is uninstalled, `ir.model.fields` are unlinked one by one (in a for loop). Tracking values are therefore also unlinked field by field. Batchifying field deletion would greatly reduce the amount of queries.
2019-03-05[FIX] mail: Check field exists when computing groupsLucas Lefèvre
Steps to reproduce: 1. install `hr_contract_salary` 2. create a contract 3. set or update `hr_responsible_id` on the contract (it creates a `mail.tracking.value`) 4. uninstall `hr_contract_salary` 5. go to the contract form view => traceback `hr_responsible_id` does not exist Before displaying a `mail.tracking.value`, `groups` of the fields are checked to fitler tracking values according to access rights of the user. However if the module that added the field has been uninstalled, the field does not exists anymore. Fix: check if field exists before getting fields groups. If the field does not exists: set groups to `base.group_system` closes odoo/odoo#31398 Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
2019-02-13[IMP] mail: allow tracking on groups protected fieldsLucas Lefèvre
Purpose ======= Currently fields with a `groups` attribute can't be tracked. Otherwise changes would be visible by all in the chatter, including users which normally don't have the access rights because they are not members of `groups`. Specification ============= Filter tracking field values according to the `groups` attributes. Users without the access rights should not see them. If a message is only composed of tracking values and the user doesn't have the rights to see them, an empty message should not be displayed.
2019-01-04[REF] mail: rename and merge tracking-related parametersThibault Delavallée
Track_visibility field parameter allows to track field changes in mail. Since commit https://github.com/odoo/odoo/commit/c99de4551583e801ecc6669ac456c4f7e2eef1da only updated values are tracked. Previously to that commit it was possible to have field values being tracked whenever any other change occurred. This feature has been removed to simplify tracking and avoid having unnecessary values in the tracking table. In this commit we rename the track_visibility parameter to tracking. Old parameter value is still supported in mail for backward compatibility. Commit https://github.com/odoo/odoo/commit/ec35eca7c6b772139c8fa143b388ad1d936bc9ea added sequence on tracking so that display of tracking values is coherent through various chatter messages. To ease tracking configuration it is merged with the tracking (old track_visibility) parameter. It means tracking parameter can either be True (default sequence of 100) or an integer giving the sequence to apply on the tracking. Purpose of those changes is to simplify tracking configuration with studio in mind. That way changing one parameter allow to customize the tracking of fields in chatter. Sequence field on mail.tracking.value model is renamed to tracking_sequence to have a coherent namespace for tracking information. Tracking information on ir.model.fields is also updated accordingly. To simplify manipulation boolean value for tracking is automatically transformed into a sequence of 100. This commit is linked to task ID 1903814 and PR #28430.
2018-11-02[MERGE] forward port branch saas-11.4 up to f6ca72b3ce9Christophe Simonis
2018-10-24[FIX] mail: set default _rec_name to avoid showing model with idYenthe V.G
closes odoo/odoo#27186
2018-10-22[MERGE] forward port branch saas-11.4 up to 3c108977c1eChristophe Simonis
2018-10-08[MERGE] forward port branch saas-14 up to 637e4c68fc0Christophe Simonis
2018-10-08[FIX] mail: sudo on user namelen-odoo
Suppose user A creates a sale order S in company X. He then changes to company Y Sales manager B, in company X, creates the invoice for sale order S. Bug: the compilation of the report fails because of the user.name in the template. Then the tracking update fails, making it impossible to validate the invoice. opw 1884915
2018-08-06[REF] *: use native date/datetime for Date/Datetime fieldsRaphael Collet
From this commit onwards, Date fields will return datetime.date objects and Datetime fields will return datetime.datetime objects, this implies a number of things that are clearly explained both in the ORM API for master. This commit also introduces a number of helper functions for dates and datetimes that are exposed in tools.date_utils and fields.Date[time], explained in the documentation as well. Task-ID: 47189
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
2017-06-19[FIX] mail: add TZ to datetime trackingNicolas Martinelli
Add the TZ to the datetime tracking. At the moment, the TZ is fixed: it is UTC. However, this avoids any ambiguity when the tracking message is sent by mail, since in this case, the datetime is not converted automatically to the TZ of the user. Adding a simple 'Z' makes the datetime compliant with ISO 8601, so it is supported by the web client as well. opw-747367
2016-09-30[FIX][IMP] mail: make tracking great againThibault Delavallée
When changing tracking mecanism in v9 'always' tracked fields lost their meaning. They were managed like 'onchange' fields. This commit sets the old behavior back. * 'onchange' fields are displayed in tracking every time they change * 'always' fields are displayed in tracking every time they change or whenever other tracking exist; those are used to display some contextual information
2016-08-20[MERGE] forward port branch saas-12 up to 9ad5f26Christophe Simonis
2016-08-20[MERGE] forward port branch saas-11 up to 3a2147dChristophe Simonis
2016-08-10[IMP] various: use odoo for imports instead of openerp and update class namesThibault Delavallée
2016-08-09[FIX] various: fix fields index parameter in new API still called selectThibault Delavallée
2016-06-08[REF] mail: avoid duplicated code for old and new value.Jeremy Kersten
2015-09-10[FIX] mail: empty notes and field monetaryNicolas Martinelli
We prevent the creation of empty notes and add the field monetary in the list of accepted fields.
2015-06-04[FIX] mail: date fields trackingJulien Legros
2015-05-28[FIX] mail: typos in tracking valueThibault Delavallée
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.