Commit Graph
8369 Commits
Author SHA1 Message Date
Sébastien Theys 7a5e08bdd3 [FIX] mail: speed up render of Message by inserting content manually
`t-raw` is too slow due to parsing the HTML in JS, converting it to VDOM and
comparing to existing VDOM. Here we can make a custom comparison based on actual
string, and directly replace in DOM if needed.

Part of task-2399731

closes odoo/odoo#63539

X-original-commit: cc531a07002fd8642f53e77c0fa52a49753e9df8
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-17 13:15:27 +00:00
Alexandre Kühn 6e8488caa4 [FIX] mail: inconsistency of new message style
The style of discuss new message (+) and chat window new message
should be consistent, as they both cover the exact same feature.

closes odoo/odoo#63530

X-original-commit: d8e816f95e2c51071415a3d4a9171d7014bb7b1c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-17 12:24:20 +00:00
Hardik Prajapati 1a58bcce08 [FIX] mail: Update the kanban record on activity creation/updation
Currently, scheduling the activity from the document chatter does not
appear on the kanban record on activity button.
and the 'onchange' action receives the ID of the activity that was
marked as done and thus the 'Missing record' error

So in this commit, on creation and done of activity reload the view to
update the record on kanban card.

The opportunity is taken to make a pass on all of the "reload" to add the
`keepChanges` flag to prevent from losing pending changes on reload, especially
useful in form view.

closes odoo/odoo#63464

Taskid: 2362964
X-original-commit: 6d75304604687d873b296c630b87bc184e221018
Related: odoo/enterprise#15345
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-16 15:04:06 +00:00
Didier (did) 7e0c645d37 [FIX] mail: mark all needaction as read when opening the thread
This was the case before the refactoring.

task-2411114

closes odoo/odoo#63461

X-original-commit: bcb32beb49e5d86ea0d6307cbeeb7e85a22d18b0
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-16 14:42:21 +00:00
Thanh Dodeur d1919017b5 [FIX] mail: prevents image loading errors
Before this commit, an event listener was still active after the removal
of the attachment viewer, which caused the the onLoad function to be
called on an removed component if the component was unmounted before
the image was loaded. This commit fixes this issue by adding the
eventListener through the owl template.

Additionally, when a new image was loading, the old image was kept in
the dom until the end of the loading of the new image, this commit
also fixes this issue by adding a t-key on the image element.

part of task-2363522

closes odoo/odoo#63452

X-original-commit: 31f71f500b88aa3eb0688ab990d0c5f00676c71e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-16 13:52:55 +00:00
Thanh Dodeur cdb469bce5 [FIX] mail: prevents traceback when clicking attachment unlink button
Before this commit, quickly clicking on the unlink button of an
attachment could result in a traceback if the click happened right
after the deletion of attachment but before the rendering of the DOM.

part of task-2363522

closes odoo/odoo#63447

X-original-commit: 1858184394342f24f5456728c4255f9980220c20
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-16 13:04:51 +00:00
Sébastien Theys bd7aeae189 [FIX] mail: prevent messaging menu from hiding home menu in mobile
task-2330277

closes odoo/odoo#63405

X-original-commit: db7f4437a644b93a5227f663fa19dda00817c13c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-15 14:33:23 +00:00
Julien Giannone 0286a46c96 [IMP] mail: Rename temporary to uploading in attachments related content
This commit renames "temporary" into "uploading" in attachments content

task-2337268

closes odoo/odoo#62526

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-15 12:48:21 +00:00
Sébastien Theys 4816c7bf03 [FIX] mail: fix display of chatter topbar in multiline
When the topbar goes to multiple line due to too much text content to fit its
currently available space (depending for example on length of text after
translations), it will look bad before this commit because the "send message"
and "log note" have a visual effect when they are open that requires them to be
directly above the composer to look good.

Part of task-2413814

closes odoo/odoo#63351

X-original-commit: 008def3f878b63cb49e0b5ef09a2cc22c784c0a9
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-14 16:55:17 +00:00
Thibault Delavallée 53021a0a8d [REF] mail: make activity_user_type not required on ir.actions.server model
PURPOSE

