Commit Graph
227 Commits
Author SHA1 Message Date
Pierre Paridans eef262abf4 [FIX] *: adapt QUnit tests and tours
[FIX] *: selectors in tours

[FIX][TMP] account: CogMenu selector in tours

[FIX][TMP] web*: Breadcrumb targetting in tours

Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).

add classname on last breadcrumb item

[FIX][TMP] project: View buttons selector in tours (moved away from CP)

[FIX][TMP] project: Kanban selectors in tours (quick create)

[FIX][TMP] *: SearchBar selectors in tours (toggle menu)

[FIX][TMP] *: ButtonBox selector in tours

[WIP][IMP] web: add toggleSearchBarMenu in search helpers

adapt and unskip 3 list tests

adapt and unskip calendar tests

unskip web_tour test that actually pass

post rebase fix

allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later

post rebase fixes

fix

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
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
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
amdi-odoo a8e9b25761 [IMP] crm: add monthly lead assignment count color
Draw attention to the monthly assigned lead count when
it is exceeding the limit by changing the text color
to orange.

Task-3204763

Part-of: odoo/odoo#115326
2023-05-05 12:43:59 +02:00
Jorge Pinna Puissant baebb6a5b0 [REF] web, *: Unique id for field nodes
Before this commit, the field node id (`field_id`) uses the field name
for the first occurrence on the arch, and add an underscore and a number
for the rest of the occurrences. This can create inconsistencies when
sombody assumes that the field_id is equal to the name, and don't take
into account the possibility of multiple occurrences.

Now, a unique id is created since the first occurrence, this remove all
ambiguity between the id and the name.

Part-of task-id 3179751

closes odoo/odoo#117799

Related: odoo/enterprise#39511
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-11 15:17:20 +02:00
FrancoisGe afbdce664f [IMP] web: remove read in kanban grouped with group_by_tooltip
This commit introduces an optimization to reduce the number of read
operations performed in kanban views that are grouped by a field with
a group_by_tooltip. Specifically, we now fetch the required values
from group_by_tooltip only when the tooltip is first opened, instead
of performing a read every time the view is loaded.

Part of Task: 3179751

closes odoo/odoo#117758

Related: odoo/enterprise#39349
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-07 07:28:09 +02:00
Michael (mcm) ff0d6dd580 [REF] *: replace odoo module by native one
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.

task id: 3162300

closes odoo/odoo#117305

Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-03 17:07:24 +02:00
FrancoisGe a2342f636c [REF] web,crm: remove allow_group_range_value
The allow_group_range_value option is used in one arch of a kanban in
CRM. We therefore believe that this is not standard behaviour.
So we decided to move this logic to the custom view that uses it.

Part of Task: 3179751

closes odoo/odoo#117023

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-30 10:53:59 +02:00
Bruno Boi ba45832946 [REF] web,*: change a KanbanColumnQuickCreate prop
*: crm

Before this commit, the KanbanColumnQuickCreate receives
the groupByFieldString property as a string.
This commit changes that in order to give the groupByField object.

This change eases the further work in same pull request.

Taskid: 3246042
Part-of: odoo/odoo#115909
2023-03-29 09:33:34 +02:00
Géry Debongnie 3db0ad01a1 [REF] web, *: rework webclient cache invalidation system
The web client has a mechanism to invalidate the action and the view
cache: in the basic model (and the relationalmodel), some code is
looking for updates to some specific models (such as ir.actions) and
trigger a `CLEAR-CACHE` event. This event is then listened by the action
and view services to properly clear the caches.  This mechanism was also
used to reload the page after editing a company, or reloading the
currencies after editing some currency.

With this commit, we modify the orm service to trigger an event after
each rpc. This event can then be used by the action/view service, and
also by the currency/company services to perform their specific cleanup.
This work is one step in the future refactoring of the relational model.

closes odoo/odoo#115655

Related: odoo/enterprise#38814
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-27 16:04:58 +02:00
Louis Wicket (wil) 0c53d28133 [IMP] *: remove "French spacing"
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#116167

