Commit Graph
53 Commits
Author SHA1 Message Date
Odoo Translation Bot b60f9bb739 [I18N] Update translation terms from Transifex 2018-11-18 01:28:38 +01:00
Odoo Translation Bot dcc077afc5 [I18N] Update translation terms from Transifex 2018-11-11 01:26:46 +01:00
Odoo Translation Bot 790bd62f14 [I18N] Update translation terms from Transifex 2018-11-04 01:27:12 +01:00
Odoo Translation Bot 29dc21ae4b [I18N] Update translation terms from Transifex 2018-10-28 01:25:21 +02:00
Odoo Translation Bot de265ce63e [I18N] Update translation terms from Transifex 2018-10-21 01:25:56 +02:00
Odoo Translation Bot e774b2cb1c [I18N] Update translation terms from Transifex 2018-10-14 01:23:43 +02:00
Martin Trigaux 57884ccdc8 [I18N] all: convert remaining model: translation entries
It should be model_terms:

Fixes odoo/docker#219

closes odoo/odoo#27664
2018-10-11 09:49:01 +00:00
Odoo Translation Bot b6c8919444 [I18N] Update translation terms from Transifex 2018-10-07 02:27:57 +02:00
Odoo Translation Bot a01c1bf5bf [I18N] Update translation terms from Transifex 2018-09-30 02:25:45 +02:00
Odoo Translation Bot 1d79bf0273 [I18N] Update translation terms from Transifex 2018-09-23 02:29:29 +02:00
Martin Trigaux ae1fed50d5 [I18N] export saas-11.5 source terms 2018-09-21 16:32:59 +02:00
Odoo Translation Bot 53908da50c [I18N] Update translation terms from Transifex 2018-09-18 18:08:33 +02:00
Martin trigaux 710f67ad4b [I18N] export saas-11.5 source terms
To match new model_terms syntax
2018-09-18 14:30:04 +02:00
Odoo Translation Bot e9111f46a6 [I18N] Update translation terms from Transifex 2018-09-16 02:21:25 +02:00
Odoo Translation Bot 0b2349ee41 [I18N] Update translation terms from Transifex 2018-09-14 11:30:58 +02:00
Odoo Translation Bot e8606ce00b [I18N] Update translation terms from Transifex 2018-09-02 02:24:05 +02:00
Odoo Translation Bot f22e61dc74 [I18N] Update translation terms from Transifex 2018-08-29 14:19:27 +02:00
Odoo Translation Bot 0da9da4c44 [I18N] Update translation terms from Transifex 2018-08-26 02:17:37 +02:00
Christophe Simonis 0ac7f8fbe6 [MERGE] forward port branch saas-11.4 up to dabe59df9c 2018-08-14 20:16:03 +02:00
Alexandre Kühn f2302dfb27 [REF][FIX] mail, im_livechat: various improvements (JS)
This commit makes a lot of small improvements of the JS of mail and
related modules.

	A. Mail Manager
	---------------

		im_support:

		- [REF] Slightly more robust way to determine a support
		        message, so that it more reliably falls back on
		        default kind of message (i.e. support channel UUID
		        should be clearly set).

		mail:

		- [REF] Improved method names for readability purposes.
		        Some examples:

		        - `fetchFromServer` becomes `fetchMailStateFromServer`
		        - `_initialize{*}` becomes `_update{*}FromServer`
		        - `_isModerator` becomes `_isMyselfModerator`

		- [REF] Use 'template' pattern design to make Include on
				Mail Manager much more robust. In particular,
				the flow is always as follow:

					1. Initialize internal state.
					2. Listen on buses.
					3. Fetch mail data from server.

		- [REF] Improved workflow for thread window workflow
		        (Shorter & more readable).

	B. Mail Tests
	-------------

		- [REF] Thread Window Tests crashes with clean message when
		        there are some thread windows open before running the
		        tests.

	C. (Model) Message
	------------------

		- [REF] Improved method names for readability purposes
				(e.g. `isAuthor` becomes `isMyselfAuthor`).

	D. (Model) Thread
	-----------------

		- [REF] Improved `init` parameters on each kind of thread.
		- [REF] 'Thread With Cache' has been renamed to 'Searchable
		        Thread': it embraces all kinds of threads that can
		        be used with the search view.
		- [REF] 'DM' has been renamed to 'DM Chat' (for clarity).
		- [IMP] New Livechat model in the backend.
		- [REF] No more direct instances of the Channel class: public
		        and private channels are now 'Multi-User' channels,
		        while DM Chat and Livechat are 'Two-User' channels:

		        This change has been made so that instances of classes
		        always have direct classes as "leaf" in the Class
		        modeling. It eases making changes to a certain model
		        without being too constrained by another model.

		- [REF] As a consequence of above changed, the method `isChat`
		        has been renamed to `isTwoUserThread`.

		        This is to avoid confusion with the terminology
		        'chat', which is more like a shortcut for 'quick real-
		        time conversation'. In other words, the property of
		        'chat' depends of the way to interact on a thread, not
		        of the intrinsic type of the thread.

		        Still, some parts have kept the terminology 'chat',
		        such as in the systray messagin menu.

		- [IMP] Added `message_added` and `message_posted` hooks,
		        which may be useful to easily hook on those events.

	E. Thread Widget
	----------------

		- [REF] Now uses a `mail.model.AbstractThread` for the
		        rendering of a thread, instead of a list of
		        `{mail.model.AbstractMessage}`.
		- [FIX] Stick thread scroll height to bottom on new rendering,
		        if it was previously at the bottom of the thread.
		- [REF] Option ORDER has its meaning changed: it now refers
		        to the chronological order of messages in the thread,
		        in which DESC means 'from top to bottom', while ASC
		        means 'from bottom to top'.
		- [REF] Improved doc on templates, in particular with the
	            option `ORDER`.

	F. Thread Window
	----------------

		- [REF] Moved more logic to thread windows, which were
		        previously in Mail Window Manager.
		- [REF] Now hides the thread widget attribute. So instead of
		        `threadWindow.threadWidget.isAtBottom()`, it uses
		        `threadWindow.isAtBottom()`.
		- [FIX] New received messages when not having focus on Odoo
		        tab should always make the corresponding thread
		        windows "passive" (i.e. windows that keep threads
		        unread until click on them).
		- [FIX] Blank thread window (i.e. 'New message' TW) correctly
		        opens Discuss with 'Inbox' when clicking on 'Expand'
		        Button in the title
		- [FIX] Do not display the composer for channels with property
		        'mass-mailing' set in thread windows.

	G. (Website) Livechat
	---------------------

		- [REF] Some `trigger` have been turned into `trigger_up`.
		- [REF] Some logic has been moved to models (e.g.
		        `{im_livechat.model.WebsiteLivechat}`), from
		        `{im_livechat.im_livechat.LivechatButton}`.
		- [FIX] New messages should be received in real-time. The
		        longpolling was broken with a recent refactoring on
		        bus service (6448420c5d).
