Commit Graph
2088 Commits
Author SHA1 Message Date
Christophe Simonis a0d7763e09 [MERGE] forward port branch saas-11.2 up to 932e641be1 2018-02-23 17:20:52 +01:00
Prakash Prajapati 30a5ddbe82 [IMP] mail: Discuss inside alignment 'Add a channel' field with a channel list 2018-02-22 16:50:21 +01:00
Alexandre Kühn 1753017255 [FIX] mail: prevent crash when focusout emoji button
Before this commit, on a clear session, there was a traceback
after focusing out the emoji button next to the composer.

This is due to a DOM element that exists only after clicking on
the emoji button, and it was wrongly assumed that focusout cannot
occur without a preceding click. Indeed, we can press TAB to move
between focusable elements, so that we can have the focus in/out
on the button without clicking on it.
2018-02-22 14:23:04 +01:00
Alexandre Kühn 497a44ab7f [FIX] mail: let TAB cycle through @ mention propositions
Before this commit, when the partner mention propositions dropup was visible
on discuss composer, pressing on TAB result in selecting the next focusable DOM
element after the composer input, which is usually the 'Send' or 'Log' button.

This behaviour is confusing, because users expect that TAB either autofill the
input or cycle through the propositions.

We decided to align on Slack's behaviour of TAB, which is to cycle through
the mention popositions from top to bottom.
2018-02-22 14:23:03 +01:00
Alexandre Kühn 5532825851 [FIX] mail: show mention link at the end of a message content
Before this commit, when mentioning a user at the end of a message,
no link was shown.

The cause is that any mention should end with whitespace, but during
the preprocessing of a message, the message is trimmed, which removes
the final whitespace of the mention.

We would like to keep trimming at the preprocessing of the message,
but we can relax a bit the regex to detect a mention, so that it is
not necessary to have a whitespace at the end of a matched mention.
2018-02-22 14:23:03 +01:00
Alexandre Kühn 89e2679f08 [FIX] web: tests: turn patchWindowGetSelection stateless
test_utils.js contains helper functions, which should be stateless
(good practices). This was not the case with patchWindowGetSelection
and unpatchWindowGetSelection, so instead we keep only the first
function which returns the second one.

From the test POV, instead of this:

    utils.patchWindowGetSelection();
    // ...
    utils.unpatchWindowGetSelection();

It now looks like that:

    var unpatchWindowGetSelection = utils.patchWindowGetSelection();
    // ...
    unpatchWindowGetSelection();
2018-02-22 14:23:03 +01:00
Christophe Simonis 9a84ba5533 [MERGE] forward port branch saas-11.1 up to e750bb6e11 2018-02-22 10:39:15 +01:00
Christophe Simonis ae6a65753e [MERGE] forward port branch 11.0 up to dbb713c2f8 2018-02-21 20:19:26 +01:00
Christophe Simonis dbb713c2f8 [MERGE] forward port branch saas-16 up to 49f8548557 2018-02-21 19:17:01 +01:00
Christophe Simonis 49f8548557 [MERGE] forward port branch saas-15 up to 085ff2f9c4 2018-02-21 18:36:36 +01:00
Christophe Simonis 085ff2f9c4 [MERGE] forward port branch saas-14 up to 8c692aac88 2018-02-21 18:09:17 +01:00
Christophe Simonis 68379cadbc [MERGE] forward port branch 10.0 up to 2bdc0cc7eb 2018-02-21 16:37:49 +01:00
Nicolas Lempereur e2280783a2 [FIX] mail: no view edit on forum link in notif
When sending notification from the frontend, if a template is rendered
for it and the user has the group "website.group_website_publisher" he
will get inherit_branding adding on elements things like:

  data-oe-id="42" data-oe-model="ir.ui.view" data-oe-field="arch"

but the chatter system has feature automatically redirecting an element
that have attribute "data-oe-id": this caused for example that a
link notification towards the forum would instead be redirecting to
editing the view of the notification.

This fix distinguish the inherit_branding in the chatter feature and
ignore them.

opw-813333
closes #23225
2018-02-21 13:39:25 +01:00
dbh 2b17b7e83d [FIX] mail: fix several traceback from a recent refactoring
Revision on https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498

This commit fixes some leftovers from an intermediary state of the refactoring above.

The following tracebacks should be fixed:
    - unsubscribe from a private channel
    - replay
    - inviting a user