Related: odoo/enterprise#38542
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-03-24 12:50:13 +01:00
7710c3331e [REF] mail, *: refactor Discuss
This commit refactors discuss code to use OWL components
and new tools and services in web/.
Functionally, Discuss app should work relatively the same as
before this commit.

closes https://github.com/odoo/odoo/pull/110188

Related:
https://github.com/odoo/enterprise/pull/38058
https://github.com/odoo/upgrade/pull/4423

closes odoo/odoo#110188

Related: odoo/upgrade#4423
Related: odoo/enterprise#38058
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre (aku) <aku@odoo.com>
Co-authored-by: Didier (did) <did@odoo.com>
Co-authored-by: Géry (ged) <ged@odoo.com>
Co-authored-by: Louis (wil) <wil@odoo.com>
Co-authored-by: Maël (mapa) <mapa@odoo.com>
Co-authored-by: Maryam (maki) <maki@odoo.com>
Co-authored-by: Sébastien (seb) <seb@odoo.com>
Co-authored-by: Thanh (tso) <tso@odoo.com>
Co-authored-by: Matthieu (tsm) <tsm@odoo.com>
Co-authored-by: Zelong (zel) <zel@odoo.com>
2023-03-17 11:47:09 +01:00
Joseph Caburnay e1c088a8ce [FIX] web: auto save record when changing value of 'toggle' fields
Before 16.0 and the "always edit" form views, some fields allowed to
be edited in readonly (e.g. the statusbar in crm lead or project
task). Users could thus change the stage of a record in readonly and
the change was saved directly. If the field was tracked, the change
was even logged in the chatter directly. Since the form view is always
in edition now, we loose that behavior and the user must click on the
save cloud icon to manually save and see the tracking messages. To
mitigate this, those fields that were editable in readonly could save
the record directly when edited, like buttons do.

Changing the values of the following fields should automatically save
the record.

- BooleanToggleField
- PriorityField
- StateSelectionField
- StatusBarField

To accomplish this, we now unconditionally save the record when the above
mentioned fields are changed.

closes odoo/odoo#115500

Task-id: 3175672
X-original-commit: c9b7c43c69eaf87e7900801b926d3868adc36d8c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-03-16 13:07:57 +01:00
Joseph CaburnayandJulien Mougenot 3a798039d6 [REF] web_tour,*: convert web_tour to owl
* The tours are now run by the `MacroEngine` defined in `macro.js`.
  * This is accomplished by converting (at runtime) the user-defined tours to
    `Macro`s. See `tour_compilers.js` for the step (and tour-to-macro) compilation.
* API is kept the same as much as possible. Basically, declaring tours stayed
  the same with some exceptions:
  * `allowInvisible` can be provided in a step to allow consuming the trigger
    element even if it is invisible.
  * `isCheck` can now be used to replace the no operation `run` that is
    traditionally signals the runner to only perform a check.
  * Before, multiple `run`s can be called simultaneously. Now, each `run` method
    is awaited before proceeding to the next step.
* If the trigger element is `disabled`, the tour runner will *not* proceed on
  calling the `run` method and the runner will stay on current step until the
  trigger element becomes `enabled`.
  * However, the tour runner is okay with `disabled` trigger element if the step
    has `isCheck = true`. As long as the trigger element is found for `isCheck`
    step, the tour runner will happily move to the next step.
* Some tours are adjusted to properly run with this new tour runner.
* When the tour failed:
  * The dom string is not logged anymore.
  * However, a warning message containing the relative location of the step will
    be logged. This is better in helping the author in locating the failed step.

**Some guidelines learned during the development:**

* Each step may trigger a dom mutation. It's a good practice to insert an
  intermediate step that *checks* the existence of an element that result from
  the action of the previous step.
* Refrain from using the `run` method for assertions. `run`, in principle, is
  provided to perform actions that are not offered by the helper. Use the
  `trigger` for assertions.
* During dev, find `SHOW_POINTER_DURATION` and set it to `250`. This will show
  the pointer (pointing to the trigger element) for 250ms when watching the
  tour.

closes odoo/odoo#107618