2018-08-13 14:17:27 +02:00
Odoo Translation Bot 566d1586bc [I18N] Update translation terms from Transifex 2018-08-12 07:14:34 +02:00
Christophe Simonis 7499b47ffa [MERGE] forward port branch saas-11.4 up to edd586002e 2018-08-10 13:37:21 +02:00
Christophe Matthieu 6448420c5d [IMP] bus: re-factoring of bus.bus (Longpolling and CrossTab)
The purpose of this change is to make the code clearer and testable.

In this change, the 'tab_manager' static object was merged with the bus
cross tab.

Cleaning was done to clearly define private and public functions as well
as handlers. The methods are documented and the constants are now defined
on the class. The bus use the service behavior with 'trigger_up'.

'bus.CrossTab' who extend 'bus.Longpolling' are instantiated by the
bus service.

The class is always instantiated with a parent, or root in the case of the website
(im_livechat), to use the ajax and localstorage services. So the behavior, perhaps
logger or redefined by the parents.
2018-08-09 02:31:59 +02:00
Christophe Matthieu 791c70b329 [FIX] web: in the test the mocked services use the tests features
Must move the service construction to intercept the request with the
test parameters
2018-08-09 02:31:59 +02:00
Fabien Pinckaers 7f9e7f0c96 [IMP] *: only show 'learn more' when there is a web page describing the module 2018-08-06 11:57:41 +02:00
Odoo Translation Bot c1c5785e92 [I18N] Update translation terms from Transifex 2018-08-05 07:15:10 +02:00
Odoo Translation Bot 935bac15df [I18N] Update translation terms from Transifex 2018-08-03 10:55:14 +02:00
Odoo Translation Bot 8aed99b0bd [I18N] Update translation terms from Transifex 2018-08-02 14:39:54 +02:00
Martin Trigaux 6b2dcd064d [I18N] export saas-11.4 source terms
For odoo-master transifex project
2018-08-02 13:32:24 +02:00
Christophe Simonis 4797627259 [MERGE] forward port branch saas-11.4 up to 8d9366197e 2018-08-01 18:02:29 +02:00
Christophe Simonis a719cf2563 [MERGE] forward port branch saas-11.3 up to b4555df336 2018-07-30 17:02:28 +02:00
Odoo Translation Bot 26aff789c9 [I18N] Update translation terms from Transifex 2018-07-29 07:17:30 +02:00
qsm-odoo d8c217a67d [REF] *: BS4, review color system
Odoo used to declare two main colors: primary and optional (which are
purple and turquoise in enterprise). Those were respectively assigned
to the 'primary' bootstrap variable and the 'btn-primary' bootstrap
variable.