2018-02-20 13:33:02 +01:00
dbh 7e4a8c03f1 [FIX] mail: correct chat window dropdown unread counter + hidden state
Revision on recent JS refactoring: https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498

Intermediary changes have not been updated with final way of communicating
with JS services. In particular, widgets must now explicitly call the
service with this.call instead of relying on a mixin that hides the service call
(e.g. the chat_mixin that has been removed)
2018-02-20 13:33:01 +01:00
Alexandre Kühn f40abe400a [FIX] mail: check not broken @ mention in discuss
Rev. on this commit: https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498

A consequence of the above commit is that @ mention were broken:
the dropup menu with partner propositions was not displaying when
the user typed the first characters to mention a user (e.g. by typing
"[at]demo" in order to show the proposed mention "[at]Demo User" in a dropup
menu).

This commit fixes the issue by reverting the logic of how mentions are provided
by the chat_manager, while removing some dead code.

note: [at] = @
2018-02-20 13:32:57 +01:00
Alexandre Kühn 22f04b4023 [FIX] mail: tests: improved mock_server mocked initMessaging
Before this commit, if we wanted to add channels on rpc initMessaging,
we had to mock this rpc completely.

Now, with this commit, we can use data 'initMessaging', whose keys
can overwrite the default mocked initMessaging.
For instance, if this.data.initMessaging has the key 'channel_slots',
then the mocked initMessaging rpc will return a new state for the
existing channels to the chat_manager.

This is needed in order to reduce the size of tests than need some custom
initMessaging state, such as any test that needs at least one non-static
channel (i.e. neither channel_inbox nor channel_starred).
2018-02-20 13:31:23 +01:00
Vincent Schippefilt 275910e38c [FIX] tests : avoid phantomjs to crash because of window.getSelection
Before this commit, phantomjs was crashing when some code manipulates
window.getSelection (such as the composer input in discuss or in the chatter).

This commit lets us mock window.getSelection in tests that need this function
in order to work properly.