Task-id: 3082036
Related: odoo/enterprise#37560
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2023-03-15 13:19:45 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
Bruno BoiandMathieu Duckerts-Antoine d19037e141 [IMP] web,*: better classes handling in view archs
**Before this commit**
- The optional "class" attribute set on the root node of a view arch
  is ignored, except for the kanban view which has a custom
  way of using it.
- The optional "js_class" attribute set on the root node of a view arch
  does not have any impact on the class names passed to its controller.

**After this commit**
The content of the optional attribute "class" set on the root node of an
arch like in

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

as well as an additionnal class derived [1] from the value of the
"js_class" attribute set on the root node of an arch like in

<list js_class="extended_list">
    ...
</list>

will both be found in the prop "className" of any view controller.

[1] a js_class value of "xyz" yields to the class "o_xyz_view"

**Note on this commit**
The kanban view was already appending the root node class attribute
to its renderer element. This is no longer the case and some styling
rules has been adapted.

closes odoo/odoo#113014

Related: odoo/enterprise#37265
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2023-03-01 17:01:03 +01:00
Géry Debongnie b53f78e224 [REF] web_tour,*: use the registry in collecting the tours
This is a step closer to a goal of avoiding dependence on asynchronous
modules. Starting from this commit, new tour definition should be
registered to `registry.category("web_tour.tours")` registry.

So, instead of the following:

```js
import tour from "web_tour.tour";
tour.register(name, options, steps);
```

We now do:

```js
import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add(name, optionsWithSteps);
```

Notice the `options` and `steps` params are merged when registering
the tour definition. It should look something like so:

```js
registry.category("web_tour.tours").add("account_tour", {
  test: true,
  steps: [ ... ],
});
```

And if the `TourManager` instance is needed, one can get it from the
registry like so `registry.get("tourManager")`. Note however that
this instance is only available when the `TourManager` has been
instantiated -- so it's not available at top level of the module.

closes odoo/odoo#111103

Related: odoo/enterprise#36335
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-01-27 23:17:35 +01:00
abd-msyukyu-odoo 14d68b775f [IMP] crm: correctly combine domains for lead forecast facets
The `forecast_filter` facet (aka Upcoming Closings) would have been combined
with other filters from the same group with a logical 'AND' while displaying an
'OR' combination. Fortunately it is currently the only item of its group so it
does not cause a problem.

This commit fix the inconsistency so that `forecast_filter` using the
forecast_search_model won't have this issue in the future.

Task-2657578

closes odoo/odoo#109996

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-20 20:58:26 +01:00
abd-msyukyu-odoo 6df5488ecf [IMP] crm: stop using moment
Replace moment calls by their equivalent with the luxon library in CRM, and make
use of date utils from the l10n module.

Task-3056665

closes odoo/odoo#109882

Related: odoo/enterprise#35777
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-20 20:58:21 +01:00
abd-msyukyu-odoo b0d3da37ea [IMP] crm: owl improvements
Applies minor fixups to improve owl usage in CRM, following the JS team advice:
https://github.com/odoo/odoo/pull/104975

* remove unused export
* use orm service from model
* remove redundancy for component call

Task-3056665

Part-of: odoo/odoo#109882
2023-01-20 20:58:21 +01:00
Michael (mcm) 65e43dd881 [IMP] web: make kanban group header sticky
This commit makes the kanban group header sticky, it means that when
the user scrolls the headers will still be visible on top of the view.

closes odoo/odoo#109060

Task: 2050014
Related: odoo/enterprise#35611
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-13 16:27:43 +01:00
Aaron Bohy 509132f46b [FIX] crm,web: no crash when quickly d&d records in pipeline
Before this commit, there was a crash if you quickly dragged&dropped
twice the same record from a column to another (i.e. before the
first write was done). This was because we couldn't find (yet) the
record from the column we were dragging it.

This commit prevent the crash from happening.

closes odoo/odoo#109694

