Commit Graph
95 Commits
Author SHA1 Message Date
Alexandre Kühn b3b672a66b [MOV] mail, *: use PopoverView for Message/notificationIcon popover
closes odoo/odoo#98497

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-30 20:22:53 +02:00
Alexandre Kühn 4e697ff6d0 [IMP] mail, *: use PopoverView for Message/notificationIcon popover
*: sms, snailmail

Task-2864563

Part-of: odoo/odoo#98497
2022-08-30 20:22:52 +02:00
Matthieu Stockbauer fe699a241d [IMP] *: adapt client code to use websocket instead of longpolling
*: bus, calendar, hr_attendance, iap_mail, im_livechat, project, snailmail,
snailmail_account, survey, web, web_editor, website_livechat.

This commit is part of the websocket integration in Odoo.
This bus service now communicates with a shared worker in order to provide
a single websocket connection for multiple tabs. It is designed to
be used as a websocket except that events are slightly different,
re-connection is handled automatically. If the browser does not support shared
worker (Safari), the service fallback on a simple web worker.

Available events are:
   - connect : fired upon a successful connection.
   - disconnect : fired upon reception of the websocket close event.
     The close code and reason are given to the listeners callback.
   - reconnect : fired upon a successful re-connection.
   - reconnecting : triggered when the worker starts to try reconnecting.
   - notification : fired upon the reception of notifications.

Since multiple tabs are now handled by a worker, the cross_tab bus is no longer
required and has been removed.

Part-of: odoo/odoo#75510
2022-08-23 17:55:10 +02:00
Sébastien Theys 34d775e873 [IMP] mail, *: remove explicit usage of insert-and-replace
* = calendar, im_livechat, rating, snailmail, test_discuss_full, test_mail,
    website_livechat

Distinction between "replace" and "insert-and-replace" can be guessed based on
the type of the provided data.

task-2957295

closes odoo/odoo#98404

Related: odoo/enterprise#30580
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-19 11:53:05 +02:00
Louis Wicket (wil) 5d43fad9e6 [IMP] mail, *: auto add implicit attributes of identifying fields
Automatically add `required` and `readonly` on identifying fields and
remove them from field definition.

Task-2955910.
* = calendar, hr, im_livechat, rating, snailmail, website_livechat

closes odoo/odoo#98283

Related: odoo/enterprise#30511
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-17 19:48:53 +02:00
Rahul Prajapati 4123505efa [IMP] *: have replace as default command on update
* im_livechat, mail, snailmail, website_livechat

PURPOSE:

A `replace` command should be default while updating a field.

SPECIFICATION:

- If no command is passed while updating a field, add a `replace` command as
default.
- Remove all the existing occurrences of `replace` command.

Task-2851488

closes odoo/odoo#95885

Related: odoo/enterprise#30494
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-17 19:48:11 +02:00
Sébastien Theys 60c87dd426 [IMP] mail, *: introduce identifyingMode and remove identifyingFields
* = calendar, hr, im_livechat, rating, snailmail, website_livechat

This simplifies definition and overrides and opens up new identification
opportunities.

Part of task-2741982

closes odoo/odoo#98166

Related: odoo/enterprise#30470
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-08-17 11:21:40 +02:00
tsm-odoo 75007b578e [MOV] bus, *: move startServer test helper to the bus module
*: calendar, hr, hr_holidays, im_livechat, note, rating, snailmail,
test_mail, test_mail_full, website_livechat, website_slides.

Part-of: odoo/odoo#97771
2022-08-10 14:43:41 +02:00
tsm-odoo c68c0f3400 [IMP] mail, *: remove create component methods in tests
*: sms, snailmail, hr_holidays.

task-2871066

closes odoo/odoo#97093

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-29 18:34:19 +02:00
Laurent Desausoi (lade) b102b3ee83 [FIX] snailmail: fix the font-size of the address in the report
When generating the PDF for the SnailMail report, a script is executed to
adapt the size of the address to match Pingen requirements (as per [1]).

