Commit Graph
4030 Commits
Author SHA1 Message Date
Sébastien Theys 7c995c4282 [IMP] mail: move suggestionViews to ComposerSuggestionListView
To correctly follow DOM tree in models.

Part of task-2741982

Part-of: odoo/odoo#95341
2022-07-08 18:44:58 +02:00
Sébastien Theys ff461773d0 [IMP] mail: introduce main and extra suggestions on composer view
Suggestion list view should depend on finding suggestables, not on the existence
of suggestion views (which themselves have to be computed on the suggestion list
view instead).

Part of task-2741982

Part-of: odoo/odoo#95341
2022-07-08 18:44:57 +02:00
Sébastien Theys 2943b95673 [IMP] mail: rename ComposerSuggestion to ComposerSuggestionView
Part of task-2741982

Part-of: odoo/odoo#95341
2022-07-08 18:44:57 +02:00
Sébastien Theys 2f561252d7 [MOV] mail: rename ComposerSuggestion to ComposerSuggestionView
Part of task-2741982

Part-of: odoo/odoo#95341
2022-07-08 18:44:57 +02:00
Ipsita Borisagar bd832118ee [FIX] mail: remove deprecated exists check
The deprecated exists check(located in getFieldValue (ModelManager)) is removed,
but a lot of tests will fail after removing this check because it will try to
read fields after records are deleted. So added some missing exists checks.

Task-2871062

closes odoo/odoo#95415

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-08 14:33:59 +02:00
Didier (did) ee61cc4259 [FIX] mail: correctly return a field command when guest
Before this commit, field command was returning incorrect value if the
channel_partner was a guest. At the very least we have to return a `clear`
command.

closes odoo/odoo#95411

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-08 14:33:55 +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
Romeo Fragomeli 9b5c9484fe [REF] *: BS5: adapt changes in media query mixin
> Media query mixins parameters have changed for a more logical approach

> media-breakpoint-down() uses the breakpoint itself instead of the next
> breakpoint (e.g., media-breakpoint-down(lg) instead of
> media-breakpoint-down(md) targets viewports smaller than lg).
> Similarly, the second parameter in media-breakpoint-between() also
> uses the breakpoint itself instead of the next breakpoint (e.g.,
> media-between(sm, lg) instead of media-breakpoint-between(sm, md)
> targets viewports between sm and lg).

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

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli eee625bbb0 [REF] *: BS5: Migrate btn-block
Due to the removal of btn-block we need to change the display to grid

> Dropped .btn-block for utilities. Instead of using .btn-block on the
> .btn, wrap your buttons with .d-grid and a .gap-* utility to space
> them as needed

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

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:23 +02:00
Romeo Fragomeli e1ea58c941 [REF] *: BS5: Migrate dropdowns
- BS5 JS use the `data-bs-toggle="dropdown"` attribute to
automatically enable the BS Component.
But in this case as the `.dropdown-menu` is only rendered when the
`.dropdown-toggle` is clicked we can't initialize the Dropdown at the
first render. So we do it manually.

- change .dropdown-menu by .o-dropdown-menu (owl)
  -> to handle keyboard navigation we can't use BS dropdowns

- use currentTarget of event
  As the event can bubble we use currentTarget to be sure to be at the
  higher level in the DOM.

> All the events for the dropdown are now triggered on the dropdown
> toggle button and then bubbled up to the parent element.

- BS5 don't add .show on parent group anymore
  -> dropdown show class not on the same node on BS5

- avoid dropdown warning using margin in CSS
  BS5 show a warning if we use margin statically in CSS for a dropdown.

> Popper: CSS "margin" styles cannot be used to apply padding between
> the popper and its reference element or boundary. To replicate margin,
> use the `offset` modifier, as well as the `padding` option in the
> `preventOverflow` and `flip` modifiers.

- adapt the systray activity dropdown for mobile
  On desktop positions are now dynamic and on mobile it's static

- In BS5 the CSS `bottom: 100%;` is not more applied to the
  `.dropup .dropdown-menu` selector.

- Change right -> end and add data-bs-popper="none" to avoid
  Popper interaction

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:19 +02:00
Romeo Fragomeli 68a3bd651f [REF] *: BS5: Migrate tables
- avoid black border in table of BS5