X-original-commit: b57238b577342d9a4c824b90eb7fa2a4b8e00a8e
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-12 10:05:49 +01:00
luviandFlorent Dardenne 28927c2eeb [REF] web, crm: adapt Kanban progressbar to be a component
This commit moves some parts of the code used by the progress bar of kanban
to its own component. It is now clearer to distinguished its code from the
renderer code (see crm_kanban_renderer). Also, it allows to re-use this
component in other views without making a direct use of 'kanban' elements.

The KanbanAnimatedNumber component has simply be renamed to AnimatedNumber,
as this naming suggested the element was only used as a Kanban element. This
more generic name now indicates that the element can be imported and used in
other places.

Part-of: odoo/odoo#107916
Co-authored-by: Florent Dardenne <dafl@odoo.com>
2022-12-23 16:07:05 +01:00
Aurélien Warnon f43b9e01c2 [FIX] sales_team: allow creating team in mono-company mode
Currently, adding members in a sales.team without the multi-company group is
not possible, the selection does not show any users.

This is because the domain field for the users search ("member_company_ids") is
not computed as none of its triggers are present in the view.

To fix this, we add the 'name' field as a fake trigger to force the
computation.

Side-note: the tour was added into the CRM module as we require this module to
have entry menus into crm.team form views.

Task-3088861

closes odoo/odoo#107352

X-original-commit: 11d24d8757a74cdf4af433bdc735460e68ba6cd2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 19:09:39 +01:00
niyasraphy 9a976a8c9a [FIX] various: uniquify the the !
Just change double the by single. This fixes various typos in error and
code comments.

closes odoo/odoo#107266

X-original-commit: 09dfedfc19c2bc34c2bb394dcc4bc609c5ac0107
Related: odoo/enterprise#34681
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 10:52:50 +01:00
FrancoisGe a882b725bb [REF] web: adds the callback onWillSaveRecord and onRecordSaved
The purpose of this commit is to add extension points that allow code
to be executed before and after the save of a record.

CallBack:
    onWillSaveRecord is a callBack that will be executed before the
        record save if the record is valid if the record is valid.
        If it returns false, it will prevent the save.

    onRecordSaved is a callBack that will be executed after the save
        if it was done. It will therefore not be executed if the record
        is invalid or if a server error is thrown.

This commit will replace all the save overrides by the onWillSaveRecord
and onRecordSaved callBack.

Observed problem:
We could notice that each of the overrides of save in order to execute
for example a doAction after this one did not take into account the fact
that the save did not succeed.
For example, a required field is invalid and we try to save, then the
doAction will be executed without the "write" of the save.
The callBack onRecordSaved will prevent this common error.

closes odoo/odoo#105180

Related: odoo/enterprise#33710
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-15 13:01:29 +01:00
FrancoisGe aaefe77c95 [FIX] *: override save checks that the save is valid
The goal of this commit is to avoid the execution of code depending
on the validity of the save of a Record.

Before this commit, several override save functions in Record execute
code after the record's save without checking if the record's save has
taken place.

Override before:
export class NewRecord extends Record {
    async save() {
        const isSaved = await super.save(...arguments);
        // doAction
        return isSaved;
    }
}

Override after:
export class NewRecord extends Record {
    async save() {
        const isSaved = await super.save(...arguments);
        if (isSaved) {
            // doAction
        }
        return isSaved;
    }
}

How to reproduce the problem:
    Go to a form view with a Record having its save override function.
    Edit a record in such a way to have an invalid field
    Click on the save button

Before this commit:
The doAction is executed

After this commit:
The doAction is not executed

Real use case
- Go to the form view of a lead in CRM
- Change stage
- Clear the name field
- Click on save button

Before this commit:
A call to get_rainbowman_message is made

After this commit:
No call to get_rainbowman_message is made.

closes odoo/odoo#105687

X-original-commit: 46b93da545b52496196624712c44599fd6467f4e
Related: odoo/enterprise#33913
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-14 16:21:44 +01:00
Alexandre Kühn 0422c94a90 [IMP] mail, *: rename registerModel/Patch to Model/Patch
closes odoo/odoo#105096