Required fields are annoying, notably when dealing with tests or xml-based data
to create in concurrent modules. For example ModuleA adds a required field on
Model. ModuleB that does not depend on ModuleA tries to create a data of
Model. Currently it crashes as field is required but default is not provided if
ModuleA is not loaded in registry.

SPECIFICATIONS

Field activity_user_type on ir.actions.server model in mail is currently
required. This field is however not really required as its use is limited
to actions linked to activities. Remove the hard required and put it only
in views.

If no value is given due to some bad configuration no responsible will be
set.

Followup of odoo/odoo@7309981426

LINKS

Task ID-2367655

closes odoo/odoo#61769

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-12-11 14:05:47 +00:00
Mathias Markl abea29fcd2 [FIX] mail: use correct badge color for messaging and activity menu
closes odoo/odoo#63323

X-original-commit: 8b419521124c47ac8eaf860fe70f6c0095fa8231
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-14 12:00:14 +00:00
Julien Castiaux 1a20f11005 [FIX] mail: Receive EML file in attachment
Configure the incomming mail server, use another mail client to send a
message to Odoo with an EML file as attachment. The fetchmail server
fails.

Since the introduction of the new EmailMessage python API to
encode/decode email messages, every EML attachment is automatically
parsed into a EmailMessage.

closes odoo/odoo#63255

Task: 2329606
X-original-commit: e628defec14f3b36612951bc698fa51b7c9f56bb
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2020-12-11 14:59:27 +00:00
Martin Trigaux 3f13751e9b [I18N] *: export saas-14.1 source terms
Without demo data

closes odoo/odoo#63238

X-original-commit: 4e6683973b1d1ecc67f1312a8ef98b1272e2d5a5
Related: odoo/enterprise#15268
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-12-11 12:30:42 +00:00
Adrien Widart 9faef60b2b [Fix] mail: incorrect activity creation date
After an activity creation, if a user checks the activity's information,
the creation date will be the current date.

To reproduce the error:
1. Add an activity (e.g. a TODO activity)
2. In log notes, click on the activity's information icon

=> The "Created" field is actually the current date and not the
activity's creation date.

OPW-2412967

closes odoo/odoo#63233

X-original-commit: f25da5fef15d10b184d744bf5533b90364a35a81
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-11 11:52:03 +00:00
Didier (did) 581d226e03 [FIX] mail: clean sub-queries when searching error message
Thread search with `message_has_error` should only return threads containing
messages with failure of which the current user is author.

Follow up on https://github.com/odoo/odoo/pull/52403 that changed how
sub-queries were built. The current fix using `_search` is a non-ideal solution
until task-2366651 brings a new domain operator for this use case.

task-2409543

closes odoo/odoo#63231

X-original-commit: 337397eec5570fc9b3938d655a1ec0e4efcd73d9
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-11 11:50:58 +00:00
Sébastien Theys 171b0b9f69 [FIX] mail: prevent autofollow when using mentions in notes
task-2415579

closes odoo/odoo#63215

X-original-commit: e5c3d63375bf314f6748fd3f8b95eba313b154ac
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-11 09:53:23 +00:00
Thanh Dodeur 4f4ff204da [FIX] mail: handles unlink button spam on attachments
Before this commit, attempting to delete attachments multiple times
could result in errors, especially on slow networks.

This commit fixes this issue.

task-2363522

closes odoo/odoo#63189

X-original-commit: 528adfb313ab3c8d4aeb3309aa7371301ab8085e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-10 16:06:25 +00:00
Ipsita Borisagar 4299d2233c [IMP] bus,mail: improve discuss notification design
PURPOSE

Discuss notification needs to be changed for better UI.

SPECIFICATION

Improving design of discuss notification by using bg-info instead of bg-warning.

LINKS

PR https://github.com/odoo/odoo/pull/55542
Task-2308799

closes odoo/odoo#55542

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-10 15:20:45 +00:00
Thanh Dodeur c53b798267 [FIX] mail: prevents traceback on attachment delete during upload
Before this commit, removing attachments that are being uploaded
could lead to a traceback if the removed attachment was still
awaiting for the upload of another attachment.

part of task-2363522