Step to reproduce the issue:
1) Have a contact created that has VAT configure
2) Create an invoice and 'Send and Print'
3) Select the POST button to send via POST
4) In dev mode, go to Techincal > Snailmail Letters
5) Download the PDF of the newly created invoice
You should see that the font becomes extremely tiny.

Solution: There are different elements that needs to be corrected to solve the
issue.
1) The CSS used to specify the `height` requirement of the address was not
properly loaded (the path was incorrect)
2) The JS selector used into the resize script is incorrect
3) The CSS selector into the CSS file was invalid
All these issues are due to incomplete migrations.

[1]: https://github.com/odoo/odoo/commit/c50f5da4160c63dcc79900dc882cd36c9ad96b2e

opw-2819823

closes odoo/odoo#96055

X-original-commit: 7bbdbdcde2315155d17fb30d5496c3daf9a5c4cf
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Desausoi Laurent (lade) <lade@odoo.com>
2022-07-15 14:22:15 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
tsm-odoo bc2bf646c9 [IMP] mail, *: remove createThreadViewComponent in tests.
*: sms, snailmail.

The createThreadViewComponent helper was used during tests to mount
a thread view component  and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's mount a webClient so that the thread view
component can be mounted in its real environment.

task-2871066

closes odoo/odoo#94691

Related: odoo/enterprise#28954
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-29 17:11:30 +02:00
Renaud Thiry e42446600e [FIX] mail: Update legacy arguments for services.action.doAction
Emails could not be resent from the chatter after failing to be sent.
This was due to parts of code not being updated after a refactoring of OWL.

Multiple other instances of non-updated code are updated here.

Task-2887153

closes odoo/odoo#94529

X-original-commit: 8fbdb1b52b9051e92e4980d5af73460a46fe70da
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-24 15:00:48 +02:00
Rahul Prajapati 71a68c5923 [IMP] *: remove support for empty create with pyenv
* hr, im_livechat, mail, sms, snailmail, test_mail_full, website_livechat,
  website_slides

PURPOSE:

Creating a record with no values has no sense but is sometimes useful during
tests.
The support should be dropped for `default` parameter in `create`.

SPECIFICATION:

All the occurrences of `create()` have been replaced by `create({})`.

Task-2869394

closes odoo/odoo#93917

Related: odoo/enterprise#28538
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-20 15:31:51 +02:00
tsm-odoo 3573a7fef4 [IMP] mail, *: use wowlEnv instead of the legacy one
*: bus, calendar, hr, hr_holidays, im_livechat, mail, mail_bot, note, project,
sms, snailmail, test_mail, web, website_livechat, website_slides.

task-2582313

closes odoo/odoo#83774

Related: odoo/enterprise#26493
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-30 19:40:53 +02:00
Alexandre Kühn da40fedde0 [IMP] mail, *: pass record instead of local id in props
*: hr_holidays, im_livechat, snailmail, website_livechat

Task-2847927

closes odoo/odoo#90882

Related: odoo/enterprise#27110
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-09 20:58:31 +02:00
tsm-odoo b319d660bb [REF] mail, *: prepare do-action for new env
*: sms, snailmail, test_mail.

This PR helps reducing the noise in the one introducing the new environment in
the discuss app. Indeed, we won't rely on the bus anymore to listen to do actions,
we will instead use the action service. The diff is awfull because the indentation
has changed as well as the parameter names. Changing the indentation and the parameters
now will ease the review of the main task.

task-2582313

closes odoo/odoo#90581

Related: odoo/enterprise#26970
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-05 16:23:05 +02:00
Alexandre Kühn 23962f3d4b [IMP] mail, *: remove this.async()
*: calendar, hr, snailmail

Task-2837854

closes odoo/odoo#90230