In BS5 there is a new rule:
```css
.table > :not(:first-child) {
    border-top: 2px solid currentColor;
}
```
This rule generate unwanted border in our visual, so we change the color
to the old one we have in BS4 and in some case set the `border-top` to
´none´.

PS: another solution is to use the `table-borderless` class, but then
we have `tr` flickering for the height in list view (edit mode).

- table background-color :
  * BS4:
  the background color is set with the `background-color` property
  * BS5:
  it's set with a box shadow and the `--table-accent-bg` CSS variable

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:19 +02:00
Romeo Fragomeli 9ea1351334 [REF] *: BS5: Migrate forms and inputs
- BS5 uses native inputs instead of pseudo-element for some
  input like checkbox, radio, ...
  in BS5 input checkbox don't have "virtual visual" checkbox anymore
  (::before), so we remove the relative's rules

- removed `.custom-control` class

- `form-switch` use a new layout system in BS5 we adapt the code to
  match the Bootstrap approach (inline SVG).

- In tests, we don't check the exact value of the background as it
  change in community/enterprise, and it's difficult to check the value
  of an SVG.

- Overflow in progressbar is now hidden.
  -> we had to restore it.

- In BS5 margins in forms/inputs has been changed
  -> we had to restore it (e.g. 'mb-3')

- .form-group, .form-row, .form-inline
> Dropped form-specific layout classes for our grid system.
> Use our grid and utilities instead of .form-group, .form-row,
> or .form-inline.

- .input-group-append and .input-group-prepend
> Dropped .input-group-append and .input-group-prepend.
> You can now just add buttons and .input-group-text as direct
> children of the input groups.

Ref:
[1] https://getbootstrap.com/docs/5.1/migration/#forms

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:18 +02:00
Romeo Fragomeli b82ba2a8fd [REF] *: BS5: Migrate modals and .btn-close for modals and alerts
- modal 'show' option doesn't exist anymore
  -> We need to call .show()

- by default, show is not the default
  -> we need to call .show() explicitly.

- generic close button for dismissing content like modals and alerts.

- BS5 modals needs `modal-dialog` class to work

- normally we need also to add `modal-content` class but as the original
XML don't have this nested level of div we don't use it, but instead
we add `pointer-events: auto` for all children `DIV` of `modal-dialog`
-> See DocumentViewer

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:18 +02:00
Romeo Fragomeli ac584e171d [REF] *: BS5: Migrate Badge
From [1]:
> Dropped all .badge-* color classes for background utilities
> (e.g., use .bg-primary instead of .badge-primary).

We now have to manage constrast for some badge. It's why we
add 'text-dark' at some point.

Note:
Due to the backport of 'text-bg-#{theme}', we can use this to
avoid to use 'text-dark'.

Ref:
[1] https://getbootstrap.com/docs/5.1/migration/#badges

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:18 +02:00
Romeo Fragomeli 3c4ffd1c89 [REF] *: BS5: remove hover mixins usage (due to BS5 removal)
* = mail, survey, web, web_editor, website, website_event, website_mail

removed mixins:
* hover
* plain-hover-focus
* hover-focus

These mixins are now replaced by their CSS equivalent.

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:16 +02:00
Sébastien Theys 87c7c82286 [FIX] mail: remove readonly from isSquashed
There are situations where a message view is re-used in a different context
where the isSquashed value has to change.

For example a message being starred could be squashed in its original thread but
not squashed in the starred box, leading to a crash before this fix.

closes odoo/odoo#95403

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-07-06 20:18:23 +02:00
William Braeckman d54c6a7c12 [FIX] mail: fix css for o_kanban_attachment
This commit fixes the css rule for the class `o_kanban_attachment` that
was broken for owl kanban views since f795af0160ed7977d07041d1bb1923598df48320.

closes odoo/odoo#95444

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-07-06 17:10:45 +02:00
Sébastien Theys 60d1d69b19 [IMP] mail: clean unnecessary CSS selectors
`.o-isInFormSheetBg` and `.o-aside` are mutually exclusive.

Part of task-2871070