closes odoo/odoo#63164

X-original-commit: d345ab808d1261953ee9c588d1cb5fe2571d3e69
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-10 13:26:14 +00:00
Sébastien Theys fb7b32dbcb [FIX] mail: only highlight needaction on their origin thread
task-2391170

closes odoo/odoo#63163

X-original-commit: 2752d961922a3527f3c919d4578a33b8e87eeffb
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-10 13:14:22 +00:00
Didier (did) 626db2b2d3 [FIX] mail: disable multiline channel
This avoid text flickering when a multiline channel name is hovered in the
discuss sidebar.

task-2274991

closes odoo/odoo#63100

X-original-commit: 6a3d8982a657fc4e124f6bebe457289297efdabe
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-09 14:27:21 +00:00
Didier (did) 4a85802852 [FIX] mail: fix unfedined record when pressing "end" key in mentions
task-2411756

closes odoo/odoo#63099

X-original-commit: 4b5cfee6726fed4918deecba2237d948f9e416f0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-09 14:26:53 +00:00
Ivan Yelizariev 1b502a4ec7 [FIX] mail: turn tagged name with special characters into links
STEPS:
* Created partner with following name: Putin's spokesman
* Tag the partner in a message: @Putin's spokesman

BEFORE: tag is not converted into a link
AFTER: the link is created

WHY: _generateMentionsLinks uses ``owl.utils.escape`` which is different from ``_.escape``

https://github.com/odoo/odoo/blob/880555b38dee0c3e3b364c19bb6b0db983bf8aa0/addons/mail/static/src/models/composer/composer.js#L659

So following replace didn't work:

https://github.com/odoo/odoo/blob/880555b38dee0c3e3b364c19bb6b0db983bf8aa0/addons/mail/static/src/models/composer/composer.js#L667

---

opw-2408863

closes odoo/odoo#63056

X-original-commit: 5b62b40713d28cc905fd4c54de13cf2de39d988d
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-08 17:58:09 +00:00
Prakash Prajapati 10b57a0606 [FIX] mail: Fix traceback on immediate onchage after mark activity done
Currently, there is traceback when we make the activity as done and
directly fire the onchange.
Reproduce step:
1) Create an appraisal
2) Create an activity
3) Refresh the Page
4) Done the activity
5) Unpublished the Manager Feedback

The 'onchange' action receives the ID of the activity that was marked as done
and thus the 'Missing record' error.

So in this commit, on done of the activity trigger refesh to reload the
activity ID.

closes odoo/odoo#63034

Task-id: 2357760
X-original-commit: 23d9bd0b7e43dcb431450664172fbcd409c9d62c
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-08 14:51:48 +00:00
Arnaud Baes 98a0c8a7d0 [FIX] mail: remove useless custom property from action dict
The `{'infos': 'mail_sent'}` property returned by `action_send_mail()`
was apparently unused, and orginally intended for debugging, according
to its author.

Since previous commit adds a warning for such unknown properties,
removing it entirely keeps the testsuite green. And it's cleaner
than explicitly allowing that extra key, since it's unused.

closes odoo/odoo#63009

X-original-commit: 7c8c5a9cd716d35783734493cbb15b194e7b787c
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-12-08 11:32:51 +00:00
Sébastien Theys fe93fc28eb [FIX] mail, im_livechat: properly handle multiple public partners
task-2391334

closes odoo/odoo#63002

X-original-commit: 9fbea9f8ee193e672c855c73ad29de187f27cef1
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-08 11:28:38 +00:00
Arnaud Joset d0f5ff8fe2 [IMP] mail: add space in Scheduled Date value
Before this commit, when the delay_count had two digits, the fixed min-width of the o_row class made the delay_unit stick to the delay_from.

closes odoo/odoo#61628

Taskid: 2378814
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-11-12 08:44:48 +00:00
Alexandre Kühn 8209076b1f [FIX] mail: ignore partner notification with unsupported type
Task-2411800

closes odoo/odoo#62825

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-03 13:32:55 +00:00
Alexandre Kühn 4efb465f6a [FIX] mail: prevent Safari from indefinitely focusing composer
`setSelectionRange()` on Safari has side-effect to focusing the
input element, which is not the case in Chrome and Firefox.

