Commit Graph
2976 Commits
Author SHA1 Message Date
Romain Derie 72f7139f52 [IMP] *: use new helper config.isDebug()
Before this commit, both config and session were aliases to odoo.debug.
Now, config.isDebug() should be call, with possibility to pass a parameter to
check if we are in a specific debug mode such as 'tests' or 'assets'.

task-1934445
Coming with https://github.com/odoo/enterprise/pull/4281
Closes https://github.com/odoo/odoo/pull/33213
2019-06-05 05:56:33 +00:00
Romain Derie 73327db065 [IMP] *: add debug manager in frontend
Now that the debug mode is stored in session, we need a clear indication that
debug mode is activated.
In backend, the 'fa-bug' is doing the trick but in frontend there is no visible
clue that debug mode is enabled.

This commit separate the debug manager code/feature so we can instanciate it in
frontend only with usefull options (such as enable assets, leave debug mode..).

Now, in frontend, people having access to the navbar (o_main_navbar) will see
the same 'fa-bug' icon with minimal options as mentioned above.
Also, in the footer, there will be another 'fa-bug' icon without any options.
It will be usefull when the navbar is not shown, typically the case for
public user, or for portal (without website installed)).
Clicking on it will simply leave debug mode as hinted in tooltip.

task-1934445
Comes with https://github.com/odoo/enterprise/pull/4281
Closes #33213
2019-06-05 05:56:33 +00:00
Romain Derie fdbf11643f [IMP] *: move test and tour files to new folder hierarchy and asset
As we now have a new debug mode 'tests' which load a new asset bundle
containing tour-test files, we moved those files to a new folder hierarchy.
That will clean the .js files trees.
Also, those files should be included in the new asset.

Basically, the .js tour files (not test) should be inside /static/src/js/tours
while .js tour test files (test=true) should be inside /static/tests/tours next
to QUnit tests, inside a tours folder.

+ test_new_api: don't run the test in debug assets

task-1934445
Comes with https://github.com/odoo/enterprise/pull/4281
Closes #33213
2019-06-05 05:56:33 +00:00
Pierre Paridans ece2fed154 [REF] mail: chatter topbar styles
The Chatter's topbar (containing the buttons like 'Send Message', 'Log
Note') was difficult to deal with: specially the positioning of its
content (a float into another float...).

So, this commit refactors the topbar's layout using Flexbox. It allows
to simplify and reduce the amount of (S)CSS needed to achieve the same
visual result.

In the process, the Followers (dropdown) buttons now use correctly
nested .btn-group components (as described by the Bootstrap 4
documentation) and SubTypes dropdown items use semantic html element
(<button>) instead of attaching behavior on icon element(<i>).

Finally a few Chatter's tests requested a slight adaptation (cf.
trimming element's textual content).

Task ID: 1928573

closes odoo/odoo#33823

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-06-04 13:47:33 +00:00
XavierDo d917b2d072 [IMP] mail: improve user notification model in mail.message
Currently if a message has a res_id and a res_model it appears in the
matching record's chatter. Its access rights are computed based on this
record. This is the standard behavior of mail.message model.

User notifications are currently built on messages not having model and
res_id in order to avoid appearing on chatter. This has several drawbacks
notably access rights, redirection to the record, systray, finding back
records, ...

This commit solves those issues by adding new message_type 'user_notification'
that should be as a classic mail.message with model and res_id but without
the whole notification mechanism and without being displayed in the chatter.

An user notification is now a classic message pushed to a given partner only
and not displayed in the chatter.

Related to task 1943901
Linked to PR #32404
2019-05-29 13:32:25 +00:00
Christophe Simonis d5e1fd16b4 [MERGE] forward port branch saas-12.4 up to cda4f3c308 2019-07-29 14:10:30 +02:00
Martin Trigaux 5a6a414e2c [MERGE] Forward port of saas-12.4 to master up to aadc4a9f0b 2019-07-22 14:47:52 +02:00
Priyanka Kakadiya f4157f68ce [IMP] mail: Do not show the confirmation popup while clicking on "Following"
Purpose of the commit is to improve the user experience of the chat by
deleting some extra step that might be unnecessary

So when a user tries to remove him/her self from the follower, it will not ask
for confirmation and removes the user from particular document straight away
without any confirmation.
If user remove the another partner from follower then it will raise the prompt
dialog for confirmation

task-1998188
Closes: #34050

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-07-19 07:09:32 +00:00
Mitali Patel 80c0bc00a7 [IMP] mail: removed messages from custom filter
Purpose of this commit is filter that allows to
filter by messages is not working properly so
removed messages filter from custom filter menu

