Commit Graph
2976 Commits
Author SHA1 Message Date
Hiral Bhavsar 5373db1487 [FIX] mail, web: open systray menu dropdown in mobile.
Before this commit, it was not possible to open systray menus in mobile.
This is due to popper.js that is wrongly dynamically positioning the
dropdown menu.

This commit fixes the issue by disabling dynamic positioning by popper.js
for the systray menus, so that it uses ou custom styles for dropdown menu.

Closes #26434
2018-09-13 17:49:52 +02:00
ThanhDodeurOdoo d12b883155 [IMP] mail, web: attachments & messages in debug actions.
- added two new actions to the form view debug action list,
  both opens list (+ form) views of messages and attachments respectively
  for which the domain is restricted to the current record.

task: 1860031
2018-09-13 11:50:26 +02:00
ThanhDodeurOdoo 7f97c9fc05 [IMP] mail: new attachment button in the chatter
- Added a new button to the chatter that displays the amount of
 attachments on the current record and when clicked, all the attachments
 attached to the current record

      - added mail.FormView (includes), used by the chatter attachment
       button to fetch the field value of attachment_count.

      - added a computed field "attachment_count" to mail.thread that
       contains the amount of attachment attached to the record.

      - changed the followers div, it is now sharing a "right side"
       area with the attachment button.

 task: 1860031
2018-09-13 11:50:26 +02:00
Alexandre Kühn 611b42409e [FIX] mail: filter messages in thread (Discuss)
Revision on https://github.com/odoo/odoo/commit/ec8c505bc1c9ec21939e9ffef53a9cc6f63f30c7

The commit above changes the way threads are rendered: the template
now uses a thread object, instead of a list of messages.

However, it was not handling messages that have been filtered from
the searchview. As a result, it was not possible to filter messages
at all.

This commit re-adds the possibility to filter messages, by providing
information on the domain of the thread in the template.

Task-ID 1877502
2018-09-12 15:02:22 +02:00
Alexandre Kühn 3b76886f9a [FIX] mail: toggle show/hide search options in discuss
Before this commit, the search option buttons were not
hidden when clicking on the zoom-in/zoom-out button next
to the searchview.

This is due to updating the control panel with the list
of buttons as the searchview buttons, instead of the
container. Since the visibility of the searchview buttons
is defined on the container, the toggler button and the
search view options lost synchronization.

This commit fixes the issue by providing the container
that is shared between search option buttons.

Task-ID 1877502
2018-09-12 15:02:22 +02:00
Alexandre Kühn 4ee7a009f7 [FIX] im_livechat, mail: any thread window has an ID
Before this commit, only thread windows in the backend had the
method `getID`. However, it should also be the case for the thread
windows in the frontend (website livechat), as the template of any
thread window makes use of this method.
2018-09-12 15:02:22 +02:00
Alexandre Kühn 6a9a20d025 [REF] mail, im_livechat: clean typos 2018-09-12 15:02:22 +02:00
Alexandre Kühn d52864569d [IMP] mail: bigger emoji size in the composer selection
The emojis were too small, thus hard to read.

Task-ID 1882595
2018-09-12 15:02:22 +02:00
Kinjal Mehta 49c7105631 [FIX] mail: BS4, adjust counter position 2018-09-11 14:21:18 +02:00
Christophe Simonis 826cd9b3d3 [MERGE] forward port branch 11.0 up to c3ea0a7811 2018-09-10 19:21:57 +02:00
Lucas Perais (lpe) bb12890977 [FIX] mail: activity don't loose text of feedback popover
On an activity, click Mark as done, the popover pops over
Now write some text in it, but click somewhere else, like to copy/paste something
The popover looses focus, and your text disappears

After this commit, we store the value of the popover when hiding it,
then, when when showing back the popover, the value is reinjected

