summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_thread.py
AgeCommit message (Collapse)Author
2019-08-19[MERGE] forward port branch 12.0 up to 32039b2ab44Christophe Simonis
2019-08-19[MERGE] forward port branch saas-11.3 up to 121034f79a6Christophe Simonis
2019-08-19[MERGE] forward port branch 11.0 up to 1e4de19cd49Christophe Simonis
2019-08-19[MERGE] forward port branch saas-15 up to c43de33643aChristophe Simonis
2019-08-19[MERGE] forward port branch saas-14 up to fa26279014cChristophe Simonis
2019-08-19[MERGE] forward port branch 10.0 up to 2fc46a064d3Christophe Simonis
2019-08-14[FIX] mail: removing whitespace on message_id from incoming mailAbridbus
Because of a whitespace character present at the beginning of the message_id of some mails, they were fetched twice. From the SQL side, we see that Outlook is formatting the header following the RFC822 by allowing the header to look like: Header:<CRLF> <whitespace><hash_of_msg_id> From RFC822: "Each header field can be viewed as a single, logical line of ASCII characters. For convenience, the field-body portion of this conceptual entity can be split into a multiple-line representation" (abr.) It was also possible to find out by checking the logs. One or two whitespace(s) can be seen before the hash of the msg_id. The following commit is making sure we use and save the message_id without the whitespace by stripping them off on the coming mail. OPW-2006806 Applying CHS solution to avoid crash on empty header. closes odoo/odoo#35682 Signed-off-by: bve-odoo <Abridbus@users.noreply.github.com>
2019-08-06[MERGE] forward port branch saas-12.2 up to 9e74730a26bChristophe Simonis
2019-08-06[MERGE] forward port branch 12.0 up to ff9ddfdacc9Christophe Simonis
2019-08-01[FIX] mail: translate message of copied objectTatiana Deribina
When duplicating a record, the language is set to None in the context when copying a record new = self.with_context(lang=None).create(vals) self.with_context(from_copy_translation=True).copy_translations(new, excluded=default or ()) In mail.thread, the usecase of no language in the context was considered if 'lang' not in self._context: track_threads = threads.with_context(lang=self.env.user.lang) but not the case of a language explicitly set to None This means that, when duplicating a record, the tracked fields mesages were untranslated. Fixes odoo/odoo#35213 Closes odoo/odoo#35331 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16[MERGE] Forward port of 12.0 to saas-12.2 up to 1bd434da34731b546Martin Trigaux
closes odoo/odoo#34901 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16[MERGE] Forward port of saas-12.2 to saas-12.3 up to cf8e74a1a7d34Martin Trigaux
closes odoo/odoo#34907 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-27[FIX] mail: use base_url helper to be multi website compliantRomain Derie
When an email is sent and is related to a record, there is a header with a button link to access the record. Before this commit, that button href was always linking to the base_url URL. That was an issue on multi-website, since we need to use the website url and not the base_url if the record is related to a website. That's the case for a SO eg, after checkout you receive a confirmation email. In a multi-website environment, we need to access the record website. To do so, a previous imp/fix was done with c1be1993f9b. But this occurence still needed to be replaced. Fixes #34309 closes odoo/odoo#34397 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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-12-04[IMP] mail: message route speedNicolas Seinlet
When using limit=1, PostgreSQL sometimes use sub-optimal plan like "Index Scan Backward using xxx". To avoid this, adding a fake sort will make PostgreSQL to use the same plan as without limit, and in this particular case, the index on message_id closes odoo/odoo#29278 Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
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.