Related: odoo/enterprise#33679
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-11-06 02:16:48 +01:00
Alexandre Kühn 56e854471a [IMP] mail, *: introduce @mail/model module
Introduce the '@mail/model' module that gathers all the stuff involved
in model definitions. This allows us to reduce the number of imports.

* = calendar, crm, hr, im_livechat, note, rating, sms, snailmail,
website, website_livechat, website_slides

Task-3056971

Part-of: odoo/odoo#105096
2022-11-06 02:16:48 +01:00
Romain Estievenart a172be756f [REF] web,*: dark mode uses service instead of legacy api
This commit adapts the codebase to match its enterprise counterpart
where calls to legacy cookie api (cf. web.utils.cookies) are replaced by
cookie_service ones.

closes odoo/odoo#104080

X-original-commit: 724469e19ff83e91a41c6721e334df1ad8d1c02c
Related: odoo/enterprise#33189
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-25 19:39:51 +02:00
miad-odoo 5a65465dde [IMP] crm: add prorated recurring revenue in forecast view
Purpose:
In the Forecast view of the CRM module, when recurring revenues are activated,
they are not shown in the progress bar of each stage of the kanban view. Only
the prorated expected revenue (non-recurring) are shown. In the regular
kanban view, they are shown.

To display them, we extended the CrmKanban view, which already possesses this
behavior, since behaviors relevant to the CrmKanban view are also relevant
to the ForecastKanban view.

As for the forecast kanban cards, when recurring revenues are activated,
they show "regular" recurring revenues instead of "prorated" recurring
revenues. Expected revenues are prorated. This is misleading for users.
The goal is to show prorated recurring revenues instead of just
recurring revenues.

Task-2994146
Task-3006404

closes odoo/odoo#102037

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-10-25 13:03:04 +02:00
Adrien Schoffeniels 52aefebbc3 [FIX] crm: fix sales team embed kanban
Purpose:
--------
In sales team, the gauge showing the count of assigned leads in the members
kanban cards was not shown (only a number was displayed, the gauge had its
width and height set to 0).

"o_kanban_view" selector has been removed from the gauge's style definiton,
as the class is not present in the dom.

Task-3004227

X-original-commit: 056313dacff9f19e84add4c39b4cebc305a2c5e1
Part-of: odoo/odoo#103257
2022-10-17 12:13:25 +02:00
Jorge Pinna Puissant 375b969e99 [FIX] crm: remove field crm_statusbar
Remove the field `crm_statusbar` as it dosen't have a specific
behaviour, and we can use the classic `statusbar` field instead.

closes odoo/odoo#102992

X-original-commit: 386fa0a5e448f149e75da68a02ad94dd88cc4d08
Related: odoo/enterprise#32669
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-10-11 08:07:49 +02:00
Jorge Pinna Puissant f00e544930 [FIX] web, crm: override of form controller save function
Before this commit, some functions overrode the save function of the
form controller. The issue is that this function is only called when the
button save is clicked, and not when we save differently (for example,
when clicking on the breadcrumb).

To avoid this mistake the save function on the form controller was
renamed to: `saveButtonClicked`, and the code that overrode the function
now override the save function of the Record, that it's called at each
time a save is perform.

X-original-commit: b6e3d833e6131562084eb13b2955c22f50ad1e79
Part-of: odoo/odoo#102992
2022-10-11 08:07:49 +02:00
Louis Wicket (wil) d562840f69 [IMP] mail, *: refactor patch API to look like model definitions
Model patches are now defined using the `registerPatch` function. This
function takes an object as argument which keys match those of a model
definition.

Benefits:
+ More consistent shape between model definitions and patch definitions
+ No need to import one function to each type of patch
+ No need to repeat the model name for each type of patch
+ No need to import the original definition

Task-2998282.

* = calendar, crm, hr, im_livechat, note, rating, sms, snailmail,
    website_livechat, website_slides

closes odoo/odoo#101827

