Commit Graph
4738 Commits
Author SHA1 Message Date
Elisabeth Dickinson 80098df3dd [FIX] *: fix ribbons position and size
This commit fixes the ribbons used in `kanban` and `form` views.

The SCSS uses the square root of the parent `div.ribbon` to calculate its
diagonal width and applies that width to the child `span`.

After changing the ribbon's transform-origin, we calculate the ribbon's
position based on CSS variables of the view's top padding,the height of
the ribbon and the shadow's size (to avoid it being cropped by
overflow-hidden).

By changing the values of a few of these variables in the kanban view,
we were able to remove all the specific SCSS related to ribbons in the
modules.

Other changes were applied inside some of the modules to make this
work:

- `event`: padding corrections on the kanban's cards;
- `hr_holidays: replaced `margin:0` in the SCSS with negative margin
utility classes on the element to achieve the same visual result;
- `discuss`: moved the ribbon to the parent element;
- this was also done to `discuss`, `survey` and `helpdesk`;
- `crm_team_view` in `sales_team`: the ribbon's height made it overflow
from the kanban's card. We fixed this by changing the value of one of
the CSS variables in the view's SCSS file;
- the same thing was done in `survey` and `appointment`;
- `website_event_exhibitor` had some SCSS that wasn't being used because
it uses `.o_ribbon` instead of `.ribbon`

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:21 +02:00
Damien Bouvy e479f380bf [FIX] mail: correct inheritance of popoverProps method
Missing a super call, merged the functions together for better
style-adherence to the original code

Part-of: odoo/odoo#116641
2023-05-12 22:59:20 +02:00
Brieuc-brd 0f065ed8ea [IMP] web,mail: pivot & chatter design adaption
Part-of: odoo/odoo#116641
2023-05-12 22:59:18 +02:00
Pierre Paridans ffc359dc5c [IMP] web,*: CP's CogMenu rework to add misc items from favorite
Part-of: odoo/odoo#116641
2023-05-12 22:59:17 +02:00
Pierre Paridans caef16ee4e [REF] web,*: ControlPanel layout
This commit brings the ControlPanel into a single line with 3 main
sections:
- buttons & breadcrumb
- layout related actions (ie. the SearchBar in multirecord view or
  ButtonBox in formView)
- navigation (pager, switch view...)

Add new search bar menu, this is a merge of the following components
into one big component display in column:
* comparison_menu
* favorite_menu
* filter_menu
* group_by_menu

Also adapt navigation hook.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
Brieuc-brd d17743e34e [IMP] * : add missing borders
Depending on Milk, this commit adds some missing borders.

Also adapts default `border-radius` to apply milk design.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:15 +02:00
stefanorigano (SRI) 580db954fc [IMP] mail, website_livechat: avatars & Activity apply milk design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:15 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
824024f8aa [REF] web,mail: formView design
- ButtonBox is moved to the ControlPanel's actions section (center).
- StatusBarField, ButtonBox and PercentPieField design.
- Chatter is moved below the ControlPanel (aka "in the view")

task-2818586

Part-of: odoo/odoo#116641
Co-authored-by: Pierre Paridans <app@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2023-05-12 22:59:14 +02:00
stefanorigano (SRI) 79f57643ce [REF] web, mail, hr, website, auth_totp, test_apikeys: top-menu design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:13 +02:00
stefanorigano (SRI) ef31306130 [REF] web, mail: badges design
Part-of: odoo/odoo#116641
2023-05-12 22:59:13 +02:00
stefanorigano (SRI) 051ac37232 [IMP] web, * :introduce o_avatar
*: account, gamification, mail, mrp, note, project, website_blog,
   website_event_track.

Uniform design defining a common element shared across different
modules.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:12 +02:00
stefanorigano (SRI) 46b762a1f1 [REF] web, *: milk colors
*: google_calendar, hr_holidays, hr_skills_slides, mail,
microsoft_calendar, point_of_sale, web_editor, website_livechat,
website_sale

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:12 +02:00
tsm-odoo b07085ef21 [IMP] mail,*: remove server data key in thread insert
*: im_livechat, website_livechat.

Before this commit, the `thread.insert` method received an arbitrary
`serverData` key. This was cumbersome since we needed to create this
key manually at each insertion.Moreover some attributes where coming from
dedicated keys, some from the  serverData key, some from both which led
to a bug-prone, hard to maintain code.

This commit removes the `serverData` key in order to solve those
issues.

closes odoo/odoo#121117

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-12 19:55:05 +02:00
Sébastien Theys 7e0c68bf2b [REF] mail, im_livechat: move typing to discuss WIP
closes odoo/odoo#120851

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-11 12:01:43 +02:00
luvi 9575aba9ca [IMP] mail, *: add hover title to the activity button
*: project, web

This commit adds the title and aria-label attributes to the activity
button. This makes the hover display the summary or an explaination
about the button, especially when there is no text displayed next to
the button (in Kanban view).

In the state selection field, a title has been added when hovering
the state in kanban, allowing to see the current value. The project
task state selection has also been adapted to have that title attribute
set on the toggler.

task-3207639

closes odoo/odoo#120871

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-05-10 16:36:45 +02:00
Julien Carion (juca) 787c6ff32a [FIX] web: Handle access rights in readonly fields
This commit adapts the behavior of all readonly fields
to take access rights into account when deciding whether the field
should be editable or not.
Steps to reproduce: give minimal access rights to Marc Demo user,
log in as Marc Demo, go to crm, make sure no one is assigned as
salesperson in a record and check if the add user icon is available.
Also applies to every kanban view fields (like priority,
many2many_avatar, ...)

opw-3265086

closes odoo/odoo#119818

Signed-off-by: Georis François (fge) <fge@odoo.com>
2023-05-10 13:21:47 +02:00
Pierre-Yves Dufays b3d9fbd3d5 [IMP] mail: allows unfollowing record from inbox
Allow users to unfollow easily document from the inbox for which he/she doesn't
want to be notified anymore.

When hovering on a follow up message with a related document followed by the
user, the interface displays an action to unfollow it that allows the user to
remove himself/herself as follower of the document. As a result of performing
that action a toast is displayed as a feedback.

Technical note:
The unfollow link is displayed on a message.canUnfollow is true which check
that the thread related to the message is followed by the user.

In order to know if the user follows the record related to the message, we now
transmit with each message the id of the follower table that link the user to
the related record if it follows it. This allows to insert the follower on
client side so that the unfollow action can use the standard mechaism already
developed to unfollow a record.

Unfortunately, that information coudn't be added in the already public method
message_format of mail message because that method is not always called on the
user retreiving the message but also by the one posting message. We didn't want
also to include all followers in the formated message so we rely on additional
method that add that information per partner.

To support unfollowing a document in the inbox no matter the current company,
we have modified message_unsubscribe in mail_thread to allow internal user to
unsubscribe themself without checking any rights. Indeed, some document have
record rule that prevents reading it if the user is not in the right company
(ex. crm.lead) and then was preventing the user to unfollow the document using
that method.

Task-3061864

Part-of: odoo/odoo#107978
2023-05-10 13:21:06 +02:00
tsm-odoo a3525aedbe [IMP] bus, *: add single notification subscription
*: calendar, iap_mail, im_livechat, mail.

Until now, one had to subscribe to the global "notification"
event of the bus service and to loop through each notification
to handle the one that was targeted.

This PR introduces the `subscribe` method on the bus service
in order to subscribe to a single notification type.

closes odoo/odoo#120893

Related: odoo/enterprise#40848
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-10 02:00:45 +02:00
tsm-odoo cba9291370 [FIX] mail: wrong type for thread state
closes odoo/odoo#120781

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-05-09 06:07:38 +02:00
tsm-odoo 8f399a270c [FIX] mail: indeterministic discuss test
This PR fixes the `Posting message should transform relevant data to emoji`
test that sometimes failed due to a race condition.

The assertion was too strict, this test just needs to check that the
emoji are properly parsed when posting a message.

Fixes runbot error: 20934.

closes odoo/odoo#120769

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-09 06:07:30 +02:00
Didier (did) 25f7da6c0b [IMP] mail: remove discard on external click
Before this PR, when you reply to a message or edit a message, the action would
be cancelled when you click somewhere else than in the composer or emoji picker.
This PR remove this behavior.

closes odoo/odoo#120753

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-05-09 06:07:23 +02:00
Julien Carion (juca) ffe9e6d9b1 [FIX] mail: Fix activity progress bar filter
This commit simply fixes how the activity renderer propagates the
group.progressValue prop to the ColumnProgress component so that
the active value is only set for the filtered column and not for every
column.

opw-3272571

closes odoo/odoo#120733

X-original-commit: 3bd539913e9ca6f9db9bb55caaa4a85b69a912e0
Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-05-08 23:39:49 +02:00
tsm-odoo e1f0811b22 [IMP] mail: replace hardcoded orm commands in tests
Using hardcoded ORM commands in tests is cumbersome and not reliable.
This commit introduces the same system as the one used on the server.

closes odoo/odoo#120670

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-05 15:58:50 +02:00
Alexandre Kühn c5c3362a21 [FIX] mail: arrow up/down should change selection inside composer
Before this commit, when composer had some text content in
multi-line, arrow up/down was not jumping to previous/next
line.

This happens because the navigable list is active even when not
shown, and was preventing all keydown events.

This commit fixes the issue by limiting handling of keydown
events of navigable list to when it is shown.

Also fixes a bug where the quick edit of last message was triggered
when composer text was non-empty with ArrowUp. This should only
be triggered when the composer text input is empty.

closes odoo/odoo#120657

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-05 14:55:08 +02:00
Sébastien Theys e6b3323237 [REF] mail: move channel commands to discuss folder
Part of task-3265211

closes odoo/odoo#120429

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-05 14:54:57 +02:00
fdardenne 6c881fda04 [FIX] mail: activity view: fix the records limit
The activity view is an aggregation view, meaning that we show all the
activies with no limit of records.

Steps to reproduce:
There is no easy way to reproduce the bug, the database should be
populated with more than 80 records in a model and have an activity
planned for the 81th record.

Current Behaviour:
The Activity view loads all the activities without limit and so the
activity for the 81th record. The problem is that the 81th record does
not have been loaded due to the default limit of the RelationaLModel.
Therefore the activity view crash because it cannot fetch the missing
record for a loaded activity.

Expected Behaviour:
The activity view laods all the activities but also loads all the
records so it can render them.

closes odoo/odoo#120654

X-original-commit: 885c7bb33a3cb25962c090290e6b27bc11a71f41
Signed-off-by: Luca Vitali <luvi@odoo.com>
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2023-05-05 13:52:34 +02:00
Alexandre Kühn 78b275f54d [REF] mail: simplify message template
Simplify template so there are less code duplication between
editing state and non-editing state.

Also fixes following small style issues:
- missing opacity-25 when editing message of others
- expanded options of message come on top of jump present alert

closes odoo/odoo#120550

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-05 13:52:29 +02:00
Julien Mougenot 7874bf3fc1 [IMP] web: Function fieldDependencies + utils doc
This commit does the following in the Web module utilities:

- makes the `fieldDependencies` property of the field objects
definitions a function instead of a list of strings: this makes it
possible for fields to extract their dependencies based on the fields
info from the arch;

- adds/improves types and documentation for some utility functions.

Part of task 3121497

Part-of: odoo/odoo#112171
2023-05-05 13:52:21 +02:00
MerlinGuillaume 6b4835e229 [FIX] mail: disable the sidebar when opening a pdf in the chatter
The pdf viewer sometimes displays the sidebar when we open the pdf

Solution:
Add `pagemode=none` to the url when opening a pdf in attachments

opw-3193516

closes odoo/odoo#120530

X-original-commit: bd5f00e2c1f183ec7bb299a1db64efbd0542eb49
Related: odoo/enterprise#40746
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-05 11:37:29 +02:00
Renaud Thiry 39f14ca2c9 [IMP] mail: add auto_comment message type
Currently some auto_reply templates are internal as a means to prevent
notifying users everytime we send a reply to somebody.

This raises the issue that since responses to internal notifications
are themselves internal notifications, often nobody will be notified of
responses to these automated messages.

We fix this by marking these messages as auto_comments, which will
ensure responses to these messages are
considered non-internal (and thus 'discussions', by default).

task-2834304

closes odoo/odoo#94018

Related: odoo/enterprise#35466
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-05 09:25:42 +02:00
Alexandre Kühn 08a6a5781e [FIX] mail: disable open chat from click on self-authored messages
Before this commit, when clicking on self-authored messages, it was
opening the form view.

It should neither open chat nor open form view for self-authored
messages.

closes odoo/odoo#120484

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-05-04 20:34:00 +02:00
Alexandre Kühn ec8dc607d0 [FIX] mail: consistent unread/needaction of channel in messaging menu
Before this commit, unread and needaction shown in messaging menu
was inconsistent with discuss sidebar.

In discuss sidebar, unread channel are bold, and needaction are
shown with badge + counter. In messaging menu, previews could be
either unread or needaction previews, and channels had 2 previews,
one for unread, and the other for needaction.

This commit make the messaging menu preview of channels more
consistent with discuss sidebar:
- channels have a single preview for unread and needaction
- unread messages make title bold, unread counter is no longer shown
- the counter displays needaction on this channel instead.

This commit also improves ordering of messaging menu items, so that:
- needactions have precedence over non-needactions
- unread channels have precedence over read channels

Task-3293723

closes odoo/odoo#120144

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-04 19:10:20 +02:00
Maryam Kia ec93077b8d [IMP] mail: Edited label on edited message
By this commit, If a user edits the message body or changes
the message attachments, the edited label in the blob,
shows the last edit Info.

Task-2664848

closes odoo/odoo#117896

Related: odoo/enterprise#40208
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-04 14:03:42 +02:00
Alexandre Kühn c0ce6ca7b6 [FIX] mail: do not auto-open chat window when self-posting a message
Before this commit, when posting a new message in a channel in the
discuss app, a chat window of this channel was automatically open.

This happens because new message from self where considered
new messages in a channel, and all new messages in a channel
were automatically opening a chat window.

This commit fixes the issue by not making self-authored messages
automatically open the chat window.

closes odoo/odoo#120478

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-05-04 08:56:20 +02:00
Alexandre Kühn 9f115fce17 [FIX] mail,*: fix style in 1st column of activity view
Task-3290752

closes odoo/odoo#120189

X-original-commit: a97c86a2b962f56955e3c16b7ad99cabb0b13b9c
Related: odoo/enterprise#40564
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-03 17:24:58 +02:00
Didier (did) be311dfc7c [IMP] mail: remove useless t-set
closes odoo/odoo#120242

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-05-03 12:39:48 +02:00
Didier (did) 0cb19acd04 [FIX] mail: guard an optional props
Before this PR, using the message component wihtout a thread could crash because
props.thread could be undefined (as thread is an optional props).
This PR just add the guard.

closes odoo/odoo#120233

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-05-03 12:39:45 +02:00
Sébastien Theys f9ca72dca9 [REF] mail: move CallSettings code to discuss folder
Part of task-3265211

closes odoo/odoo#120314

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-02 22:26:44 +02:00
Sébastien Theys 197d9a7dc6 [REF] mail: move ChannelMemberList code to discuss folder
Part of task-3265211

Part-of: odoo/odoo#120314
2023-05-02 22:26:43 +02:00
Sébastien Theys a843eb776f [REF] mail: move ChannelInvitation code to discuss folder
Part of task-3265211

Part-of: odoo/odoo#120314
2023-05-02 22:26:43 +02:00
tsm-odoo 0c919774ea [FIX] mail: fix non-deterministic message test
Before this PR, the `Updating the parent message of a reply also
updates the visual of the reply` test was failing in a non-deterministic
fashion.

This PR fixes this issue by replacing the `nextTick` by a  specific
`waitUntil` in order to ensure the DOM is properly updated before
asserting.

Fixes 20829 runbot issue.

closes odoo/odoo#120273

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-02 15:59:13 +02:00
Alexandre Kühn 9cfb6fe471 [FIX] mail: no scroll on small chatter
Before this commit, when chatter message list was lower
than 2500px, the message-list had scrollable of 2500px
of height.

This happens because the area detecting present time was
always 2500px. thus making the content have this value as
scrollheight.

This commit fixes the issue by making presence area not
go above the conversation height. So if message list is
250px of height, then presence area is 250px, not 2500px.

closes odoo/odoo#120173

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-02 14:47:31 +02:00
FrancoisGe 91111f33ef [REF] web: dynamicInfo domain becomes a function
In commit 2ecfed335d, we made the decision
to pass the domain to the field during extracProps with a getter in dynamicInfo.
This strategy causes the domain to be evaluated for all fields using it
in their extractProps. Very often we want to evaluate the domain on
an event, for example when a m2o is clicked on. The permanent evaluation
when using the widget therefore implies an unnecessary computational cost
for the evaluation and prevents the use of field.domain as a default value,
as it may be present in readonly views which never need the domain to be evaluated.

We will therefore convert the getter domain into a function that can be
called when we need the domain to be evaluated. This allows us to avoid
unnecessary evaluations and we can use field.domain as the default value
in the dynamic.domain.

closes odoo/odoo#120061

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-28 13:33:28 +02:00
Alexandre Kühn e155eda05c [FIX] mail: no crash when mentioning partner after channel mention
Steps to reproduce:
- Open channel general
- type "#" in composer so it prompts "#general"
- delete "#"
- type "@" in composer

This happens because the partner suggestion part relies on raw server
data in model thread, `thread.channel`, which is erased from the
channel suggestion. This was used to detect whether partner is member
or not, in `thread.channel.channelMembers`.

This commit fixes the issue by making partner suggestion relies on
more reliable data in models, `thread.channelMembers`.
`thread.channel` is deprecated, and will eventually be removed.

closes odoo/odoo#119935

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-28 13:33:17 +02:00
Sébastien Theys 09ac15e2dd [REF] mail: clean code for message update
As a bonus, add cross-tab update for current user in chatter.

Part of task-3265211

closes odoo/odoo#120018

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-28 12:26:43 +02:00
Didier (did) 19abfc1f66 [IMP] mail: update link previews when editing a message
Before this PR, link previews where not updated when a user was editing a
message.
This clear the current link previews and reprocess the updated message.

closes odoo/odoo#119917

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 18:25:13 +02:00
Sébastien Theys c1a3ad8e01 [REF] mail: move channel specific code of reaction to discuss
The opportunity is taken to clean the methods to make the override
actually possible.

Part of task-3265211

closes odoo/odoo#119942

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 17:21:53 +02:00
Bruno Boi f22961ad07 [FIX] web,*: repair root class attr
*: web + adaptations in base, fleet, hr, hr_expense, hr_recruitment,
   loyalty, lunch, mail, mass_mailing, note, project, stock, survey,
   web_tour

**Foreword**
Since d19037e141 the rootnode class attribute for form/list views was
copied two times:
- on the o_view_controller div
- and on the root node of the view renderer.

Examples:

<form class="foo">...</form>

    gives

<div class="o_view_controller o_form_view foo">
    <div class="o_control_panel">...</div>
    <div class="o_content">
        <div class="foo o_form_editable ...">...</div>
    </div>
</div>

and

<list class="foo">...</list>

    gives

<div class="o_view_controller o_list_view foo">
    <div class="o_control_panel">...</div>
    <div class="o_content">
        <div class="o_list_renderer foo ...">...</div>
    </div>
</div>

**Issue**
This could lead to confusion and also unexpected styling issues.
See this PR #119815 to read a message JS Framework team has received.
See also another a fix that had to be made for x2m fields: 980244fa8

**Introduced Changes**
- in the form compiler, the root node attributes are no more copied to
  the root div node of the compiled template the form renderer receives
- the root div node generated by the form compiler now has the
  "o_form_renderer" class, which was removed during the recent form view
  refactoring.
- the list renderer no more adds the root node class attribute to its
  "o_list_renderer" div
- the X2ManyFieldDialog has been adapted too
- since View, X2ManyField & X2ManyFieldDialog both need to compute view
  classnames derivated from the arch root node, an util has been
  introduced to avoid duplicating code
- the whole codebase has been checked and adapted.

Related: odoo/enterprise#40418
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-04-27 16:10:30 +02:00
Jan Brodersen (Armitxes) 5d5099a0f5 [FIX] mail: No crash from "enumerateDevices" in discuss calls
Before this commit, when accessing the discuss call settings
in non-localhost without SSL, there was the following crash:

```
"Cannot read 'enumerateDevices' of undefined"
```

Odoo uses zxing-js to detect devices within the discuss app.
zxing-js provides methods such as "hasNavigator",
"isMediaDevicesSuported" or "canEnumerateDevices" to check if
features are available. These are not called by Odoo before using
the related features what can result in a JS traceback.

This commit fixes the issue by showing a warning as a toaster
notification and in the dev tools, instead of a traceback.

The zxing-js methods are not exposed, hence the reliance on
truthy mediaDevices.

See also https://github.com/zxing-js/library/issues/225

Closes https://github.com/odoo/odoo/issues/112255
Closes https://github.com/odoo/odoo/pull/112813

closes odoo/odoo#119903

X-original-commit: 32238dd680396c6ccb519aa8b3fb7487c38395f7
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 12:31:39 +02:00