BS4, however, does not allow to have a different primary color for
buttons. Instead, the 'primary' color is used for all 'primary' related
components and utility classes, same as for all other colors. So, if we
want to keep our enterprise buttons green, our 'optional' colors had to
become our 'primary' color. The old odoo primary is then renamed to the
'odoo' color.

The palette of grays is now larger by default and is numbered from 100 to
900 alongside the $black and $white variables. The equivalence for older
variables and the way we used them is:

$gray-darker          ->  gray 900 (unused before)
$gray-dark            ->  gray 900
$gray                 ->  gray 700
$gray-light           ->  gray 600
$gray-lighter-darker  ->  gray 400 (the old variable was created by us)
$gray-lighter-dark    ->  gray 300 (the old variable was created by us)
$gray-lighter         ->  gray 200

Fortunately, the 'lighter' variations we created fit well in the default
BS4 system ! Unfortunately, our $gray-lighter which carried the same
function as $gray-200 (see above) is very close to the new default
$gray-100 and quite distant from the new $gray-200. This will be handled
in the next commit.
2018-07-27 12:36:54 +02:00
qsm-odoo 1c1c0897e8 [REF] *: BS4, adapt dropdowns and carets
- The dropdown structure was simplified, allowing to get rid of the
  3-levels structure induced by <ul/> elements and dropdowns can now
  contain anything. The class 'dropdown-item' is now mandatory for
  each dropdown clickable element. The class 'dropdown-item-text' can
  be used to add same padding and style but without making the element
  have a clickable look.

- Dividers now use the class 'dropdown-divider'

- The way dropdowns are opened and hidden also changed (before the
  'open' class was added on the `.dropdown-menu` parent, now the
  'show' class is added on both the `.dropdown-menu` parent and the
  `.dropdown-menu` itself).

- JS-wise, no click event handlers can be put on `.dropdown-toggle`
  elements anymore (instead, use handlers for dropdown events).

- Carets are automatically put on `.dropdown-toggle` elements, so this
  commit replaces the `.caret` elements with this. This feature was
  possible to disable but would prevent us from adding a caret with
  scss. Also, this simplifies the DOM. The 'o-no-caret' class was also
  introduced to allow using the 'dropdown-toggle' class on non-caret
  elements.