task-1939953 closes-#34141

closes odoo/odoo#34141

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-20 10:48:23 +00:00
Thibault Delavallée 2b7ad217f1 [FIX] mail, sms: post sms message as a note on related document and apply various fixes
PURPOSE

Improve use of SMS. Followup of merge 4287481bf0 .

SPECIFICATIONS

Currently when sending an SMS through the UI a message is posted using the
comment subtype. However it is better to lessen number of notifications
and log using the note subtype as it is mainly a log to know something has
been sent.

Order SMS by ID desc to ease finding them in technical menu.

Mail, sms: fix wording of mail / SMS failures

Linked to task 1925950 and 1935280
Part of PR #34864
2019-07-18 09:20:06 +00:00
Martin Trigaux fd15ca1918 [MERGE] Forward port of saas-12.4 to master up to 1f5a4649a6
closes odoo/odoo#34850

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 08:12:26 +00:00
RomainLibert 7594cb6279 [IMP] mail: Remove the 'Bell' icon to edit subtypes
There are 2 different manners to edit the subtypes:
- The bell above the chatter
- The pencil next to your avatar on the followers dropdown.

It's better to have only one way to edit these subtypes.

As this is an advanced configuration that is not part of the
onboarding process, remove the most obvious way to edit it.
2019-07-05 13:04:19 +02:00
RomainLibert 9cd3bcd440 [IMP] mail: Move the attachment icon on the left
This is much better.
2019-07-05 13:03:18 +02:00
RomainLibert a4f33b5bf5 [IMP] mail: Display some tour popups on a better side 2019-07-05 13:00:14 +02:00
Christophe Simonis 60e71302a3 [MERGE] forward port branch saas-12.2 up to 243a4ae5cb 2019-05-13 11:02:27 +02:00
Christophe Simonis 243a4ae5cb [MERGE] forward port branch saas-12.1 up to 330b99f60c 2019-05-10 15:20:01 +02:00
Christophe Simonis cc3a2c1bf3 [MERGE] forward port branch 12.0 up to e11bacfe51 2019-05-09 21:07:44 +02:00
Julien Castiaux f79582c1f8 [FIX] mail: prevent record discard on new attachment
Open a record having a chatter, edit a field, add an attachment, leave
the page. The discard warning popup in not shown.

When an attachment is added, it reloads the record to fetch the new
`attachment_message_count`. Reloading the view was discarding the
changes because the `keepChanges` option was not set and defaults to
`false`. The changes were discarded thus the internal `_isDirty` flag
evaluated to `false` thus the popup was not shown as nothing would have
been saved.

The option was set in another `attachment_message_count` reload already,
in `chatter.js@_openComposer`.

opw-1974147

closes odoo/odoo#33180

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-05-06 09:59:18 +00:00
Grzegorz Krukar 04a535a8d1 [FIX] mail: correctly display follow button in chatter
The follower button had a useless fixed width which made it overlap with
other buttons.

Fixes odoo/odoo#29387
Closes odoo/odoo#33063

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-06 09:02:53 +00:00
fja-odoo 83c1d56d2f [REF] mail, website, *: remove useless "in" classes
* website_sale_comparison

Just removing old "in" class from bootstrap3 wich has been replaced by
"show" in bootstrap4.