Task-2410311

closes odoo/odoo#62886

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-04 12:54:14 +00:00
Didier (did) acb09f799a [FIX] mail: wrong top value in composer css
closes odoo/odoo#62890

X-original-commit: 329b00365e7b7702eb4923443c99ddac13340ae8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-04 13:36:16 +00:00
Alexandre Kühn 62a2ca4c14 [FIX] mail: make messaging menu header visible in Safari
Task-2389455

closes odoo/odoo#62885

X-original-commit: 759ddc180a7fa186d9ad36583ebd1f4857f584e7
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-04 12:48:54 +00:00
Xavier Dubuc cf31cd7946 [FIX] mail: split attachments list to improve style
There is now two lists of attachments : first one with images and second
one with non-images. Attachment viewer allows to navigate through
previews of all viewable attachments in the order they're shown.

task-2272587
task-2401325

closes odoo/odoo#62719

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-04 09:16:32 +00:00
Xavier Dubuc 1797835051 [IMP] mail: replace selectedMessageLocalId prop by value from store
task-2282218

closes odoo/odoo#61768

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-02 10:26:46 +00:00
Xavier Dubuc bdff0f6d28 [FIX] mail: fix partner seen infos wrongly set as readonly
task-2391981

closes odoo/odoo#62239

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-04 09:06:49 +00:00
Adrian Torres 679185f3e8 [IMP] *: replace all raises inside unlink by api.ondelete
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
2020-12-04 09:16:16 +00:00
Didier (did) 3f100568b5 [FIX] mail: increase chatter max-height.
We go back to the fake textarea to avoid a flickering created by the
`this._textareaRef.el.style.height = "0px";`.
This height reset create an unwanted scrollbar jump that could hide the content
of the textarea (not aside mode).

task-2390354

closes odoo/odoo#62828

X-original-commit: 52f3db8ef61d4284d8ea624022bc1355f7f8cf00
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-03 13:51:29 +00:00
Victor Feyens 18b49836b7 [REF] mail: make alias creation work in batch
In this commit we rewrite part of alias name uniqueness check as well as
alias mixin alias creation to enable batch create of

  * alias records (mail.alias);
  * records using aliases through mail.alias.mixin;

See merge commit for more details.

Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
2020-12-03 10:18:50 +00:00
Victor Feyens 646457d761 [IMP] mail, digest, fetchmail, hr_holidays, snailmail: support batch creation
See merge commit for more details.

Note that mail.alias model will be done in a separate commit.

Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
2020-12-03 10:18:47 +00:00
Sébastien Theys 0cf14852a3 [FIX] mail: remove html from new message notification
task-2388659

closes odoo/odoo#62756

X-original-commit: 8af59b95b477b2eeddec118663e21b00a4e48801
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-02 15:51:27 +00:00
Sébastien Theys 03e44752cb [FIX] mail, test_mail: fix inbox (needaction) query
Message search with `needaction` in domain should only return messages with
`needaction` for the current user.

Follow up on https://github.com/odoo/odoo/pull/52403 that changed how
sub-queries were built. The current fix using `_search` is a non-ideal solution
until task-2366651 brings a new domain operator for this use case.

task-2388843
task-2389933

closes odoo/odoo#62753

X-original-commit: 209ed7c1991016054cbc4c5fc92ed30a07c4551d
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-02 15:04:04 +00:00
Jairo Llopis b8571322f9 [FIX] mail: add support for Text/RFC822-Headers content-type
WHY:

Some mail servers may provide `Message-Id` header in a section typed
`text/rfc822-headers` instead of a `message/rfc822`

According to https://tools.ietf.org/html/rfc6522#section-4 that section's body
actually contains the headers from the bounced email.

STEPS: a way to reproduce it should be using postfix v2.5+ with setting
bounce_size_limit=1. See
https://github.com/odoo/odoo/pull/42340#issuecomment-617605521

BEFORE: `bounced_message_id` is empty and thus the little email envelope icon
doesn't turn red, nor do the email resend features trigger in the UI. You could
be sending an invoice and never knowing it was bounced.