Another benefit of this commit is the possibility to simulate the state of
window.getSelection in our tests, which enables tests on the composer that
were not possible before (e.g. making sure that mentions and emojis are
correctly rendered in the input, after the user clicked on them in the dropup
menu or the bottom bar.
2018-02-20 13:31:22 +01:00
Alexandre Kühn 9f2ec57a7e [FIX] mail: tests: add basic rendering test for discuss
This commit adds a first test of discuss, which checks that the
essential DOM elements are present when we create a discuss widget.

In particular, there should be a sidebar that contains links to
channel_inbox and channel_starred.
2018-02-20 13:31:22 +01:00
Alexandre Kühn 2a09baf0ed [FIX] mail: tests: make createDiscuss function async
In order to test discuss, the service 'chat_manager' has to be ready.

We do not want to explicitly write discuss.call on any test with discuss,
so now the function createDiscuss returns a promise that is resolved with
the discuss widget when the chat_manager is ready.
2018-02-20 13:31:21 +01:00
Alexandre Kühn 9360a39dca [FIX] mail: tests: mock fetch messages rpc
Discuss has to perform a rpc to fetch messages of its channels.
Some tests do not care of the result of this rpc call, so we mock
it by default (by default, channels have no messages in our tests).
2018-02-20 13:31:20 +01:00
Nicolas Lempereur 88a4c3b5bd [FIX] mail: IP domain name when linkifying
In chatter, also linkify URL with IP address as domain name like it may
be in other part of Odoo (eg. plaintext mail received).

With this change, an URL:

http://192.168.0.1:8069/web

would be linkified.

opw-816175
closes #23153
2018-02-19 16:40:21 +01:00
XavierDo 813065cb5b [IMP] mail: add settings button on channels
The settings of a channel were available in debug mode only. Adding a settings button on each channel allows to read/edit a channel settings easily.

Remove the unsubribe button and the settings button from the top of the page since they can be acceses another way now.
2018-02-19 09:48:38 +01:00
Alexandre Kühn aa8745f1a8 [FIX] web,*: various nocontent helper fixes
* account, board, hr_holidays, mail, sale, website_sale

Small fixes on nocontent onboarding screens.

Initial commit: https://github.com/odoo/odoo/commit/a87d761fdbf345ada5dc93e0a686b08a0f5a0417

Details:

- list: centered;
- pivot/graph: centered + empty folder face;
- Dashboard app with nocontent helper;
- Discuss inbox/starred: centered without neutral/smiling faces;
    => no faces because it's too much with animated
       rainbow man when emptying the any of the boxes.
- hr_holidays: fixed onboarding screens;
- (technical) dropped obsolete 'o_view_nocontent_container' style;
- manual reconciliation 'nothing to reconcile': centered + inside form sheet;
    => renamed account's o_view_nocontent to o_view_noreconciliation,
       so that it doesn't use the style of views.less.
- kanban: nocontent helper above the columns (if any);
- texts "no order to upsell"/"abandonned cart" paragraph split in two.
2018-02-16 10:23:01 +01:00
Christophe Simonis adeea2a88d [MERGE] forward port branch saas-11.2 up to 0f02dcb639 2018-02-12 18:34:43 +01:00
Christophe Simonis 0f02dcb639 [MERGE] forward port branch saas-11.1 up to c69d00157e 2018-02-12 18:08:27 +01:00
Alexandre Kühn 7339ae978f [FIX] mail,web,*: Cleaning some JS code
- Whitespace trailing
- Split long lines
- Replace some 'self' to 'this'
- Improved some JS docs
- DRY in tests using services
2018-02-12 16:09:38 +01:00
Alexandre Kühn 066eaaeafa [FIX] mail,web: JS mail and services tracebacks
Fix over this commit: https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498

In mobile, when discuss is installed, there is a traceback.

This is a consequence on an issue with JS services, where some of them
are not registered in the service provider.
For instance, the webclient (the service provider) was instantiated before
chat_manager (a service), so it was not aware of this service.

To solve this issue, service providers now listen on newly registered services.

Also improving deployment of JS services by not relying on topological sort.
2018-02-12 16:09:38 +01:00
Aaron Bohy c265e47a63 [FIX] web,*: tests: remove src attr from img nodes
In the tests environmnent, we don't want img and iframe nodes to
perform RPCs when they are inserted into the DOM. For img nodes,
we prefixed the src attribute by '#test: ' as soon as they were
inserted into the DOM. Unfortunately, this didn't work as expected:
an RPC was done to fetch route '/web/tests?' (i.e. the tests page),
because everything after '#' in the url isn't sent to the server.

This rev. completely removes the src attribute of img nodes, and
set a 'data-src' attribute with the original src attribute's value,
so that it can still be checked in the tests.

Tests using this attribute have been adapted accordingly.
2018-02-12 11:13:42 +01:00
Christophe Simonis 5f3301e5cb [MERGE] forward port branch 11.0 up to 20e4cd5bcd 2018-02-09 16:13:08 +01:00
Christophe Matthieu 3b2127c690 [FIX] web: properly set parent when using mixins
The parentedMixin doesn't automatically set the parent, so when this mixin
is used, the parent must be set manually. This wasn't done at several places,
and thus those elements weren't destroyed with their actual parent.

In master, we should probably make the ParentedMixin set the parent itself.
2018-02-08 15:46:41 +01:00
Christophe Matthieu 1d49d52b3a [FIX] web: properly set parent when using mixins
The parentedMixin doesn't automatically set the parent, so when this mixin
is used, the parent must be set manually. This wasn't done at several places,
and thus those elements weren't destroyed with their actual parent.

In master, we should probably make the ParentedMixin set the parent itself.
2018-02-08 15:46:00 +01:00
Christophe Matthieu 4f5fc6ee55 [FIX] web: properly set parent when using mixins
The parentedMixin doesn't automatically set the parent, so when this mixin
is used, the parent must be set manually. This wasn't done at several places,
and thus those elements weren't destroyed with their actual parent.

In master, we should probably make the ParentedMixin set the parent itself.
2018-02-08 15:45:30 +01:00
Nicolas Lempereur c123049805 [FIX] mail: notif display form view not kanban
In mail change about activities in 07f1e902 when opening the record of a
notification, kanban view was in the action views but there doesn't seem
to be a reason and this caused an issue on enterprise mobile (since
kanban view if available has priority).

opw-804529
closes #22848
2018-02-06 15:53:25 +01:00
Christophe Simonis bba0bc6ded [MERGE] forward port branch saas-11.2 up to eefca5d492 2018-02-05 17:21:35 +01:00
Christophe Simonis eefca5d492 [MERGE] forward port branch saas-11.1 up to 73610ff992 2018-02-05 16:20:48 +01:00
Christophe Simonis 33bf2fe922 [MERGE] forward port branch 11.0 up to aed8f45346 2018-02-05 15:06:55 +01:00
Kinjal Mehta 4b78e71806 [IMP] crm: use partner's phone and email on the lead
When available, use the phone and email on the partner
When creating a partner, use the information already available

Task id: 35420

Closes #18660
2018-02-05 16:33:57 +05:30
Nicolas Martinelli 352be6b6df [FIX] mail: date format
Use a date format in order to display the due date of an activity since
it is a date filed, not a datetime.

Closes #22614
opw-813736
2018-02-05 09:07:38 +01:00
Christophe Simonis e00a447e2c [MERGE] forward port branch saas-11.1 up to 7e469eb77a 2018-02-01 18:20:28 +01:00
Christophe Simonis 7e469eb77a [MERGE] forward port branch 11.0 up to f5e7b86686 2018-02-01 18:15:21 +01:00
Christophe Simonis f5e7b86686 [MERGE] forward port branch saas-16 up to 920aa6174c 2018-02-01 17:02:19 +01:00
Christophe Simonis 920aa6174c [MERGE] forward port branch saas-15 up to e0422bfd6c 2018-02-01 16:40:13 +01:00
Christophe Simonis e0422bfd6c [MERGE] forward port branch saas-14 up to 7d465aa56c 2018-02-01 15:39:39 +01:00
Arnold Moyaux 17f5f74af9 [IMP] mail: redirect on mail activity
Allow to redirect on a form view when the user click
on a html tag a with data-oe-model and data-oe-id specified.

In order to avoid code duplication the do_action already existing in
mail_thread is moved in the action_manager and mail_thread and mail_activity
use a trigger_up in order to call it.
2018-02-01 15:26:59 +01:00
Aaron Bohy 02ec09cb1c [REF][IMP] *: mail js refactoring
This commit improves the JS code of the mail module,
which comes maily from the new coding guidelines
and the addition of "JS services".

JS services are important objects that do not fit
well in the component tree, such as chat_manager
or ajax.

The benefits of JS services are improved readability
of the code, reduced coupling, and more testable
modules. In particular, discuss was hard to

Summary of the changes:

- ClientAction has been renamed into Discuss
- Clear instantiation of chatManager
- New coding guidelines in most mail modules
- JS Services can interact with each other
- Chat Manager and Window Manager are services
- Window Manager renamed to Chat Window Manager
- bus.bus is now encapsulated in Bus Service (a service)
- The test infrastructure has been tweaked with JS Services
- Chat Mixin has been removed

A future improvement would be to translate some 'trigger' into 'trigger_up'.
2018-02-01 14:51:58 +01:00
Christophe Simonis 7d465aa56c [MERGE] forward port branch 10.0 up to 4c9bf7faae 2018-02-01 14:16:50 +01:00
adekock11 9dce2be273 [FIX] mail: display notification when explicitly grant it
Instead of looking for the "denied" permission, rather look for the "granted"
since there are three permissions: "default", "denied", "granted" - only
"granted" counts toward permission actually being granted

Closes #22633
2018-01-31 10:44:00 +01:00
Xavier-Do c99de45515 [IMP] chatter: improve chatter readability
Only messages as comments and email template should keep a white backround since they are not internal.

It is also enough to display fields that changed on subtypes (update message) since emails will be reworked soon and more information will be given there. The support of 'always' track can be removed. (is now considered as a simple tracked field)

The use of self.env.ref('mail.mt_comment').id add some query and the performance tests needs to be update since message_format is called by notify_by_chat. This code will be refactor later
2018-01-30 14:49:03 +01:00
Aaron Bohy cf178a2f06 [IMP] web,*: config: add XXS size to config.device
In Less, the size_class XXS is defined and used in media queries.
This rev. adds it in JS for sake of consistency.

Code in addons comparing the size_class needed to be adapted due
to the new XXS size_class.

Moreover, we now use the helper 'config.device.isMobile' everywhere
we should, instead of manually comparing the size_class.

Finally, we changed the way the config.device has to be specified
in the test environment. From now on, only the size_class should be
set, and the isMobile flag is computed automatically.
2018-01-26 19:26:03 +01:00