OPW 1873999
closes #26315
2018-09-10 11:24:42 +02:00
Aurélien Warnon 19a1cf11d7 [FIX] mail: Fixed missing parenthesis
From forward port branch saas-11.4, commit 68d36512ef
2018-09-10 08:50:24 +02:00
Christophe Simonis 68d36512ef [MERGE] forward port branch saas-11.4 up to d78f23df84 2018-09-07 20:20:45 +02:00
ThanhDodeurOdooandPierre Paridans 16aeecc73d [REF] base, mail: Documents (enterprise) related changes
-removed force_ext from ir.http.
    -added signature arg to web/image to differentiate cache entries by URL.
    -added an embed youtube viewer for youtube URL's
    -added a PDF splitter to the PDF viewer UI
    -added tests for mail's Document Viewer
    -added a "signature" param to web/image to go around the browser cache

    -thumbnail field of ir.attachment is now stored in the filestore
    as a distinct attachment.

task 1853490

Co-authored-by: Pierre Paridans <app@odoo.com>
2018-09-07 16:06:47 +02:00
Thibault Delavallée 9abbd843a8 [FIX] mail: set cursor as pointer when hovering contact name in activity summary view
Purpose of this commit is to make it obvious contact name cell is clickable.

This commit is linked to task ID 1882545 and PR #26797.
2018-09-07 15:29:57 +02:00
Thibault Delavallée 540226d806 [IMP] mail, contacts: allow to have actions in systray elements
Purpose of this commit is to allow having an icon redirecting to the
activity summary view in the partner activities section of systray.

This is done by supporting an additional 'actions' list in the activity
data given to the systray. It displays small icons that redirect to an
Odoo action given its xml ID.

This commit is linked to task ID 1882545 and PR #26797.
2018-09-07 15:29:57 +02:00
XavierDo 7f47dcae5b [FIX] mail: improve activity view and fix activity feedback
-Improve no content helper on activity view

-Update chatter after editing an activity un form view

-Avoid context to appear as feedback
When using call_button the context is set as an arg and will be catched by
the kwargs of the called action.

As for action_feedback, we can create a wrapper without kwargs
used when calling this method from a button to avoid this problem.

Another solution would be to change the call_button in order to give
the context as a kwargs. Maybe a possible improvement for master.

-Remove groupby from activity view
group by has no effect on activity

-Change cursor to pointer on record name in activity view

Task: #1878184
PR: #26668
2018-09-07 14:59:05 +02:00
XavierDo 62928bb81a [FIX] mail: make red envelope visible when necessary
We need to know if a notification is in failure by
displaying the red envelope in even if all partner are inactive.

This commit also fix the filter in order to display notification
of all active partners if there is an exception.
2018-09-06 10:34:14 +02:00
XavierDo d0e957109f [FIX] mail: allow resend on bounce
Only o_thread_message_email_exception red envelope was clickable.
We should be able to resend bounce too.
2018-09-06 10:33:52 +02:00
Martin Trigaux 5d2bea62c3 [FIX] mail: display icon
The icon for .o_user_online (e.g. fa-heart for bot) was not displayed as it was
the same color as the one defined in .o_thread_window_header

Use $o-enterprise-primary-color (aka green) to indicate the user is online