AFTER: bounces from mail servers that return the `text/rfc822-headers` part will
be handled properly.

---

@Tecnativa TT21170
opw-2162067
opw-2344252
closes #42340
closes #62551

closes odoo/odoo#62732

X-original-commit: 375ba5b37053a599922dd61c9e787553d6171291
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-12-02 11:50:31 +00:00
Didier (did) a57d4377fb [FIX] mail: set href on notification link.
This allow the user to open link in new tabs with middle click

task-2387837

closes odoo/odoo#62738

X-original-commit: 7a57cf0b68b3a1dce4276c6456a94b05eec20f28
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-12-02 12:35:42 +00:00
Nicolas Galler 25728bea74 [FIX] mail: when adding an attachment, do not discard edits
Behavior prior to this commit:

- edit an existing invoice
- add a line, but do not save
- add an attachment - the attachment uploads and the new line stays visible
- save the record: the line now disappears

Behavior after this commit:

- changes are not discarded when uploading an attachment

opw-2369162

closes odoo/odoo#62727

X-original-commit: abf1982d4ec09b5e87c1d7573158257f91961214
Signed-off-by: Nicolas Galler <ngaller@users.noreply.github.com>
2020-12-02 11:03:14 +00:00
Xavier Dubuc de638c3f18 [FIX] hr_holidays: bring back the out of office panel in threads
task-2277511

closes odoo/odoo#62638

X-original-commit: d9aa362914945e6cb095b04fa94cfb3469abd907
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-02 11:03:39 +00:00
Sébastien Theys 8ee21a9cd0 [FIX] mail: fix mention suggestion order and skip intermediate rpc
task-2387825

closes odoo/odoo#62639

X-original-commit: 661f687256995452756d6396308bcc167a5dcb9f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-11-30 17:14:07 +00:00
Sébastien Theys 5cfc62cb33 [FIX] mail: prevent from closing an already deleted chat window
task-2394789

closes odoo/odoo#62626

X-original-commit: c32a3e9cbe0323e0b1fcc70b1438e9a56185493c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-11-30 15:26:02 +00:00
Aurélien Warnon b46153f6cf [FIX] mail: fix mail.mail default values collision
This commit cleans the default_* keys of the context before creating mail.mails
and mail.notifications when notifying the record by email.

Without this change, there can be a collision when the ORM tries to compute
default values for the state field (for example):
- Model "A" has a 'state' field ;
- Create an action that redirects to model "A" form view, setting some default
  values in the context such as {'default_state': 'done'} ;
- Model "A" has an inherit on 'mail.thread' and a 'user_id' field to set a
  responsible user ;
- Model "A" record is created with a responsible user, who is automatically
  notified by email that the record "has been assigned to him" ;
  (see mail_thread#_message_auto_subscribe_notify)
- A 'mail.mail' is in turn created ;
- The 'mail.mail' model ALSO has a 'state' field, and the context is propagated
  so the ORM will try to assign 'done' to that field, which is an incorrect
  value ;
- -> Crash.

If we ensure that the default_* keys are cleaned from the context, the default
values computation of the mail.mail record will not be affected and everything
works fine.

A test was added to ensure this behavior.

Task 2393259

closes odoo/odoo#62589

X-original-commit: 6b6e546ac95d9acb2964121dd52aa2896d31bc33
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-11-30 10:25:36 +00:00
Julien Castiaux db9bf62431 [REF] mail: Use Command helper for x2many
closes odoo/odoo#60965

Task: 2366606
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-11-30 10:16:09 +00:00
Martin Trigaux 1658473bf2 [FIX] *: rephrase, correct typos
Courtesy of Transifex's translators for reporting bad/unclear sentences.

closes odoo/odoo#62564

X-original-commit: 9b3b2e8d711e3be75b1faffaf6f4f8f4ec90186e
Related: odoo/enterprise#15038
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-11-30 07:07:58 +00:00
Didier (did) 31e015f80f [FIX] mail: mark document as read when open
task-2387820

closes odoo/odoo#62429

X-original-commit: fe3dbfb77eb403bb6eb69cd9d667fd8baa714ff7
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-11-26 15:29:28 +00:00