X-original-commit: 7d23491b44b7372209057ea2abc565a95710b316
Related: odoo/enterprise#32136
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-03 16:18:49 +02:00
Damien Bouvy f1c822cde2 [IMP] crm: adapt tour to always edit
X-original-commit: abd8a5ce0b5f30b70f9524587fdbeb0f7ab670d7
Part-of: odoo/odoo#101729
2022-09-30 15:33:05 +02:00
Sébastien Theys 7621343501 [IMP] mail: create kanban and list activity field components
closes odoo/odoo#101330

X-original-commit: 069220ac94b3e33201991aa04506f1aa4227be1d
Related: odoo/enterprise#31869
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-27 19:14:51 +02:00
Michael (mcm)andluvi 710271240f [IMP] web: remove readonly mode of form view
This commit does multiple things:
- The readonly mode of form view is removed but not for the fields.
  it means that the fields in the view are always in edit mode except
  if we force them to be readonly.
- The control panel is revamped to take less vertical space and shows now
  the record editing (dirtiness)/validity status after editing the record.
- The record is saved only when leaving the view or by clicking the save
  button when hovering the record status in the control panel.
- The record can still be discarded by clicking the discard button when
  hovering the status text in control panel.

task id: 2822553

X-original-commit: 77824ad44b6945a9811120380747f87ef6362ae2
Part-of: odoo/odoo#101118
Co-authored-by: luvi <luvi@odoo.com>
2022-09-27 12:43:50 +02:00
William Braeckman 0e0c959a49 [FIX] crm: fix crash when saving new record
A crash would occur when creating new records as the code did not take
into account the possibility of having empty "base" data.

closes odoo/odoo#100973

X-original-commit: 497db878fa3f9303ce33035d5737352289c4f97d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-23 13:34:34 +02:00
Alexandre Kühn 0ae4fadf08 [IMP] mail, *: convert all compute/sort method into inline field function
Task-2985304

closes odoo/odoo#100765

X-original-commit: e267d52cc4380c3acf7d2f9c9abf1acb59a598c1
Related: odoo/enterprise#31606
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-22 01:54:20 +02:00
William Braeckman 42237c0ddc [IMP] crm: migrate CRM to wowl2
Migrate `crm_form`, `crm_kanban` and all `forecast_` views.

closes odoo/odoo#98837

Related: odoo/upgrade#3895
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-09-19 11:28:51 +02:00
Sébastien Theys b401ba6e2d [IMP] mail, *: remove legacy code from activity systray
* = calendar, crm, im_livechat, mass_mailing_sms, note, test_discuss_full,
    test_mail

task-2920645

closes odoo/odoo#96114

Related: odoo/enterprise#29794
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-27 02:18:15 +02:00
abd-msyukyu-odoo 40dda26350 [FIX] core, web: handle read_group ranges for multiple granularities
There was an issue with the computed `read_group` `__range` when grouping on
the same date/datetime field on multiple granularities (i.e. month, week).
Since the range was stored with the field_name as a key, the last evaluated
range would override the previous ones.

Impacted Versions:

  - master
  (- exists since 15.0 but it does not impact the user directly so it has been
  decided to fix this only in master, since the API is modified)

Steps to reproduce:

  1. Open a list view and group by a date field with at least 2 granularities
  2. Open the chrome debugger (network) and check a web_read_group rpc preview
  3. Find the web_read_group for groups related to one of the largest
     granularities and check the `__range`

Current behavior:

  - `__range = {field_name: false}`

Expected behavior:

  - `__range = {field_name: {from: range_start, to: range_end}`

Explanation

Since the smaller granularities are evaluated last, and the condition to update
`__range` is related to the field_name and not the granularity, the range is
always overriden by the smaller granularities (even if their value is False)
when grouping on the same field with multiple granularities.

Furthermore, there is a conceptual problem with the current solution: it does
not allow to store multiple ranges when the read_group is not lazy and when
grouping on the same field with multiple granularities.

Therefore, the proposed solution is to use the full groupby keys in the
`__range` to allow storing multiple ranges depending on granularity. The keys
in `__range` would thus match the group value keys and allow more flexibility
if a domain must be forged from the group(s) range(s).

Task-2894519