Related: odoo/enterprise#26790
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-04 15:38:25 +02:00
tsm-odoo 7e5a71ab71 [IMP] mail, *: always mount discuss/chatWindow/dialog during tests
*: hr, im_livechat, snailmail, website_livechat.

This PR prepares the ground for  the one introducing the new environment in the
discuss app. Indeed, tests will now use the mainComponentRegistry in order to mount
those components. Doing so, the parameters has{Discuss/Dialog/ChatWindow} will become
obsolete. Removing those parameters now helps reducing the noise in the main PR.

task-2582313

closes odoo/odoo#90120

Related: odoo/enterprise#26759
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-03 13:31:08 +02:00
Alexandre Kühn 241fa6c2b3 [IMP] mail, *: introduce view models (step 4)
*: sms, snailmail, test_mail

This commit introduces models that define records being 1:1 map with components,
as a step to move further to having essentially all business code in models.

Having code in models is desirable to have very maintainable code, thanks to
robust and declarative code with an ORM-like architecture.

Task-2831082

closes odoo/odoo#90320

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-03 03:56:58 +02:00
tsm-odoo 0b60725288 [IMP] mail, *: add rpc to messaging
*: calendar, hr, im_livechat, mail, mail_bot, snailmail, website_slides.

This PR prepares the ground for the one introducing the new env in discuss.
The signature of the rpc function has changed a lot from the one in the old env.
In order to ease the transition and reduce the noise, the discuss models now
rely on the messaging's rpc function.

task-2582313

closes odoo/odoo#89858

Related: odoo/enterprise#26676
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-04-29 11:01:18 +02:00
tsm-odoo 2b2175e824 [IMP] mail, *: rename isMobile to isSmall
*: sms, snailmail.

In order to reduce the noise in the new discuss env PR, all the
messaging.device.isMobile occurences have been renamed to isSmall
in order to match the new env terminology.

task-2582313

closes odoo/odoo#89655

Related: odoo/enterprise#26597
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-04-27 10:04:07 +02:00
tsm-odoo 848e8d7ee4 [IMP] mail, *: adapt remaining tests data seeding
*: calendar, hr, hr_holidays, im_livechat, mail, note, sms, snailmail,
test_mail, website_livechat, website_slides.

task-2792108

closes odoo/odoo#87700

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-04-04 17:48:39 +02:00
Pierre-Yves Dufays eca543ef40 [REM] mail, sms, snailmail: discard notifications without confirmation
Skip the confirmation step when wanting to get rid of a notification
for emails, sms or letters that were not sent.

Technical:
- All 3 wizards to confirm the discarding of the notification have been removed
(the ones for mail, sms and letter) have been removed
- The method to discard notification has been centralized in MailThread
(notify_cancel_by_type in addons/mail/models/mail_thread.py)
- This centralization has been done as well on the client code as the same
server code is called whether it is a mail, a sms or a letter
(in addons/mail/static/src/models/notification_group/notification_group.js)
- Existing front and back test have been adapted
- A test of notify_cancel_by_type for mail has been added
(addons/test_mail/tests/test_mail_management.py)
- add missing author_id in mail_notification demo data

Task-2752190

closes odoo/odoo#84452

Related: odoo/upgrade#3246
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-01 17:56:20 +02:00
Sébastien Theys 06cbb5793d [IMP] mail, *: tweak style of messaging menu/notification list items
* = sms, snailmail

task-2789056

closes odoo/odoo#86598

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-31 16:28:02 +02:00
Alexandre Kühn c1cbffacf4 [IMP] mail: guard SnailmailNotificationPopoverComponent
Task-2797754

closes odoo/odoo#86956

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-23 21:10:52 +01:00
Alexandre Kühn 07c1c6ee13 [IMP] mail: guard SnailmailErrorComponent
Task-2797754