- Also adapt the scss to use $caret-width instead of $caret-width-base
2018-07-27 12:36:54 +02:00
qsm-odoo 770aec399c [REF] *: get rid of vendor prefixes
BS4 do not provide vendor prefixes scss mixins anymore as it is meant
to be used with the 'autoprefixer' library. As we only support the last
version of every major browsers in Odoo, we took the decision to not
use the library as it was also complex to integrate in Odoo. We decided
to do the library's work by hand if it ever become necessary.
2018-07-27 12:36:54 +02:00
Christophe Simonis ba202dbe63 [MERGE] forward port branch saas-11.2 up to 3c521f6d05 2018-07-24 18:10:32 +02:00
Christophe Simonis 4e76173a43 [MERGE] forward port branch 11.0 up to 219d2296d6 2018-07-23 16:03:25 +02:00
Alexandre Kühn d7741c7c55 [FIX] im_support, mail: correct style and classname
The style for preview info in the systray were incorrect.
Also, mailbox had the old classname ('o_channel_name'), instead of the new one ('o_thread_name')
2018-07-19 14:01:58 +02:00
Alexandre Kühn 55fc06c867 [FIX] mail: clean docstring
- updated docstring
- move function to abstract thread (generalization behaviour for all threads)
- simplify code
2018-07-19 13:58:34 +02:00
Alexandre Kühn 915da49d17 [IMP] mail, *: template rendering with abstract thread, adapt thread instantiation, thread getMessages/fetchMessages, and create mode document thread.
* = im_livechat, im_support

- thread widget now uses abstract thread in `render` method
- thread models have their `init` parameters changed, so that the parent may be optional
- reworked 'creating a new record...' in chatter in create mode:
    > new model CreateModeDocumentThread, which basically is a fake document thread
      with a fake message for its rendering in create mode of the chatter
    > special rendering method of thread_widget for such case: `renderChatterCreateMode`
- renamed thread methods previously named `getMessages` to `fetchMessages`:
    > in order to not conflict with `getMessages`, used for rendering
    > now, `getMessages` always get messages that are locally,
      while `fetchMessages` may fetch messages.

TODO:
    - special thread model for im_livechat (rendering is broken ATM)
2018-07-19 13:58:34 +02:00
Odoo Translation Bot e8fc62ec74 [I18N] Update translation terms from Transifex 2018-07-11 10:16:33 +02:00
Aaron Bohy 64d3271cc0 [ADD] im_support: test suite
This revs. add a new test suite for the im_support module. Defining
a new suite was necessary as the im_support JS feature needs
specific keys to be defined in the session, otherwise its files are
simply skipped.
2018-07-02 15:12:31 +02:00
Aaron Bohy 01bf6f4383 [FIX] im_support: support message init()
Service calls only work when the parent and event dispatcher mixing is set.
In this case, this is after the `_super` call.
2018-07-02 15:12:31 +02:00
Alexandre Kühn cd34f6de72 [REF] mail: JS mail refactoring
----------------------
 Summary
----------------------

The purpose of this commit is to improve the JS code of the `mail` module.
It applies the new coding guidelines and makes some changes on the design
of some modules, such as the old ChatManager module.

Here is a short summary of the changes that have been made:

  1. New coding guidelines
    - snake_case to camelCase
    - prefix private attributes and methods with '_'
    - jsdoc on most methods
    - one class per module
  2. Rename/Merge some classes
    - 'chat manager' becomes 'mail manager' (internal) and 'mail service' (external)
    - 'chat window manager' is now included in mail manager
    - 'thread' widget now named 'thread widget'
  3. New model abstraction for mail objects:
    - modules 'mail.model.*'
    - modeling:

                    0..1    0..1        *     *
      ThreadWindow  <------>  Thread <-------> Message
                              /    \
                             /      \
              Thread With Cache     Document Thread
               /      |       \
              /       |        \
        Mailbox    Channel    Support Channel
                      |
                      |
                      DM

    - Thread: the superclass of threads.
    - ThreadWindow: the window component of a thread.
    - Message: mail objects representing messages.
    - Thread With Cache: threads that can be used with search view (Discuss app compatible).
    - Document Thread: represents the thread part of a chatter.
    - Mailbox: represents what was previously called 'static' channel, e.g. 'Inbox'.
    - Channel: mail objects representing channels, including livechat.
    - DM: special kind of Channel for 1:1 communication in the backend.
    - Support Channel: special channel for im_support module.

  This new modeling approach let us easily add features on all threads, such as the
  possibility to put any thread in a small window.

----------------------
 Known issues