Part of https://github.com/odoo/odoo/pull/32132
task-1894820
2019-06-28 08:53:52 +00:00
Christophe Simonis 5548029fb7 [MERGE] forward port branch saas-12.4 up to 5e81b18e24 2019-06-27 20:51:59 +02:00
Christophe Simonis 9035fb8a2a [MERGE] forward port branch saas-12.4 up to 618ea1ab67 2019-06-18 10:24:25 +02:00
Hiral Bhavsar 3cd7ed07a2 [IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.

Task 1937686

closes odoo/odoo#31243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-17 11:34:17 +00:00
Nicolas Martinelli 39937634b7 [FIX] mail: hide im_status RPC
If the `/longpolling/im_status` route is slow to respond, the UI might
be blocked while there is no good reason to do it.

closes odoo/odoo#33643

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-05-24 09:23:02 +00:00
Alexandre Kühn faf020361e [FIX] bus, mail: fetch im_status with '/longpolling/im_status'
Before this commit, mail status manager was regularly fetching
`im_status` of partners with `this._rpc()`. This used the main
thread worker, so it may be overloaded because of that.

To mitigate this issue, mail status manager now uses a new route
`/longpolling/im_status` to fetch `im_status` of partners using
the longpolling thread worker.

closes odoo/odoo#33238

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-05-20 07:39:53 +00:00
Alexandre Kühn b5ce994762 [FIX] im_support, mail: message with odoobot as author
Before this commit, the `author_id` of a message with odoobot was
`"ODOOBOT"`. This leads to some issues due to `author_id` being
considered as an array `[partnerID, name]`.

Because of this, mail status manager was registering a partner with
ID `"O"` (1st char of `"ODOOBOT"`) for fetching its `im_status`. Its
`im_status` was never updated, since no partner has such ID. However,
the mail status manager kept this partner flagged with missing
`im_status` and still attempted to fetch its `im_status`,
indefinitely.

This commit fixes the issue by turning `author_id` of a message with
odoobot into arrray `["ODOOBOT", "ODOOBOT"]`. That way, `author_id`
of a message is always an array, and the `im_status` of `"ODOOBOT"`
is no longer fetched.
2019-05-20 07:35:12 +00:00
Christophe Simonis af313858b4 [MERGE] forward port branch 12.0 up to c1c322dd40 2019-04-09 20:43:35 +02:00
Varun Raval a61f8c591f [IMP] mail: modify out of office field label on user
Replace name 'out of office' group string from 'Out of Office' to 'Chat Status'.

Replace 'out_of_office_message' field string from 'Out Of Office Message' to 'Message'.

Task 1999697

closes odoo/odoo#33552

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-28 09:07:45 +00:00
Pierre Paridans 627fd77248 [FIX] mail: DocumentViewer's buttons alignment on mobile
The action buttons in the document viewer were badly aligned on small
screens, and specifically when moving to multiple lines to fit on the
viewport.

This commit adjusts the positionning and margins between those buttons
to stay consistent on every screens size (smallest to biggest).

Task ID: 1917277
2019-05-23 13:12:58 +00:00
Prakash Prajapati 9613483241 [IMP] mail, calendar: today's meeting in systray dropdown
The whole cell is now clickable, not only the first line and it opens
the calendar view.

The meeting title is now displayed on the left, and the time on the right.
Morever, the exact hour is now displayed, not "In 4 hours".

The next activity background color has also been adapted (goes to white).

Task 1948737

closes odoo/odoo#32215

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-21 12:45:45 +00:00
Thibault Delavallée 70d44ed787 [REF] mail, various : make message_get_suggested_recipients from mail.thread private
Purpose: make some methods from mail.thread mixin private and update their
naming if necessary. Some methods prepare data for business flows and deal
with internal information. Public methods should either use of give some
access to those methods. Computation itself should be keps internal.

In this commit we put message_get_suggested_recipients as private. As it is
used in discuss JS we define a controller that controls access to this method.
It explicitly checks for related document access rule and rights before
calling the private method.

Some addons are updated accordingly to the method change.

Related to task ID 1911679
Linked to PR #29483
2019-05-13 15:18:40 +00:00
David Beguin 957c99abd5 [REF] mail, various : make message_partner_info_from_emails from mail.thread private
Purpose: make some methods from mail.thread mixin private and update their
naming if necessary. Some methods prepare data for business flows and deal
with internal information. Public methods should either use of give some
access to those methods. Computation itself should be keps internal.

In this commit we put message_partner_info_from_emails as private. As it is
used in discuss JS we define a controller that controls access to this method.
It explicitly checks for related document access rule and rights before
calling the private method.

Some addons are updated accordingly to the method change.

Related to task ID 1911679
Linked to PR #29483
2019-05-13 15:18:40 +00:00
Christophe Simonis 8dd5a85267 [MERGE] forward port branch saas-12.3 up to 60e71302a3 2019-05-13 15:26:12 +02:00
Martin Geubelle b9ec983571 [FIX] mail: first column width in activity view
The first column should have a minimum width to avoid the table to
resize when changing the domain for example.

Task 1894990

closes odoo/odoo#33273

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-05-09 11:23:53 +00:00
Christophe Simonis e145f2b0c8 [MERGE] forward port branch saas-12.2 up to 2694174b41 2019-04-10 15:10:24 +02:00
Christophe Simonis c9e1deb496 [MERGE] forward port branch saas-12.1 up to af313858b4 2019-04-09 20:48:01 +02:00
Pierre Paridans 75c219bfdf [FIX] mail: chatter's button alignment and composer width on mobile
Buttons "Send message / Log note / Activity" are on two lines instead of
one. In addition there is a 1px glitch on the attachment icon.

Also long attachment name on tiny screens (i.e. iPhone 5) breaks the
composer layout: horizontal scrollbar appears.

The two-line buttons effect is related to a change (fix) in Bootstrap
4.2 which removes the white-space: nowrap on .btn. It was originally
introduced in Odoo through https://github.com/odoo/odoo/pull/29949.

Reference: Original Bootstrap PR https://github.com/twbs/bootstrap/pull/27010

Task ID: 1946573

closes odoo/odoo#31939

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-04-08 12:31:16 +00:00
Christophe Simonis 3f95b074e9 [MERGE] forward port branch saas-12.2 up to f2be461f09 2019-04-05 18:46:10 +02:00
Nans Lefebvre 6a5dab9c64 [FIX] mail: reload the record when uploading attachments if post_refresh is set to always
When post_refresh is set to 'always', the displayed record is entirely reloaded
each time a message is posted in the chatter.
However no such thing exists for when attachments are uploaded.

This is of use e.g. when in the view there are fields that have attributes that
depend on computed fields, themselves dependent on the record's attachments.

One such case is the OCR.

opw 1950403
2019-04-05 13:42:55 +00:00
Christophe Simonis f2be461f09 [MERGE] forward port branch saas-12.1 up to f2d0995362 2019-04-05 10:50:56 +02:00
Thanh Dodeur f2d0995362 [FIX] mail: fixes document viewer's url preview
This commit fixes the document viewer: the document viewer
was altering the `type` key of attachment objects, this issue was causing
matching errors in some cases.

With this commit, the document viewer widget uses its own key `attachment.fileType`
to store the information that used to override `attachment.type`

closes odoo/odoo#32414

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-04-04 10:35:54 +00:00
Moens Alexandre 40a650a089 [FIX]mail: detach non existing element
This commit fixes a js crash that occured when the user was trying to
edit a new record while the chatter was not completely loaded
(this.field.thread.$el was not in the dom yet)

Behavior before this fix:
Traceback js & impossible to edit the form afterward.

Behavior after this fix:
no traceback, still possible to edit the form normally.
The thread will display on next chatter re-render. Could be forced by
triggering an onchange.

opw-1986061

closes odoo/odoo#33381

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-05-22 06:47:37 +00:00
Martin Geubelle d75a976054 [REF] mail: correctly promisify activity renderer
None of the promise created in the activity renderer was correctly managed.
This is now the case.

Related to task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar ff6415b63c [IMP] mail: add a progress bar by column in activity view
At the top of each column of the activity view, a progress bar is now
displayed below the activity type name based on activities scheduled.

Note that the progress bar widget is an extension of the kanban progress
bar as both have a very similar behavior.

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar a02d273ebc [IMP] base, mail: set CRUD on activity view as attributes
Just like other views (form, list, kanban, etc.) CRUD operations (create,
delete and edit) are now set as attributes on the activity node based on
the user access rights.

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar 132c0ad9bf [IMP] mail: allow to create record from activity view
In the activity view footer, it's now possible to create a new record
(and an associated activity). When clicking on the link, a 'SelectCreate'
dialog is opened and the activity is created when selecting a record.

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar fac99a901c [IMP] mail: display activity counter on cells
For a record and an activity type (cell in the activiy view), a counter
is now displayed at the bottom right, that shows the number of
activities if more than one are scheduled.

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar 33c0017c0c [IMP] mail: visually show the activity creation on empty cells
An indication that the user can schedule new activities by clicking on
an empty cell is now displayed while hovering an empty cell.

When clicking on the empty cell, the activity form is opened in a modal
defaulted to the corresponding activity type (no dropdown menu anymore).

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar b5ed9a7e2e [REF] mail: correctly implement the deadline precision
In activity view, there was a dummy logic for the deadline precision
(the year was not displayed if it was the current year).

This has been fixed with a valid logic as per locale.

Related to task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar b2de618f9f [IMP] base,mail: allow to customize the activity view
The activity view has been greatly improved to allow to customize it
more easily. It works quite similarly to the kanban view, defining
`<field>` tags at the top and using these fields in the `<template>`
section. The template name used to define the activity cards is
`activity-box`.

Note that these activity cards are rendered using `KanbanRecord` widget
(this has implied that ActivityView inherits from `BasicView`).

Also note that the view validation has been moved in base to include the
common grammar.

Task 1894990
2019-05-03 10:19:40 +00:00