closes odoo/odoo#86955

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-23 20:18:50 +01:00
Louis Wicket (wil) ee9759a144 [MOV] mail, *: move utils files up
* = calendar, hr, hr_holidays, im_livechat, note, sms, snailmail,
test_mail, website_livechat, website_slides
Task-2759586

closes odoo/odoo#86791

Related: odoo/enterprise#25491
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-23 13:39:56 +01:00
Louis Wicket (wil) bb1003893f [MOV] mail: move component hooks up
Task-2759571

closes odoo/odoo#86802

Related: odoo/enterprise#25434
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-22 19:39:44 +01:00
Louis Wicket (wil) b9fd435b99 [MOV] mail, *: move tests
* = hr_holidays, im_livechat, sms, snailmail, website_livechat,
    website_slides

Move tests files into `static/tests`.

Task-2759560

closes odoo/odoo#86581

Related: odoo/enterprise#25375
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-18 16:07:29 +01:00
tsm-odoo 2538a71944 [IMP] mail, *: make mail tests stop relying on this
*: hr_holidays, im_livechat, mail, mail_bot, sms, snailmail, test_mail,
website_livechat, website_slides.

Mail tests are currently relying on this during tests to make env, widget,
data available. We don't wan't to add magic keys to this anymore.

task-2792108

closes odoo/odoo#86559

Related: odoo/enterprise#25341
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-17 19:30:08 +01:00
Louis Wicket (wil) e16976ddfc [IMP] mail, *: move up model files
Move model definition files from `models/thing/thing.js` to
`models/thing.js` and remove the now empty intermediate directory.

Task-2759582
 * = calendar, crm_livechat, hr, im_livechat, mail_bot, sms, snailmail,
     website_livechat, website_slides

closes odoo/odoo#86464

Related: odoo/enterprise#25291
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-17 11:27:59 +01:00
tsm-odoo b15959cd95 [IMP] mail, *: make start method handle cleanup
*: calendar, hr, hr_holidays, im_livechat, mail, mail_bot, note, sms, snailmail,
website_livechat, website_slides.

This commit prepares the removal of beforeEach function in the
mail test suite. Cleanup was relying on beforeEach adding widgets,
components, unpatch method 'this'. We need to clean things up without
using either beforeEach or 'this'.

task-2792108

closes odoo/odoo#86526

Related: odoo/enterprise#25326
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-03-16 16:07:58 +01:00
tsm-odoo 1e828a14ec [IMP] mail: get closer from python model definition in test setup
*: hr, hr_holidays, im_livechat, mail, snailmail, test_mail, website_livechat,
website_slides.

This commit will remove the need to duplicate models definition for
test purposes. Indeed, for now, we need to mock the model definitions
on the client side. Those models definitions are often very different
from the ones found on the server.

This approach will allow us :
	- to ease model definitions during tests
	- to get closer from the real models

task-2767820

closes odoo/odoo#84828

Related: odoo/enterprise#24486
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-03-10 18:19:59 +00:00
tsm-odoo 0862f2fab0 [IMP] mail, *: make mail module's beforeEach functions async
*: calendar, hr, hr_holidays, im_livechat, note, sms, snailmail,
website_livechat, website_slides.

This commit prepares the ground for the model definitions PR.
In order to reduce the noise, all mail module's beforeEach
functions will be made async.

task-2767820

closes odoo/odoo#84845

Related: odoo/enterprise#24489
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-18 13:26:49 +00:00
Fabien Pinckaers 10a5796d4b [IMP] speed up load_menus() by using SVG icons instead of png
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.

Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)

closes odoo/odoo#84280

Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-02-12 08:55:18 +00:00
+2 edd79ff560 [REF] mail,*: adapt code to owl 2
*im_livechat,sms,snailmail

Owl 2 changelog: https://github.com/odoo/owl/blob/a9f29c4caad4f32d06be1ec4780572825781cd9b/CHANGELOG.md