closes odoo/odoo#95323

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-07-05 16:20:43 +02:00
Sébastien Theys d8fc0e07b9 [IMP] mail: simplify conditions that control chatter position
This better highlights the different cases that need to be handled.

Part of task-2871070

Part-of: odoo/odoo#95323
2022-07-05 16:20:43 +02:00
Louis Wicket (wil) c56c5ca28f [FIX] mail: don't crash on click reply
Fix bug introduced in https://github.com/odoo/odoo/pull/94948.
Add test for MessageInReplyToView.

closes odoo/odoo#95303

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-05 12:42:39 +02:00
Sébastien Theys 637c57cb14 [IMP] mail: remove _delegateEvents fix
The bug this code was supposed to fix is no longer reproducible following
recent improvements in the rest of the code.

Part of task-2871070

closes odoo/odoo#95218

Related: odoo/enterprise#29077
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-07-04 18:53:22 +02:00
Sébastien Theys ee0b42d4b6 [IMP] mail: remove useless condition on attachmentsInWebClientView
`attachmentsInWebClientView` is necessarily true if `hasAttachmentViewer` is
true above

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:21 +02:00
Sébastien Theys 935ca62a1f [IMP] mail: remove _updateChatterContainerTarget
It is only called inside `_interchangeChatter`, therefore its code can be moved.

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:21 +02:00
Sébastien Theys 7fd20304ea [IMP] mail: remove useless _updateChatterContainerTarget
None of the values that changes the result of this method have changed in this
case.

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:21 +02:00
Sébastien Theys c7b6299dd0 [IMP] mail: move _interchangeChatter to _updateView
This allows removing the _renderView override and opens up further clean up.

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:21 +02:00
Sébastien Theys 18efe5383b [FIX] mail: properly position the chatter inside form sheet
task-2900627
part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:20 +02:00
Sébastien Theys d5221153f3 [IMP] mail: read thread from state rather than event
Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:20 +02:00
Sébastien Theys 9c0a2df0ff [IMP] mail: move _onChatterRendered to community
This will reduce the overrides in enterprise.

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:20 +02:00
Sébastien Theys b9abc680d9 [IMP] mail: move _interchangeChatter to community
This will allow to reduce the number of overrides in enterprise.

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:20 +02:00
Sébastien Theys 0bf3a1dac3 [IMP] mail: move attachment viewer widget to community
This will allow to reduce overrides in enterprise, and we want to display the
feature in community soon as well.

Part of task-2871070

closes odoo/odoo#95085

Related: odoo/enterprise#29036
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-01 20:41:40 +02:00
Sébastien Theys d32865aa91 [IMP] mail: introduce messaging variable in form renderer code
It is used in enterprise to further clean up the code.

Part of task-2871070

Part-of: odoo/odoo#95085
2022-07-01 20:41:40 +02:00
Sébastien Theys 3e33deb48f [IMP] mail: move hasAttachmentViewerFeature in community
Part of task-2871070

Part-of: odoo/odoo#95085
2022-07-01 20:41:40 +02:00
Sébastien Theys f085040dfa [IMP] mail: remove jquery from form renderer
Part of task-2871070

Part-of: odoo/odoo#95085
2022-07-01 20:41:40 +02:00
Sébastien Theys 779175fd42 [IMP] mail: move hasAttachmentViewer in community
This reduces the need for overrides in enterprise.

Part of task-2871070

Part-of: odoo/odoo#95085
2022-07-01 20:41:40 +02:00
Sébastien Theys 8bb675ffa5 [IMP] mail: better documentation for __renderView override
Part of task-2871070

Part-of: odoo/odoo#95085
2022-07-01 20:41:39 +02:00
Sébastien Theys d5ed1069f0 [IMP] mail: introduce ComposerSuggestable model
This will allow to remove AND/OR mix in identifying fields of composer
suggestion view.

Part of task-2741982

closes odoo/odoo#94999

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-01 16:35:59 +02:00
Sébastien Theys 7b464a992b [IMP] mail: introduce MessageListViewMessageViewItem
This allows to remove the AND/OR mix from message view identifying fields.

Part of task-2741982

closes odoo/odoo#94948