closes odoo/odoo#95193

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-14 18:03:50 +02:00
Romeo FragomeliandStefano Rigano 41eebf822b [REF] *: BS5: handle contrast color
The logic not identical in BS4 -> BS5
The color contrast system in BS5 relies on WCAG 2.0 contrast algo.
So color-yiq is converted to color-contrast.
Note that there are some "texts/buttons/other visuals" elements
which will not have the same contrast as before.

$yiq-text-dark and $yiq-text-light are respectively replaced with
$color-contrast-dark and $color-contrast-light.

Note that we had to use '$min-contrast-ratio: 2.2' for .o_tag_color_X badge.

Task ID: 2766483

Part-of: odoo/odoo#95450
Co-authored-by: Stefano Rigano <sri@odoo.com>
2022-07-07 13:30:17 +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
Pierre Paridans 2dd37982e6 [IMP] web,crm: revamp grouped kanban mobile implementation
This commit revamps the grouped-kanban implementation for smaller
screens (aka. mobile) by making it more "responsive" and avoiding
mobile-specific variation. It makes the implementation simpler and
closer to what the user expects from the desktop version.

In a nutshell:
- columns are displayed individually ; an horizontal scroll allows to
  switch to the other ones, "snapping" to the column (aka. carroussel-like).
- each column takes 90% of the viewport's width to give a hint of its
  siblings.
- each column scrolls (vertically) individually to avoid being lost when
  switching from one column to another.
- folded columns are "virtually unfolded": they takes the same space as
  the other ones, but content is loaded on-demand.
- some configuration modals are fullscreen for ease of use.

Part of the SCSS revamp task-2704984

task-2883057

Part-of: odoo/odoo#94134
2022-06-22 11:05:20 +02:00
dht-odoo 3b3423d638 [IMP] web,crm: show sum of MRR on leads' kanban progress bar
This commit shows the sum of field 'recurring_revenue_monthly' on
leads' kanban progressbar next to the sum of 'expected_revenue',
if the recurring revenu is enabled for logged in user.

taskID-2414576

closes odoo/odoo#66237

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-17 16:03:03 +02:00
stefanorigano (SRI) 87a7449afd [IMP] web, *: odoo-brand color classes
Prior to this commit branded UI components were styled exclusively in
raw SCSS using the '$o-brand-odoo' variable.

This leaded to unnecessary code repetitions since, to achieve the same
visual result, each module defined its own classes.
Visual inconsistencies were frequent too since each module defined its
own variations for interactive states (eg :hover).

This commit injects '$o-brand-odoo' into bootstrap's default
'$theme-color' map, allowing the framework to automatically generate
odoo utility/contextual classes.
These classes can be used to handle text, backgrounds, borders and
buttons wherever needed.

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2800721

closes odoo/odoo#87448

Related: odoo/enterprise#25700
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-05-05 14:00:37 +02:00
Géry Debongnie b828cfc72c [REF] web, *: improve the way views are defined, reintroduce controllers
Earlier in Odoo, JS views were defined by defining 4 elements: View,
Controller, Model, Renderer.  This was complex in some way, because we
wanted to inherit behaviour as well, so it was necessary to think along
multiple dimensions to understand how the code was running.

Then, with Owl, we rewrote some views, and simplified them: views were
now just a Component. Most of the common behaviour now came from the
generic View component that instantiated the concrete view with the
proper informations.  In practice, views were still split in views
(which was the equivalent of the Controller of earlier views), Model and
Renderer

Now, this commit reintroduce the Controller, and change the way views
are defined: by an object with multiple metadata, and an (optional)
props function to compute the actual props used by the view.

As a result, views are now much easier to extend/modify.

closes odoo/odoo#89889

Related: odoo/enterprise#26728
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-05-02 22:38:02 +02:00
Fabio Barbero 71bcd3bca7 [IMP] digest, *: update digest pictures
Purpose
=======
Update pictures with higher quality, up-to-date equivalent.

Task-2372195

X-original-commit: 476ca7e5abfbe25f7375a426a249da6fb41098cf
Part-of: odoo/odoo#87343
2022-03-29 00:08:59 +02:00