----------------------

 [Already Present in Master]

    1. When the Discuss app is in the background with 'Inbox' as the selected
       Thread, when clicking on a document thread preview in the messaging menu
       of the systray, the rainbow man appears.

    2. When a document with the chatter is in the background, when receiving an
       inbox notification from this document thread, the document thread is
       automatically marked as read, which removes the notification right away.

    3. Sometimes, opening a DM window from the "blank" thread window does not work.

    4. Reply-to feature on Inbox is not working: no message is sent in the document
       thread.
    5. On the first login of admin user with demo data, the inbox counter is wrong
       (it displays 6, instead of 3).

       Explanation after investigation:

        > On page load, it fetches the correct number of Inbox messages (3),
          but the server notifies of 3 needaction messages right away,
          so it wrongly assumes these are new needaction messages.
        > Not possible for web client to detect that these messages should not
          increment the Inbox counter while keeping same API.

    6. Notifications for new document thread messages only work when the user sets
       'handle with Odoo' for the Notification Management in the preferences.

        > due to notifications on the longpoll bus for document thread
          messages that come from needaction notifications.
        > requires server-side changes to send notification on the longpoll
          bus to mentionned user.

  [New]

    7. When receiving a message on a unjoined channel, thread window flickers
       ('open' > 'close' > 'open')

        Explanation after investigation:

          > JS logic:

            a) On auto-join, ask server to join the channel and get channel infos.
            b) The info tells the channel is not detached, but JS code makes decision
               to detach it, and tells server the channel is now detached.
            c) From (a), server notifies on longpoll bus the state of channel, which is
               not detached. The web client thinks that the window state of the channel
               has been changed somewhere else, and the channel is now closed.
            d) From (b), server notifies on longpoll bus the state of channel, which is
               detached. The web client opens the thread window of this channel.

          > The flicker didn't occur before refactoring because the web client was only
            updating the model of channel when it receives the longpoll notification.
          > Server behaviour on 1st longpoll notification is necessary for cross-tab
            synchronization for channel window state.
          > New design implies that model and view should be synchronized, hence the
            issue now.
          > Solution: remove server-side thread window synchronization and replace with
            client-side synchronization.

----------------------
 Hacks
----------------------

The module `im_livechat` now uses mail objects that are compatible with Message
and Window objects:

      Modeling for messages:

                             AbstractMessage
                              /           \
                             /             \
                    LivechatMessage      Message

      - AbstractMessage: message compatible with the thread widget.
      - LivechatMessage: message used by im_livechat.
      - Message: message used with the mail manager.

      Modeling for thread windows:

                          AbstractThreadWindow
                              /           \
                             /             \
                    LivechatWindow    ThreadWindow

      - AbstractThreadWindow: behaviour share between all types of thread windows.
      - LivechatWindow: window used by im_livechat.
      - ThreadWindow: window used with mail_manager.

The reason for these hacks are twofold:

  1. Use the thread widget in the frontend and livechat external lib bundles.
  2. Do not have a dependency with the mail manager in the frontend and external
     lib bundles.
2018-07-02 15:06:54 +02:00
Christophe Simonis c8bb02141d [MERGE] forward port branch saas-11.3 up to 3cdcbce93c 2018-06-28 19:01:52 +02:00
Christophe Simonis 3cdcbce93c [FIX] im_support: make js tests pass 2018-06-28 17:00:37 +02:00
Christophe Simonis 40836194c2 [MERGE] forward port branch saas-11.2 up to 12ddec3a76 2018-06-27 13:41:00 +02:00
Odoo Translation Bot 33e18a0051 [I18N] Update translation terms from Transifex 2018-06-27 11:22:41 +02:00
Martin Trigaux cb00803473 [I18N] export saas-11.3 translations
To odoo-master Transifex project
2018-06-25 10:33:05 +02:00
Alexandre Kühn e503b0b3a4 [FIX] im_support: fix style of attachment button in discuss composer
Before this commit, there was a visual bug on the attachment button
of a composer in discuss: instead of being next to the emoji button,
it was places below it.

This is due to the intent of displaying the attachment button only
for threads that are not the support channel. To do so, it uses the
jQuery methods `$.show()` and `$.hide()` on the considered DOM element.

The problem is that these methods change the `display` attribute of the
DOM element, so that when `$.show()` is called, it sets the display to
`block`, which causes the visual glitch.

With this commit, we use the classname `o_hidden` instead of the jQuery
methods, so that the attribute `display` is unchanged.
2018-06-22 16:31:54 +02:00