summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_thread.py
AgeCommit message (Collapse)Author
2019-04-10[MERGE] forward port branch saas-12.2 up to 2694174b410Christophe Simonis
2019-04-09[MERGE] forward port branch saas-12.1 up to 6d4940675f1Christophe Simonis
2019-04-09[MERGE] forward port branch 12.0 up to ea1fc124efcChristophe Simonis
2019-04-05[FIX] mail: only display errors linked to message of current userJorge Pinna Puissant
fine-tuning commit 1120bffb66000649cdfd4dbb4d63faa1b9f23835 Before this commit, the search on message_has_error (used when clicking on a failure notification) only display errors linked to message of the current user. Also, the filter Has_error is true, in the messages view in technical menu only display the message with errors of current user. Now, the filter Has_error is true display the message with errors of all users. The search on message_has_error behave as before. opw-1958813 closes odoo/odoo#32462 Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-03-14[MERGE] forward port branch 12.0 up to a26496b6e79Christophe Simonis
2019-03-14[FIX] mail: set message_main_attachment_id to copy=FalseNans Lefebvre
Create a record. Add an attachment set as message_main_attachment_id (e.g. through log note). Duplicate that record. The new record has the message_main_attachment_id of the old record, while it has no attachments. Since attachments security is linked to the record id, we shall not copy them. opw 1950403 closes odoo/odoo#31846 Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-14[MERGE] forward port branch saas-12.1 up to ff1bca32f3aChristophe Simonis
2019-02-22[MERGE] forward port branch saas-12.1 up to 0f4abc5c228Christophe Simonis
2019-02-21[MERGE] forward port branch 12.0 up to 84143a34b31Christophe Simonis
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-29[IMP] base: Remove useless ACL rulesYannick Tivisse
Now that portal users don't have access to the backend, it doesn't make sense to give the read access on attachments, as this is the role of the specific controllers to provide this access according to the business logic. For the record, these rules have been introduced at: https://github.com/odoo/odoo/commit/61065b6d04248aa496765e1035c4c90cbdc38de7 https://github.com/odoo/odoo/commit/f3fa266d115ac9d4723164af10f8dee40821b290 closes odoo/odoo#32134 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-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[MERGE] forward port branch saas-11.3 up to 0c42a607eceChristophe Simonis
2019-02-05[MERGE] forward port branch 11.0 up to e0b14bf9a7aChristophe Simonis
2019-02-15[FIX] mail: non translated field when posting emails from cronsJulien (juc) Castiaux
1) Configure both an incoming mail server and an outgoing one. 2) Install CRM. 3) Create a sale team, use the incoming mail address as mail alias. 4) Add a user with a valid email as follower of that team in the chatter. 5) Enable developer mode, become super user via the developer tools. 6) Change the language of the super user to french. 7) You may want to modify the default gather/post time interval. to receive/post email more regulary in the scheduled action. 8) Using an external mail client, send a mail to the incoming mail address. 9) Let the two scheduled actions run by themselves. 10) The mail sent to the user has the "Lead/Opportunity" in english wheras the rest of the email is in french. opw-1917993 closes odoo/odoo#31034
2019-02-04[FIX] doc: specify correct field name in mailObay Abdelgadir
closes odoo/odoo#30718
2019-01-31[MERGE] forward port branch 12.0 up to cb8fefa8999Christophe Simonis
2019-02-04[MERGE] forward port branch saas-12.1 up to 4524ad06a8aChristophe Simonis
2019-01-30[FIX] mail: Force the writing of the attachment when the user can postJulien (juc) Castiaux
To reproduce: 1) Enable multi-company 2) Create two companies: c1, c2 3) Create two users: bob in c1 and alice in c2 4) Install subscription 5) Remove the ir.rule that forbid users from accessing subscriptions made in other companies: "Subscription multi-company" 6) Using u1, create a new subscription in c1 7) Using u2, follow the chatter of the newly created subscription allowing the user to post messages/log notes. 8) Using u2, send a message with an attachment. Access Error. The problem raises only for the **first** attachment. That attchement is written on the record as the main attachment thus raises an error if the user doesn't have write access. There is no problem to add attachment to any following record or when the user has write access on the model. If the user doesn't have access to the chatter, he is blocked before accessing the write thus it is safe to sudo it. opw-1915606 closes odoo/odoo#30659
2019-01-29[MERGE] forward port branch 11.0 up to 36d96e01503Christophe Simonis
2019-01-29[MERGE] forward port branch saas-11.3 up to cd5c8a02f95Christophe Simonis
2018-12-12[MERGE] forward port branch 12.0 up to 047e2b28de4Christophe Simonis
2018-12-10[FIX] mail: missing translationNicolas Martinelli
closes odoo/odoo#29356
2018-12-10[FIX] mail: model descriptionNicolas Martinelli
Do not use the model `_description` field which cannot be translated. Use the `display_name` of the corresponding model instead. Moreover, `<t t-esc="'%s' % model_description or 'document'"/>` gives `'None'`, while `'document'` is expected. This adds a query to some tests, which is expected since `display_name` requires information stored in the DB, while `_description` is defined at the Python level. opw-1908420
2018-11-28[MERGE] forward port branch 11.0 up to bb6f6c57f97Christophe Simonis
2018-11-29[MERGE] forward port branch saas-11.3 up to c0eef427111Christophe Simonis
2018-11-29[FIX] mail: have signature in chatter by defaultNicolas Lempereur
The signature is shown by default when sending a mail and in particular case it is not shown. In c8d283a592 there was a small regression that in some instance the signature that was shown before is not shown anymore. This is because the default in those instance is to not show signature. eg. a message sent in a chatter would not have signature in sent emails With this commit, the previous behavior is reintroduced. opw-1903001 opw-1896262 closes #29088
2019-01-24[FIX]mail:reply to message with no authorMoens Alexandre
When a user/partner is deleted, their messages lose their author. Replying to those may result in a failure to fetch the mails from the incomming mail server. without this commit, partner_ids == [(4, False)] and this value "goes down" all the way to the orm method "write" of the Many2many field. resulting in a SQL query like : INSERT INTO mail_message_res_partner_rel (mail_message_id, res_partner_id) (SELECT a, b FROM unnest(ARRAY[149855]) AS a, unnest(ARRAY[false]) AS b) EXCEPT (SELECT mail_message_id, res_partner_id FROM mail_message_res_partner_rel WHERE mail_message_id IN (149855)) which fails with the ProgrammingError : EXCEPT types boolean and integer cannot be matched opw-1921805 closes odoo/odoo#30528
2018-11-28[FIX] mail: do not have _get_message_needaction crash on empty task listlen-odoo
Suppose that a Task is added on a task via a studio customisation. Then the _get_message_needaction method gets called on the onchange of the toplevel task, which triggers another call to _get_message_needaction. During that update, we get a self with a model.newID; its ids field is empty, so the list of tasks res itself is empty. As a result the method crashes on a malformed query. This can in turn prevent the completion of some higher-level operation, e.g. a state change on the task. opw 1909043 closes odoo/odoo#29084
2018-11-29[MERGE] forward port branch 12.0 up to 82a1e1dcc33Christophe Simonis
2018-11-29[REF] *: replace deprecated pycompat helpers for builtinsAdrian Torres
This commit replaces calls to pycompat helpers that were intended for python 2 <-> python 3 interoperability for python 3 builtins, as python 2 is no longer officially supported by Odoo. This includes: * calls to imap/izip/ifilter replaced by map/zip/filter * uses of text_type replaced by str * uses of unichr replaced by chr * calls to implements_to_string, implements_iterator removed * string_types and integer_types replaced by str, int respectively * calls to to_native replaced by calls to to_text This is done in preparation to the removal of these deprecated helpers in the following commit.
2018-11-20[IMP] mail, mass_mailing, mass_mailing_crm : Use normalized email in ↵David Beguin
unsubscribe link Use the email_normalized from mail.address.mixin if available to get always a normalized email address in the unsubscribe link. That allows to simplify the search on email address in the controllers -> Check blacklist, send feedback, etc.. Task ID 1896677
2018-11-16[MERGE] forward port branch 12.0 up to bc744a1da46Christophe Simonis
2018-11-16[FIX] mail: use strict email matching for bouncesOlivier Dony
When a bounce is received, we look for matching partners in order to increment the bounce counter. However by using [`ilike','email`] we carry the risk of matching emails that contain the bounce email: ['email', 'ilike', 'john@hitmail.com´] will also match 'random.john@hitmail.com' for example. Using strict equality is safer, and the worst that can happen is that we fail to count one bounce.
2019-01-09[MERGE] forward port branch saas-12.1 up to 8aa8548d8abChristophe Simonis
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-06[MERGE] forward port branch 12.0 up to dd70c684268Christophe Simonis
2018-11-02[FIX] mail: add index on `message_main_attachment_id`Toufik Ben Jaa
- When deleting attachments, the foreign key constraints on `message_main_attachment_id` are triggered which could take a lot of time to be computed. closes odoo/odoo#28358
2018-10-22[MERGE] forward port branch 12.0 up to b81c2bce846Christophe Simonis
2018-10-19[IMP] hr_holidays: Define notifications by leave typeTWA
Purpose ======= - A manager could want to follow only home working of its own department - A HR officer could want to follow only sick leaves of all dpts. We have to improve what people follow and how they follow it in the leaves module Specifications ============== Subtype on department --------------------- In department form view, right now, people can follow approvals Instead we should have some generic and specific subtypes depending on the leave type For instance, a HR Officer wants to follow only sick leaves and a manager only home working Following mechanism ------------------- Remove first / second approval subtype differences if a leave type is not linked to a specific subtype, consider only classic people follow it (employee and assigned HR people / manager) Link leave type to subtypes, with some by default (i.e. home working, ...), not mandatory When creating a leave type, link it to the department to be able to activate the subtype for only one department.
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-10-17[FIX] base,mail: do not include field attachments in attachment_countSwapnesh Shah
The _search was already excluding these attachments but not the read_group Avoid the read_group from mail to search on all existing attachments Fixes odoo/odoo#27673 closes odoo/odoo#27698
2018-10-09[IMP] mail,crm,...: Replace occurences of name_get()[0][1] by display_nameTWA
Purpose ======= display_name is equal to doing name_get()[0][1] Replacing name_get()[0][1] by display_name could be good for 2 things: - Uniformization of the code - Probable optimization if name_get is used inside a for loop on a recordset (as the values will be prefetched and put in the cache). TaskID: 1849250 closes odoo/odoo#26341
2018-10-11[FIX] mail: avoid sending mail when creating record from dataXavierDo
Before this fix the creation of task assigned to admin was leading to the creation of mails. This is a generic fix to avoid to notifiy a user when he is add as a follower when creating data from odoo data files. closes odoo/odoo#27682
2018-10-05[FIX] mail, mass_mailing: remove implicit dependency on mass_mailinglen-odoo
Fix to commit: a1d6064dcc6d349c02556453e1aa052e60db41c0 Which erroneously put a mass_mailing method in mail, as mail.mail.statistics is defined in mass_mailing. Since it does not depend on the records, it been extracted from the loop. opw 1890461 closes odoo/odoo#27431
2018-10-02[FIX] mail: avoid reading from abstract modelsChristophe Simonis
2018-10-01[MERGE] forward port branch saas-11.4 up to 57e387b6452Christophe Simonis
2018-10-01[MERGE] forward port branch saas-11.3 up to e980af9df00Christophe Simonis