Part-of: odoo/odoo#80156
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2022-02-10 07:46:13 +00:00
Alexandre Kühn 0df4b0029b [IMP] mail, snailmail: convert legacy dialog with t-ref to model
In preparation to using Owl 2 in discuss code.

task-2738648

closes odoo/odoo#83598

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-02 19:50:45 +00:00
Alexandre Kühn 51c0dff6d5 [IMP] mail: rename discuss legacy dialog component in code
Code part of renaming discuss legacy dialog.
In preparation to using dialog modelling.

Task-2738648

Part-of: odoo/odoo#83522
2022-01-27 18:03:36 +00:00
Alexandre Kühn d35946e845 [IMP] mail: rename discuss legacy dialog component files
File part of renaming discuss legacy dialog.
In preparation to using dialog modelling.

Task-2738648

Part-of: odoo/odoo#83522
2022-01-27 18:03:35 +00:00
Julien Mougenot db63ff2259 [REF] web: Owl imports adaptation
In the next version of Owl, all exported terms are directly available
from the top level `owl` object. This commit aims to adapt existing
imports to this new system. This is done by importing any Owl property
used in files at the top, right after the `import` or `require`
statements.

closes odoo/odoo#82736

Related: odoo/enterprise#23609
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-01-20 11:03:01 +00:00
Sébastien Theys 671e5b885e [IMP] mail, *: add view model for notification list items
* = im_livechat, sms, snailmail

Part of task-2728107

closes odoo/odoo#82239

X-original-commit: fadb57564209e1b9c4ee6ee993b117b288ac614d
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-01-05 12:50:16 +00:00
Louis Wicket (wil) 41076d1f1c [IMP] mail, sms, snailmail: rename message model
Rename javascript model `mail.message` to `Message` in order to
distinguish javascript models from python models.

Part of task-2701674.

closes odoo/odoo#81366

Related: odoo/enterprise#22883
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 16:40:21 +00:00
Louis Wicket (wil) 4749ce25a8 [IMP] hr_holidays, mail, sms, snailmail: rename thread viewer model
Rename javascript model `mail.thread_viewer` to `ThreadViewer` in order
to distinguish javascript models from python models.

Part of task-2701674.

closes odoo/odoo#81437

Related: odoo/enterprise#22911
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 12:07:03 +00:00
Louis Wicket (wil) d54f224f2b [IMP] mail, snailmail: rename notification model
Rename javascript model `mail.notification` to `Notification` in order
to distinguish javascript models from python models.

Part of task-2701674.

closes odoo/odoo#81418

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 11:12:50 +00:00
Louis Wicket (wil) b024377742 [IMP] mail, sms, snailmail: rename notification group model
Rename javascript model `mail.notification_group` to `NotificationGroup`
in order to distinguish javascript models from python models.

Part of task-2701674.

closes odoo/odoo#81405

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 11:12:42 +00:00
Louis Wicket (wil) deb12bc032 [IMP] hr, mail, snailmail: rename messaging model
Rename javascript model `mail.messaging` to `Messaging` in order to
distinguish javascript models from python models.

Part of task-2701674.

closes odoo/odoo#81386

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-15 00:10:48 +00:00
Alexandre Kühn 30d7766eea [IMP] mail,snailmail,web: remove t-on on component
Preparation work to use OWL v2 in discuss code.

Task-2694200

closes odoo/odoo#80024

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-01 14:07:57 +00:00
Alexandre Kühn e54c755439 [IMP] mail,*: pass classname as props in components
*: im_livechat, snailmail,website_livechat

In preparation to use OWL v2 in discuss code

Task-2694196

closes odoo/odoo#80060

Related: odoo/enterprise#22374
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-30 11:20:48 +00:00
Alexandre Kühn 0c10101c2e [IMP] mail, *: use component ref instead of component el
*: snailmail, website_livechat

In preparation of using OWL v2 in discuss code

Task-2694242

closes odoo/odoo#80094

Related: odoo/enterprise#22394
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-24 18:37:54 +00:00