Commit Graph
26 Commits
Author SHA1 Message Date
Louis Wicket (wil) c8cfc58ea8 [IMP] mail, *: rename messaging initializer model
Rename javascript model `mail.messaging_initializer` to
`MessagingInitializer` in order to distinguish javascript models from
python models.

Part of task-2701674.
* = crm_livechat, im_livechat, mail_bot

closes odoo/odoo#81387

Related: odoo/enterprise#22889
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 00:10:51 +00:00
Louis Wicket (wil) 2cb3f774a1 [IMP] mail,*: change model declaration syntax
* = calendar, crm_livechat, hr, hr_holidays, im_livechat, mail_bot, sms,
     snailmail, website_livechat

This commit will change the declaration of the models with the aim of
getting closer to a plain JSON-object. It allows us to eliminate a wide
portion of boilerplate code, making the declaration shorter, more
declarative, and less redundant, but mainly, it prepares the ground for
further changes.

Task-2695223

closes odoo/odoo#79259

Related: odoo/enterprise#22042
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-23 17:53:46 +00:00
Louis Wicket (wil) 53a7c81276 [IMP] mail_bot: remove unused file
Remove unused file.

closes odoo/odoo#79183

X-original-commit: 65f1cacbc4c047233c807ba045f03e0c3b679cd1
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-29 11:06:00 +00:00
Louis Wicket (wil) 80d74e7ee0 [IMP] mail, web, *: add support for guest users
* = crm_livechat, hr, hr_holidays, im_livechat, mail_bot, purchase, sms,
    snailmail, survey, test_discuss_full, test_mail, web_editor, website,
    website_livechat

 - Create new model `mail.guest` for guests.
 - Rewrite some RPCs to target routes rather than model methods so that
   guests are able to use them.
 - Patch JS and python models to support guests.
 - Create a stand-alone page and boot the channel in it.

task-2494829

closes odoo/odoo#75496

Related: odoo/enterprise#20417
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-02 00:43:34 +00:00
yograj tandel fa6222e7fd [REM] mail, *: remove bugfix files
currently, Across Odoo, there are bugfix folder in around 13 module,
New manifest system allows to add new files in stable so the bugfix files are no
longer required.

after this commit,
all the bugfix files are removed from all module.and all the code in those file
is maintained as per New manifest system.

Task : 2510653

closes odoo/odoo#69830

Related: odoo/enterprise#17936
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-04-27 08:34:58 +00:00
Qiuyu (QHO) bd67479316 [REF] mail, mail_bot, im_livechat, *: convert JS files to ES6 modules
task id: 2487514

closes odoo/odoo#69376

Related: odoo/enterprise#17749
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-04-19 13:33:35 +00:00
Krina Oza 036b7720d0 [IMP] various: Updated App icons for various modules
In this commit icons of the following modules are updated:

-fetmail
-hr_skills
-iap
-mail_bot
-microsoft_calendar
-partner_autocomplete
-payment_alipay
-payment_odoo_by_adyen
-payment_payulatam
-sale_timesheet
-sms
-snailmail
-test_exceptions

TaskID:2378861

closes odoo/odoo#62291

Related: odoo/enterprise#14958
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-11-25 11:09:53 +00:00
Krina Oza 42965b16cb [IMP] various: Update the app icons
Purpose of the task is to update the icon of the various modules.

So in this commitn updated App icons of the following modules:

-fetchmail
-iap
-mail_bot
-partner_autocomplete
-sale_timesheet
-sms
-snailmail

Related PR: https://github.com/odoo/enterprise/pull/14408

closes odoo/odoo#60817

Taskid: 2369682
Related: odoo/enterprise#14408
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-27 13:19:20 +00:00
Sébastien Theys 590a088750 [FIX] mail, *: fix opens and redirects, adapt messaging menu close
task-2244279
task-2262862
task-2274993
task-2277537
task-2282238

closes odoo/odoo#56755

X-original-commit: 17611f4adc5e950b0a75a2a6615b1da3c956387f
Related: odoo/enterprise#12769
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-08-28 17:34:13 +00:00
Didier (did) bc5654f0a4 [IMP] mail, mail_bot: move notif request and OdooBot name into mail
task-2282334

closes odoo/odoo#56616

X-original-commit: bde23b82029507e525cf55d11b050af5f820a06b
Related: odoo/upgrade#1705
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-08-26 15:49:21 +00:00
Sébastien Theys c2918c139b [IMP] web, *: improve mock server and replace most mail mockRPC
Improve mock server:

- add support for mocked `fetch`
- add support for `active_test`
- add support for x2m `in` in domains
- add support for default values computed from a function
- implement a more natural "next id" compute
- allow initial data without ids
- ensure write and x2m commands integrity
- improve bad data/bad commands error messages
- always warn for failing RPC, not only in debug mode
- fix all existing tests that had inconsistency data

Other changes done in mail (or dependents) that are not just related to tests:

- remove `direct_partner` from formatter result
  ->`correspondent` can be computed from other keys, especially `members`

- fix `livechat_visitor` convertData
  -> only process if there is value

- add `current_partner` and `current_user_id` as `init_messaging` result
  -> easier to mock than session

- remove usage of `need_moderation`
  -> that was just a search indirection to `moderation_status`

- adapt `partner_id` -> `res_partner_id` key in `_notification_format`
  -> to be consistent with field name

- add name in result of `mail_partner_format`
  -> sometimes display_name is not the same

- remove usage of `is_moderator`
  -> that was just an indirection to `moderation_channel_ids`

Enterprise counterpart: https://github.com/odoo/enterprise/pull/11523
task-2287171

closes odoo/odoo#55854

X-original-commit: 7ba3fecb3377a720d1eb70e7515a0c45da73836d
Related: odoo/enterprise#12391
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-08-13 16:26:35 +00:00
Sébastien Theys 6da8fac5f4 [FIX] mail_bot: fix OdooBot not starting
- fix initializer start override (typo in method name)
- properly wrap async code in models
- disable OdooBot for System user
- use existing python method to create chat

task-2284584

closes odoo/odoo#53669

X-original-commit: 47bbfeab9e238ab542d16bf4ed17d60ad6aea50d
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-25 12:54:26 +00:00
3fea5b2136 [REF] mail, *: refactor messaging with OWL
This commit is a significant rewriting of client-side discuss, chatter,
chat window, and messaging menu using OWL. The behavior should be broadly
the same, with some slight functional changes here and there.

From a technical standpoint, the code of messaging is mainly organized in 2
main groups of modules:

- models, which are logical entities that depict the client-side state of
  messaging as a whole.
- components, which are in charge of displaying information from models.

This refactoring also introduces new JS guidelines regarding folder structure
(/static) and naming rules for JS modules.

Community PR: https://github.com/odoo/odoo/pull/39023
Enterprise PR: https://github.com/odoo/enterprise/pull/6249

Task-1914207

This PR is a collaborative work by Alexandre, Julien, Sébastien and Xavier,
with the precious help of Lucas to speed it up towards the end.

closes odoo/odoo#39023

Related: odoo/enterprise#6249
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre Kühn <aku@odoo.com>
Co-authored-by: Julien Giannone <jgi@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
Co-authored-by: Xavier Dubuc <xdu@odoo.com>
2020-06-15 18:12:21 +00:00
dmonzonis 936d206559 [IMP] mail_bot: improve OdooBot workflow
This commit attempts to improve the workflow of the OdooBot onboarding
tutorial, as well as the answer given by the bot while idle.

These changes come from watching how users interact with OdooBot. To
improve the user's experience, the following changes have been made:

1. Move the attachment to the end of the tour, as it is where most
   people just close the bot.
2. Remove the quotation marks around commands that OdooBot tells the
   user to type, like "/" or ":)", as some users try to actually type
   the quotation marks too. Instead, use a light grey background around
   the command that the user should type.
3. Some users ask OdooBot questions, but the responses they get are
   useless. To solve this, use a message linking to the documentation or the
   videos when:
    - The user gives wrong answers twice for the same stage of the tour
    - The user talks again when the tour is completed
    - There's a question mark in the answer

To achieve this a "failed" state field is added on user model, allowing to
distinguish state in the bot workflow from state of answers (failed / not
failed).

Task ID: 2233014
PR #49661
2020-05-27 12:47:16 +00:00
Julien MougenotandMathieu Duckerts-Antoine 804507ef49 [REF] *: Adapt all module tests to the new control panel
Use of the new control panel helpers to increase consistency and change the assertions
according to the new DOM/behaviour (e.g. components removed instead of turning invisible).

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 14:08:33 +00:00
Sébastien Theys db6a018c84 [FIX] mail_bot: revert of notification request change
Commit [1] does not work as it is supposed to, because there has been a
confusion between the "notification request" and the "chat with OdooBot".