Closes #26350
2018-09-05 15:17:17 +02:00
Martin Trigaux 9aa750bffc [FIX] mail: add missing emoji 2018-09-05 11:57:06 +02:00
Alexandre Kühn 0d515f0c7a [IMP] mail: stylized 'no content' helper in activity view
Task-ID 1882552
2018-09-05 11:43:24 +02:00
Alexandre Kühn 0a3d08c443 [REM] mail: no push notifications permission request in Discuss
This has been replaced with "OdooBot has a request" in the systray
messaging menu (see https://github.com/odoo/odoo/commit/f80bbb4b2a1230ba543e97d3da01c7b2c52d24cc).

Task-ID 1877502
2018-08-31 10:22:56 +02:00
Alexandre Kühn f80bbb4b2a [IMP] mail, mail_bot: improved push notifications permission response
This commit makes small improvements on the messaging menu with
the new module `mail_bot`:

[IMP] When OdooBot has a request, it now adds "+1" to the counter of
      the messaging menu. The related preview also has a bold title,
      and displays "(1)" next to the title.

[REF] Static previews are no longer in mail_service. This was only
      used for "OdooBot has a request" preview. This logic has now
      been moved to the module `mail_bot` (was previously in `mail`).

[FIX] Title of response of push notifications permission clearly
      states whether permission has been granted or denied
      (was displaying "[Object object]" before this commit).

Task-ID 1877502
2018-08-30 17:55:18 +02:00
Alexandre Kühn f0f81e8db3 [FIX] mail: correctly handle (non-)passive thread windows
Definition of '(non-)passive' thread window:

  Thread windows can be either 'passive' or 'active'
  (default: 'active').

  - When opening a thread window in 'active' mode, the messages
    are marked as read, and the focus is on the thread window.
  - When opening a thread window in 'passive' mode, the messages
    are not marked as read and there is no focus on the thread
    window. Messages are kept unread until the user interacts with
    the thread window (e.g. by clicking on composer).

  When the user intentionally opens a thread window, it should
  be open in active mode. However, when a thread window is open
  without any user iteractions, it should open in passive mode.

  The later case is useful in some cases. For instance, when
  receiving a new message from a DM conversation, it should
  automatically open the corresponding thread window. However,
  it should not automatically mark messages as read.

This commit contains 2 bug fixes:

1. When receiving a new message on an active thread window,
   it no longer increments the unread counter.

   (When the focus is on the composer of the thread window,
   the user is immediately reading newly received messages.)

2. When receiving a new message from an unpinned DM conversation,
   the newly open thread window is always passive.

   (This was not the case before, so when receiving new messages,
   it did not increment the unread counter.)
2018-08-30 13:30:12 +02:00
Alexandre Kühn be44efe852 [REF] mail: clean some JS code
1. Removed `getLocalMessages` method in mailbox, and replaced
   with an override on `getMessages`.

   (This method was used before the distinction was made
   between `getMessages` and `fetchMessages`)

2. Removed unused method `_warnUpdatedUnreadCounter` in
   abstract thread window.

   (Leftover from an early POC)

3. Set the default value `''` for the status of a thread.

   (The method `getStatus` should always return a string)

4. Enforce default value `false` for detached status of channel.

   (The method `isDetached` should always return a boolean)

5. Improve readability of some tests.

   (removed useless variables and/or redundant code)
2018-08-30 13:26:07 +02:00
Siddarth Gajjar bd43df539f [IMP] mail: improve envelop icon tooltip style
This commit improves the style of the tooltip on the mail envelop
icon next to a message related to an email. To do so, we have removed
existing CSS and custom tooltip UI and replaced them with boostrap
popover.

This commit also removes most flickering issue when mouse hovering
on gaps between the tooltip and message icons.

Note that there are still corner cases that produce flickers.
This is unfortunately a known issue with bootstrap 4, as this glitch
can also be observed on bootstrap website.

Task-ID 1879282
Closes #26546
2018-08-30 12:47:28 +02:00
Alexandre Kühn eee49f13f0 [FIX][REF] mail: several thread windows fixes
This commit fixes some bugs on thread windows, and make some
improvements on tests related to thread windows.

Fixes:

	1. Correctly position last visible thread window when there are more
	   open thread windows than available slots.
	2. Closing a thread window now marks it as read.
	3. Can now fold/unfold the blank thread window (aka 'New' thread window).

Tests cleaning:

	1. Removed unnecessary 'before assertions' in thread window tests.
	   > Solved with this: https://github.com/odoo/odoo/commit/9b1daa1218f7adf9d741afba607ef5b55b16e3e6
	1. Added basic rendering test for a (non-blank) thread window.
	2. Cleaned thread window tests
	   > Split in different files.
	   > Grouped in 'Thread Window' QUnit module.
2018-08-27 18:32:58 +02:00
qsm-odoo d578644756 [FIX] web, *: use correct DOM for m2m tags
* mail, calendar

- Fix traceback when clicking on a tag without color field (introduced
  in recent changes)
- Properly allow to delete tags on firefox (a button obviously cannot
  contain another button)

Closes https://github.com/odoo/odoo/pull/26547
Thanks to @hbh-odoo
2018-08-27 17:12:56 +02:00
Xavier Morel 0e307f8280 [FIX] doc building and warnings
doc:

* fix incorrect doc comments (documenting params which don't exist)
* correctly quote non-refs
* fix role label syntax (backticks must be escaped)
* add newline to fix warning

JS doc parser:

* fix handling of already-resolved objects
* fix handling of non-string properties (e.g. foo[0] at module toplevel)
* don't blow up if subject of .include call can't be resolved (just ignore)

Others:

* add translator support for ``problematic`` node (apparently used for
  some refs by recent Sphinx)
2018-08-27 12:55:21 +02:00
Martin Trigaux bb86b51241 [FIX] do not translate useless t-attf-title
t-attf-title are translatable, do not use t-attf if a t-att is enough
2018-08-24 16:16:53 +02:00
Alexandre Kühn 5999ba86c7 [FIX] mail: "is typing..." notification sticky top for DESC threads
Revision on https://github.com/odoo/odoo/commit/4fa071339a8f381b1336fe326577c9decc04a1e1

There was a typo in the style of the 'is typing...' notification bar,
which resulted in applying the wrong sticky behaviour to ASC and no
sticky behaviour at all for DESC.

This commit applies the correct sticky behaviours to the notification
bar in both configurations:

      ORDER:                   ASC                           DESC

                     +--------[top]--------+        +--------[top]--------+
                     |                     |        |                     |
                     |  (older messages)   |        |  (newer messages)   |
                     |                     |        |                     |
   visible top ----> |- - - - - - - - - - -|        |- - - - - - - - - - -|
                     |                     |        |   X is typing...    |
                     | ...                 |        | ...                 |
                     | message i           |        | message i + 1       |
                     | message i + 1       |        | message i           |
                     | ...                 |        | ...                 |
                     |    X is typing...   |        |                     |
visible bottom ----> |- - - - - - - - - - -|        |- - - - - - - - - - -|
                     |                     |        |                     |
                     |  (newer messages)   |        |  (older messages)   |
                     |                     |        |                     |
                     +------[bottom]-------+        +------[bottom]-------+
2018-08-21 20:14:09 +02:00
XavierDo 7f8ffba48e [FIX] mail: remove bolt on notification request
Since the title of a notification is in a t-esc, the style wont be applied
2018-08-21 17:55:27 +02:00
Alexandre Kühn 4fa071339a [FIX] mail: "is typing..." notification sticky top for DESC threads
Before this commit, the 'is typing...' notification bar was sticky
to the bottom of the thread, independently of the ASC or DESC mode
order of threads.

This is okay for ASC, but not for DESC: it should stick to the
visible top of the thread for DESC.

As a result, this notification bar was always at the top of the
thread, without the 'sticky' behaviour:

        +--------[top]--------+
        |   X is typing...    |
        |                     |
        |  (newer messages)   |
        |                     |
        |- - - - - - - - - - -|   <---- visible top
        |                     |
        | ...                 |
        | message i + 1       |
        | message i           |
        | ...                 |
        |                     |
        |- - - - - - - - - - -|   <---- visible bottom
        |                     |
        |  (older messages)   |
        |                     |
        +------[bottom]-------+

With this commit, the 'is typing...' notification bar sticks
to the visible top of DESC threads:

        +--------[top]--------+
        |                     |
        |  (newer messages)   |
        |                     |
        |- - - - - - - - - - -|   <---- visible top
        |   X is typing...    |
        | ...                 |
        | message i + 1       |
        | message i           |
        | ...                 |
        |                     |
        |- - - - - - - - - - -|   <---- visible bottom
        |                     |
        |  (older messages)   |
        |                     |
        +------[bottom]-------+
2018-08-21 16:57:51 +02:00
Alexandre Kühn 7e7e72edfd [FIX] mail: 'is typing...' notification bar next to composer.
Revision on https://github.com/odoo/odoo/commit/0eab8f6e0b17a4ff6a859d14b14b643212cbadc1

The commit above fixed the definition of ASC/DESC on the rendering
of mail threads.

However, the 'is typing...' notification bar was still partially
using the old definitions. As a result, this notification bar was
not sticking at the visible bottom of the thread when there were
few messages:

        +--------[top]--------+   <---- visible top
        | 1st message         |
        | 2nd message         |
        | 3rd message         |
        |    X is typing...   |
        |                     |
        |                     |
        |                     |
        +------[bottom]-------+   <---- visible bottom

This commit fixes the issue so that the 'is typing...' notification
bar is always at the bottom of the thread in such case:

        +--------[top]--------+   <---- visible top
        | 1st message         |
        | 2nd message         |
        | 3rd message         |
        |                     |
        |                     |
        |                     |
        |    X is typing...   |
        +------[bottom]-------+   <---- visible bottom

Note that it fixes the case with 'few messages', without altering the case with
'several' messages:

        +--------[top]--------+
        |                     |
        |  (older messages)   |
        |                     |
        |- - - - - - - - - - -|   <---- visible top
        | ...                 |
        | message i           |
        | message i + 1       |
        | ...                 |
        |                     |
        |    X is typing...   |
        |- - - - - - - - - - -|   <---- visible bottom
        |                     |
        |  (newer messages)   |
        |                     |
        +------[bottom]-------+
2018-08-21 16:57:51 +02:00
XavierDo 616fa4f6e4 [IMP] mail_bot: change Odoobot to OdooBot 2018-08-21 13:44:33 +02:00
XavierDoandRomainLibert 0be33db68a [IMP] mail: refactor activity.js and add some test
activity.js was a little dirty with a lot of copy paste.
Most of the common logic is now in a BasicModel.

This commit also add some tests on activity view

Co-authored-by: RomainLibert <rli@odoo.com>
2018-08-20 16:00:09 +02:00
Alexandre Kühn 6d53cd3201 [REF] mail,im_livechat,digest: rename 'chat_client_action' to 'Discuss'
Revision on https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498#diff-6d76770b1b7cf716d60a4d76a1555c1d

The commit above mostly renamed 'Client Action' to 'Discuss',
but there were some leftovers.
2018-08-17 16:28:39 +02:00
Luis González bb5a9a6ae6 [IMP] mail: Add some missing aria attributes
Some aria HTML attributes were missing, and are desirable to provide a
better experience for screen reader users.

The following attributes are included:
- `aria-pressed`: Used in buttons whose function is toggled when
  pressed. In this case, it is added on the button to follow/unfollow
  a record.
- `role`: used to improve given information about what elements are for.
  In this case, it is added in the following cases:
  1. Buttons to apply filters (e.g. to filter conversations) are set
     to  role="tab". These buttons have the class `o_filter_button`.
  2. Elements who are not buttons but have the class `dropdown-menu`
     are set to role="button".

Closes #25667
2018-08-17 16:12:04 +02:00
Alexandre Kühn 0eab8f6e0b [FIX] mail: correct meaning for ASC/DESC thread ordering
Revision on https://github.com/odoo/odoo/commit/f2302dfb27dd7f6a0dee7c65ab75b62a01706264

The commit above improved the rendering of thread.
However, it wrongly defined ASC and DESC.

This commit fixes this issue by re-arranging so that their
definitions match the meaning of 'ascending' and
'descending'.

Orders are defined from top to bottom. Visually:

                _____________            _____________
               |             |          |             |
               |  message 1  |          |  message n  |
               |  message 2  |          |  ...        |
               |  ...        |          |  message 2  |
               |  message n  |          |  message 1  |
               |_____________|          |_____________|

    ORDER:           ASC                     DESC
2018-08-17 14:10:46 +02:00
Alexandre Kühn 1337465c51 [REF] mail: reorder Discuss handler function alphabetically 2018-08-17 14:10:32 +02:00
XavierDo f83c313631 [IMP] mail_bot: improve answers, initialisation and others
1. Odoobot shouldn't talk to admin when demo data are installed
Odoobot will talk to a user on it's first connection, meaning that
a dev will see this chat window a lot. The state disabled is not a
real state but is explicit, the odoobot wont be initialized in this
case. It is still possible to test odoobot flow with demo user.

2. remove old odoobot image and update link

3. small improvements in odoobot answers
2018-08-17 13:06:43 +02:00
qsm-odoo ed031d9085 [FIX] mail: BS4, restore discuss badge design 2018-08-17 12:46:14 +02:00
Alexandre Kühn 75aef0106e [FIX] mail: misplaced translatable string
`_t()` must surround a static string in order to become a
translatable string.
2018-08-17 12:37:25 +02:00
Alexandre Kühn c995aa2cfd [FIX] mail: tests: remove phantomjs hack with discuss
Revision on https://github.com/odoo/odoo/commit/e0a51edd856b36bfdf1cacb4d7e8d70fad7884fa

In the commit above, we added an option to Discuss widget
to render threads specifically for PhantomJS. The reason
for this is that a test was failing, because it needs full
support of CSS flexbox to pass.

However, PhantomJS does not support flexbox very well. As
a result, it was messing with the rendering of threads.
We couldn't make the hack just in the test itself, because
it is already at the moment of rendering the thread that
PhantomJS messes the whole process of the test.

PhantomJS has been replaced with Chrome headless [1], So
the hack is no longer be necessary, as Chrome headless
fully supports CSS flexbox.

[1] https://github.com/odoo/odoo/commit/de84ad9c1f4853cb8a748ee1d0c880081dae9fe2
2018-08-16 22:26:50 +02:00
Alexandre Kühn 2ed4408e3e [FIX] mail: mark all messages as read from Inbox
Before this commit, there was a traceback when attempting to mark
all messages as read from the 'Inbox' of Discuss.

This is due to resetting the 'needaction' counter on threads that
do not not track 'needaction', such as the 'Starred' mailbox.
In fact, only channels do track them and handle a needaction counter,
so this should only be applied on channels.
2018-08-16 09:49:07 +02:00
Nicolas Lempereur b46156d4a2 [FIX] mail: update dm chat ok for f2302dfb
In f2302df dm type of channel was renamed to dm_chat, this commit takes
this into account in other part of the code.
2018-08-14 10:47:57 +02:00
ThanhDodeurOdoo 693e59a9b0 [FIX] mail: move SCSS rule to enterprise 2018-08-13 14:59:47 +02:00
sri-odoo 6494d115e5 [FIX] web, mail: navbar & systray colors + badge alignment 2018-08-13 14:46:47 +02:00
Alexandre Kühn 5f1d32f3fb [IMP] mail, im_livechat: 'is typing...' indicator on mail channels
With this commit, most threads show an indicator when a member is typing
something. e.g.

	"Mitchell Stephens is typing..."

Supported threads:

	- DM
	- (public & private) channels
	- Livechat (Website & Backend)

Unsupported threads:

	- mailboxes (e.g. 'Inbox')
	- document thread (= 'Chatter')
	- support channel (with `im_support` module)

Some technical details:

	- This is a mix between 'start'/'stop' and 'regular notify' strategies.
	- On typing text in composer: notify 'start typing' to all members of
	  thread.
	- On clearing text in composer: notify 'stop typing' to all members of
	  thread.
	- A member can only notify once every 2.5 seconds to the server when he
	  starts or stops typing something (throttled, buffered notify call).
	- On receiving a message from someone that is typing: determine that he is
	  no longer typing.
	- On non-empty and unchanged composer text for 5.0 seconds: automatically
	  notifies all members of thread that he is no longer typing anything.
	  (This is like a 'soft / cooperative sender' timeout).
	- On non-receiving a typing notification of someone after 60 seconds:
	  determine that he is not longer typing something (This is like a
	  'hard / receiver assumption' timeout).
	- When some types for more than 50 seconds straight: notify that he is
	  still typing something (again and again every 50 seconds).
	- When two or more people are typing something (Multi-User channels), it
	  displays at most 2 typing users (ordering rule: longer typers first):

	  	"Mitchell Stephens, Marc Brown and more are typing..."

	- Timing summary:

		- Usually 2.5 seconds uncertainty.
    	- Up to 5.0 seconds uncertainty on typer inactivity.
    	- Up to 60 seconds uncertainty on typer page reload / browser tab
    	  closed / etc.

Future Improvements:

	- Detect page reload or browser tab close with loose of longpolling
	  connection

Task-ID 28188
2018-08-13 14:17:40 +02:00