Related: odoo/enterprise#28988
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-01 16:35:49 +02:00
Sébastien Theys 723cfddf38 [IMP] mail: move messageViews from ThreadView to MessageListView
Part of task-2741982

Part-of: odoo/odoo#94948
2022-07-01 16:35:49 +02:00
Nemael 68bb383852 [IMP] mail: improve EmojiPicker (step 1)
Emoji picker now has a bar to filter
emojis per category.

Task-2898475

closes odoo/odoo#94646

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-01 16:35:28 +02:00
Alexandre Kühn 8cce4e3694 [MOV] mail: rename EmojiList to EmojiPickerView
Part-of: odoo/odoo#94646
2022-07-01 16:35:28 +02:00
Alexandre Kühn 1e67f46544 [IMP] mail: rename EmojiList to EmojiPickerView
Part-of: odoo/odoo#94646
2022-07-01 16:35:27 +02:00
Sébastien Theys 250f72d960 [IMP] mail: fix race condition in tests
Probably introduced in PR changing rendering of chatter in form renderer that
changed timers in unfortunate situations.

Open form view utils was missing an await on (chatter container) render, but the
issue was not perceptible before.

closes odoo/odoo#95003

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-30 19:56:45 +02:00
Rahul Prajapati dfb122b960 [IMP] mail: add message backlink on replyingto in composer
Before this commit:

There is no backlink to message on 'Replying To' in header of Composer

After this commit:

There is a backlink to message

Task-2664839

closes odoo/odoo#94873

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-30 14:14:45 +02:00
Aaron Bohy 0196c052f1 [FIX] mail: check existence of record in FollowerListMenu
This commit fixes a race condition that makes several tours crash.
The reason is that the underlying record is removed from the model
which produces a re-rendering. At the end of that re-rendering,
a component is unmounted. At that point, we remove an handler
relying on the existence of the record. As a consequence, there
was a short time window during which the handler would crash if it
was called.

Part-of: odoo/odoo#92475
2022-06-30 09:29:48 +02:00
Aaron Bohy 4f984568e1 [REF] *: adapt code to new kanban view
This commit makes various adapations in addons with respect to
the introduction of the owl kanban view. Mainly, some selectors
in scss and in tests needed to be adapted. Moreover, in some tests
that we haven't adapted yet, we must ensure that legacy form and
list views are still used (useLegacyViews).

It also contains some adaptations in kanban templates, e.g. the
replacement of moment by luxon, the removal of underscore...

Part-of: odoo/odoo#92475
2022-06-30 09:29:45 +02:00
+2 48ef812a63 [REF] web: kanban, list and form views in owl
This commit introduces the new kanban, list and form views written
in owl. Even though it contains the implementation of those 3 views,
only the kanban view is activated for now (the list and form views
aren't 100% ready yet, so they aren't added to the view registry).

Alongside the views, the fields (<field name="..."/> in archs) and
widgets (<widget name="..." in archs) of web/ have been implemented
in owl as well. Legacy ones remaining in other addons are supported
in our new views, thanks to a compatibility layer. The goal is to convert
them asap though.

Legacy views, fields and widgets are kept for now, which explains the
number of added lines in this PR (around half of them concern tests).
They are still extended by custom code in other addons, that still need
to be converted (a lot of them are already on the way). Moreover,
they are still used in Studio as well. The plan is to lazy load them in
the Studio bundle when all custom code extending them will be
converted. Studio will be converted for v17.

Part-of: odoo/odoo#92475
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: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2022-06-30 09:29:44 +02:00
Thanh Dodeur b52c966ff3 [REF] mail: move CallView's main display to its own model/component
part of task-2692836

closes odoo/odoo#94541

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-29 14:44:26 +02:00
Thanh Dodeur 321fc728de [FIX] mail: add cursor pointer to the call participant card
Part-of: odoo/odoo#94541
2022-06-29 14:44:25 +02:00
Thanh Dodeur 2fdda743a8 [FIX] mail: fix the offset of the sidebar button of the callView
Part-of: odoo/odoo#94541
2022-06-29 14:44:25 +02:00
xlu-odoo 2453eda926 [REF] mail: callOptionMenu, review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2855813

closes odoo/odoo#91563

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-28 16:03:14 +02:00