`_showOdoobotTimeout` is for the chat, and it is unrelated to the notification
request. We don't want to initiate multiple chats with OdooBot so that has to be
reverted.

As for the original goal of the PR about the notification request, it wasn't met
either because it is the browser controlling it:

- on Firefox there simply isn't a "close" button, and closing it by any other
  means (escape key) is considered as a denied.

- on Chrome, when closing it for the first time, it will appear again
  automatically after the next page reload, so no additional code is required.
  However, if it is closed too many times (around 3) it will become
  automatically denied too, at the browser level.

The only thing to do at that point is to better notify the user that it was
blocked, without being intrusive, which is the focus of task-2188584.

[1] b7254ecaeee7f8fa564ca2059f119f5d12404af6

opw-2186299

closes odoo/odoo#47395

X-original-commit: 50155e808c44121086cc7436cec0e7f166cd4268
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-03-11 13:01:37 +00:00
jerome hanke (jhk) a1e87bbf23 [FIX] mail_bot: odoobot waits 1 week between notification requests
Steps to reproduce:
- install mail_bot
- wait for odoobot to ask you if you want to receive notifications
- do not select "grant" or "deny", click the closing cross

Previous behavior:
Odoobot would consider that you denied the request

Current behavior:
Odoobot waits 1 week and will ask you again

opw-2186299

closes odoo/odoo#46697

X-original-commit: b7254ecaeee7f8fa564ca2059f119f5d12404af6
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2020-03-03 09:01:21 +00:00
9419529b2d [REF] mail_bot: adapt code after jQuery update
Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 20:07:17 +01:00
Juhil Somaiya 02eebe15cd [IMP] mail_bot: Blocked notification alert to User
If user has blocked odoo push notifications
then there's no way to enable via the OdooBot notification in the systray as it depends on the navigator
so display the alert message under users preference section.

Related Task ID: 1929547

closes odoo/odoo#30496
2019-02-15 09:05:54 +00:00
Christophe Simonis 8aa8548d8a [MERGE] forward port branch 12.0 up to 3e4138deaa
closes odoo/odoo#30045
2019-01-09 15:56:53 +00:00
Alexandre Kühn a15c03e0bd [FIX] mail_bot: hide Odoobot request when denied (Firefox)
Before this commit, the notification "Odoobot has a request" would
stay on screen even though the user blocked them in Firefox.

This case occurred when the user clicks on "Not Now", which tells the
browser that the push notifications should be blocked until the next
page reload.

This commit fixes this issue, so that the notification is removed
when clicking on "Not Now", in addition to cleaning tests related
to push notifications.

Task-ID 1918476

closes odoo/odoo#29584
2018-12-17 15:10:35 +00:00
Alexandre Kühn 64f044761a [IMP] bus, mail, mail_bot: improved native notification
With this commit, no push notification is sent to user when
to acknowledge that he just has accepted them. Also, on native
push notifications, the Odoo Bot icon now has a transparent
background.

Task-ID 1881001
2018-12-06 14:51:28 +00:00
Géry Debongnie abf32b8b21 [REF] *: update js test suite to use helpers
This rev. introduces robust helpers to use in the JS tests suite to
interact with DOM and components, and starts using them (almost)
everywhere.

All the helpers are exposed though testUtils.js.

There are 2 kinds of helpers:

1. Assertions
-------------
 * assert.containsNone, containsN, containsOnce check that the DOM
   (or a specific part of the DOM) contains a `selector`. It
   generates a correct error message automatically.
    ex: assert.strictEqual(form.$('.o_form_editable'), 1, "msg");
        -> assert.containsOnce(form, '.o_form_editable');
 * assert.isVisible, isNotVisible check that the DOM has an element
   visible or not. They also check that the element is actually in
   the DOM (before most tests didn't verify this).
 * assert.hasClass, doesNotHaveClass, hasAttrVAlue, check specific
   properties of a DOM element, and also validate that it is
   applied on a single existing DOM element (before most tests
   didn't verify this).
    ex: assert.notOk(form.$('button').hasClass('btn-primary'));
       -> assert.doesNotHaveClass(form.$('button'), 'btn-primary');

2. Utilities
------------
The goal of the utilities is to centralize the definition of many
standard components and interactions, ensuring that when we
refactor the JS framework, we do not need to change all the tests.

Existing mock utilities (addMockEnvironment, intercept, path,
patchDate, unpatch and fieldsViewGet) are moved to
'testUtils.mock.*'.
Existing DOM utilities are moved to 'testUtils.dom.*'.
New dom utilities are created for opendDatePicker, click,
clickFirst and clickLast. Helper `click` verifies that there is
exactly 1 element visible in the DOM you click on, `clickFirst`
and `clickLast` verify that there are more than one element on the
DOM.
 ex: form.$('button').click();
     -> testUtils.dom.click(form.$('button'));

New Form utilities: (testUtils.form.*)
 clickEdit, clickSave, clickCreate, clickDiscard, all clicks on
 the control panel buttons of the form.
 `reload` reloads the form data.

New modal, graph, kanban and pivot utils (testUtils.pivot.*,
testUtils.kanban.*, etc.).

New fields utils: (testUtils.fields.*)
 * editInput, editSelect: allow to change the value of a field,
   using a selector to identify it. They validate that the input
   exists and trigger the change event automatically.
 * editAndTrigger: allow to modify a field and trigger specific
   events after the value change
 * many2one (testUtils.fields.many2one.*)
   clickOpenDropdown, clickHighlightedItem, clickItem,
   searchAndClickItem: use a field name instead of a selector and
   do all the complex mechanism to open, filter and highlight
   many2one fields.

Joint work with aab, dam, ged, mge, svs and vsc.
2018-11-19 11:24:28 +00: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
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
XavierDo cf505c3698 [ADD] mail_bot, im_livechat_mail_bot: add Odoobot, your new best friend
Purpose of this commit is to improve onboarding with a wow effect and a bot
to test the Discuss app. Otherwise new users have nobody to talk to. Retention
will be improved by both increasing interactions and onboarding of Discuss
features.

This commit adds a simple bot in discuss. It answers some questions, helps
users getting their hand on discuss and eases the onboarding.

In this version, the flow is quite simple, and only im_livechat adds some
logic in order to show canned response. The logic is contained in new
modules: mail_bot and im_livechat_mail_bot in order to keep everything
well separated. It also allows users to remove the mailbot if they do not
want to keep this functionality.

Odoobot will only answer if he is in the onboarding conversation (alone
with a user in a channel of type chat) or if a user pings odoobot.

Odoobot logic applies to both standard chatter / channel messages and
also transient messages (like help commands).

Specifications

 * 2 minutes after first sign in, users will receive a direct chat from
   Odoobot;
 * make Odoobot an archived partner;
 * scenario

  * Odoobot: "Hello, I'm here to help you discover chat features. Try
    answering me with an emoji :)";
  * User:  Send emoji
  * Odoobot: "Great! :) Did you notice that you can also send attachments,
    like a picture of your cute dog? Try it!"
  * Odoobot: "Not a cute dog, but you get it :) To access special features,
    start your sentence with "/" (I.E. /help)""
  * User: /help
  * Auto message then Odoobot: "Wow you're a natural! As a channel usually
    contain a lot of users, you can grab the attention with a ping. Try to
    ping me with @Odoobot!"
  * User: @Odoobot lorem ipsum

  * if Livechat installed

   * add 2 demo canned response so it does not look weird (like "Hello, how
    may I help you?" and "Have a nice day!")
   * Odoobot: "Perfect! <br> Try to type ":" to use canned responses."
   * User tries canned
   * Odoobot: "Good, you can customize your canned responses in the live chat
    application. <br><br> + réponse suivante"

 * Odoobot: "There's 3 different ways in Odoo to interact with your
   colleagues:  via this chat window, [img of chat window] via the Discuss
   application [img of Discuss app + icon on it] or via the chatter [img of
   the chatter]. Aaaaand that's it! Enjoy discovering Odoo! :)"
 * random answers to ping/bad answer

  * "Mmmmh I'm not sure what you mean.. Can you try again?"
  * "I'm afraid I don't understand. Sorry!"

 * when someone pings @OdooBot with no reason: Odoobot: Yaaaay that's me!
   [party emoji]
 * fun stuff to add for some answer

  * User: i love you / love
  * Odoobot: Aaaaaw that's really cute but, you know, bots don't work
    that way. You're too human for me! Let's keep it professional <3
  * User: Fuck
  * Odoobot: That's not a really nice thing to say, you know? I'm a bot but I
    have feelings, ok?! </3

This commit is linked to task ID 1838588 and PR #25075.
2018-08-10 13:33:28 +02:00