Commit Graph
470 Commits
Author SHA1 Message Date
Eteil Djoumatchoua (etdj) 3c526229c6 [FIX] project: ensure cost are subtracted when calculating margin
steps to reproduce the bug:
- Create a service product with "invoicing policy" set to "Based on timesheet" and "create on order" set to "project and task"
- Create and invoice with the product and confirm it
- Type in some hours on timesheets for the invoice
- Go Project -> Project update of the project, The margin value is incorrect

Solution: As the cost are always negative, changed the operation of the calculation to have the good value.

opw-3029869

closes odoo/odoo#104474

X-original-commit: a39a1a6a3bc276177f9f4c95495153bbb5818ed5
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-04 01:04:45 +01:00
Hubert Van de Walle (huvw) 95024f8bcb [FIX] project: applychanges for personal_stage_type_ids
Steps to reproduce
==================

- Go to Project > My tasks
- Drag a card to another column
-> An error occurs

Cause of the issue
==================

`personal_stage_type_ids` was not changed to `personal_stage_type_id`

opw-3036820

closes odoo/odoo#104442

X-original-commit: 3afc32af953556227dc07f8c65b5301d10fa92fe
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-10-28 13:23:06 +02:00
Pratik Awasthi 1103c93271 [FIX] project: fix description field size in form view of task
Before this commit, while creating/editing a task, the
description field height is not increase to  use the remaining
space until the bottom screen in the project task form view.

This commit uses `FormRendererWithHtmlExpander` component as
renderer for that form view (as it is the case for the project
and project update form view to increase the description field)
and override `htmlFieldQuerySelector` getter to select the
right tag containing the description field.

task-2987387

closes odoo/odoo#104259

X-original-commit: b4873875cb687c7d09474dee146274cda1cb910a
Related: odoo/enterprise#33297
Signed-off-by: Xavier <xbo@odoo.com>
2022-10-28 00:50:40 +02:00
Jorge Pinna Puissant 886f3de768 [IMP] web,*: force props validation for components
*: base_automation, lunch, mail, mrp, project, web_editor, website

This commit adds a warning if the props validation is not set for a
component.

The props validation is important to tell how a component should be
used, by looking at its code, it's a good documentation of the component.
It's also critical, to test if the component is correctly used, if all
the obligatory props are passed and that there are of the correct type.

For more information, see: https://github.com/odoo/owl/blob/master/doc/reference/props.md#props-validation

closes odoo/odoo#103723

Related: odoo/enterprise#33044
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-10-26 16:07:18 +02:00
Pratik Awasthi 382aef698e [FIX] project: translate measure label in burndown chart graph view
Before this commit, Project >  '# of tasks' from the burndown chart was not
translatable to any language

So in this commit, Project >  '# of tasks' from the burndown chart will be
translatable to any language

task-3010685

X-original-commit: 1593436ac4ebbb121d3dc0a9725c74f3d7f0ad39
Part-of: odoo/odoo#103978
2022-10-25 11:07:15 +02:00
Julien Mougenot 5a7fd7fe96 [FIX] web: Enhance draggable edge scrolling
This commit does 2 things for the draggable hook builder:

- the scrollable feature will apply on the nearest scrollable parent if
the current element cannot be scrolled (removes the need to pass a
parent ref which is not the target container);

- the dragged element is now strictly bound to the current viewport or
the container ref, whichever is the smallest.

closes odoo/odoo#103137

X-original-commit: 70bdf940cc1491fd0cdbae0240d930e8a1d5b25e
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-10-12 10:34:55 +02:00
stefanorigano (SRI) d53d432361 [IMP] *: adapt for dark-mode
*: hr, hr_holidays, project, purchase, point_of_sale, rating,
spreadsheet_dashboard, stock, survey

This commit adapts modules and components in order to correctly handle
color-scheme variations.

task-2710677

Part-of: odoo/odoo#102868
2022-10-11 13:15:54 +02:00
Xavier BOL (xbo) 8904dbd522 [REF] project: convert project sharing form view in OWL
Before this commit, the form view in project sharing was always in
legacy. Moreover, in that view, the chatter used is the portal one
and so it is also a legacy widget.

This commit converts the form view and then convert the chatter in
OWL to be able to correctly compile and add the chatter in the form
view.
Also, some styling has been done to remove the overflow. Only the
overflow on the y axis in the chatter can be scrolled on the page.

task-2947516

X-original-commit: 175430f3593337ce582cbec644b9d630894c074b
2022-10-10 17:03:06 +02:00
Xavier BOL (xbo) 136328eb89 [REF] project: convert the project sharing list in OWL
This commit converts the list view used in project sharing in OWL and
remove the legacy definition.

task-2947516

X-original-commit: 79159c0c6b715c3acbfb370523b73a664648deb2
2022-10-10 17:03:00 +02:00
Simon Genin (ges) 2e8d9cdf18 [FIX] web,*: fix kanban useSortable screen width limit
Reproduce:
Go on a kanban view, with enough columns so it goes off the screens.
Scroll on the right, try to drag anything beyond the original (before
scrolling) limit of the screen. The cards are stuck floating at that
limit. Note it didn't prevent the drop to work properly where the mouse
was.

Issue:
The useSortable hook gets an owl ref, which is used as a limit to where
things can be dragged and dropped. Originaly and logically, it was the
current component ref, the renderer. But for some unknown reason, this
space was not getting wider than the initial screen size. It may be a
problem with the flexbox layout.

Tried solutions:
- A first solution was to add the overflow-x-scroll css property to the
renderer. It works, but now the horizontal scroll bar is no longer
always visible. You have to scroll all the way down to see it. UX wise
this is not acceptable.

- We could remove the clamp mecanism inside useSortable to let the drag
and drop motion go anywhere. This works, but decrease the quality of the
interaction. It looks cheap and not polished.

Final Solution
Finally, we decided to pass a ref to the o_content div from the layout
component down to the kanban renderer. If the useSortable is given this
ref, it works as intended. While it may seem too much, it is not
unreasonable to propose a reference to the most parent element of the
view contents to the renderer.

X-original-commit: a569305acaa1c812ede739c267e2e9530945f65f
Part-of: odoo/odoo#102756
2022-10-08 13:30:07 +02:00
Antoine (anso) 106602f7e0 [REM] project : remove unused SCSS
Some SCSS is not used anymore in the module and can be removed

closes odoo/odoo#102686

X-original-commit: 38fe11aa545dcf121acbeaac4a72649461d7f89a
Related: odoo/enterprise#32524
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-10-07 18:48:08 +02:00
Antoine (anso) fa048082f2 [IMP] project : optimize SCSS
SCSS optimization of the right side panel in project module.

Remove custom SCSS and use Bootstrap classes instead.

task : 2977963

X-original-commit: 9045dfbaece4e2cef153597632fd473cbb6cdb6f
Part-of: odoo/odoo#102686
2022-10-07 18:48:08 +02:00
Aaron Bohy 8540aad29f [REM] *: remove legacy views converted to owl
This commit removes legacy views that are not used anymore as they
have been converted to owl. They could actually have been removed
in the commit that converted them, as we never needed to have a
double implementation of views, unlike we need to (field) widgets.

The LazyColumnList is a special case. This view hasn't been
converted. Instead, it has been decided not to use it anymore.
So it was dead code, and this commit removes it.

The form/list/kanban views are no longer necessary in the view
registry, since their owl version exists. However, we kept them
in the test asset, as they are massively used in legacy tests
(in field tests for instance).

closes odoo/odoo#102634

X-original-commit: 186a8b31161fc8c75b346ff97f9403dca1ae677e
Related: odoo/enterprise#32501
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-07 17:47:58 +02:00
Vincent Larcin 49d59a20c5 [FIX] {sale_}project,hr_timesheet: fix project form CSS
This commit fixes some css issues in the "Settings" tab
of the project form view. The settings descriptions were
wrapping at half the width they were supposed to, and
the settings were misaligned compared to the sections titles.

closes odoo/odoo#102399

Enterprise: https://github.com/odoo/enterprise/pull/32359
X-original-commit: 74bd1e6af0e3410fc1a474c5f85b1dbb46ceba6e
Related: odoo/enterprise#32384
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Larcin Vincent (vila) <vila@odoo.com>
2022-10-07 17:47:53 +02:00
Radhika Shyara 9b07a00fb4 [FIX] project: fix the delete icon on chatter attachment
Before this commit, on project sharing chatter attachment delete
icon is displayed on the middle of attachment thumbnail instead it
should be displayed on right top corner of thumbnail when we hover
on attachment.

So in  this commit, added a class for project sharing view so delete
icon should be displayed properly

task-2904015

closes odoo/odoo#102298

X-original-commit: c9609c62efe163901f8c2b1a30355b60dd34ad51
Signed-off-by: Xavier <xbo@odoo.com>
2022-10-06 15:57:44 +02:00
Damien Bouvy dc797aead0 [IMP] project: adapt tour to always edit
X-original-commit: 454f82e39e1cb4fb7b48db9470a58f304992a0c1
Part-of: odoo/odoo#101729
2022-09-30 15:33:05 +02:00
William Braeckman 6095eff9e2 [IMP] project: migrate project_calendar to wowl2
closes odoo/odoo#101603

X-original-commit: fb7c615fcec3743f31d34ebb79664f8a8eb5a50f
Related: odoo/enterprise#32012
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-29 15:27:06 +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
Pierre Paridans 062e7b1c21 [IMP] web,*: make ControlPanel, SearchView, SearchPanel responsive
This commit transfers responsive related customizations for
ControlPanel, SearchView and SearchPanel to community which allows them
to render properly on smaller devices.

Note: a page reload (aka. F5) is required to properly adapt the UI after
a resize to a mobile-like size.

X-original-commit: 26a755610da36b01ba07ca224cc5937a672eb6a8
Part-of: odoo/odoo#100759
2022-09-23 01:39:32 +02:00
Laurent Stukkens (LTU) ab0bf5e46c [FIX] project: prevent selecting 'Set Status' as project status
Since odoo/odoo#98380, the `Set Status` can be selected in the `project.project`
kanban view, which was not previously feasible as considered as not suitable.

This commit prevents selecting that value.

task-2989015

closes odoo/odoo#100561

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-20 10:28:26 +02:00
Audric Onockx (auon) 889597428a [REM] project: remove unused widget
HtmlWithActionWidget was used in Project Updates
to handle <a/> tags in the html description.
Since odoo/odoo#72736 removes all those tags,
this widget is no longer needed.

closes odoo/odoo#100397

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-17 00:51:54 +02:00
Aaron Bohy d30cab0b7f [FIX] web_tour,project: tours: can drag&drop in wowl kanban
This commit allows to define steps in tours that drag&drop records
in (wowl) kanban views. The former helper is based on jQuery,
mostly because the drag&drop feature comes from jQuery. This
feature is still necessary for the legacy codebase using jQuery.
This commit thus introduces a new helper to allow the drag&drop
in wowl Component using, for instance, the `useSortable` hook.

This commit also fixes the project tour by making it use that
new helper. Note that even though the tour was broken (when run
"automatically", not in a user onboarding), runbot was green
because there's no test running this tour. It would be nice to
add one.

closes odoo/odoo#100208

Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2022-09-15 19:21:16 +02:00
Mathieu Duckerts-Antoine 774aaa4984 [REF] *: remove legacy graph and pivot views
Now that web_studio no longer uses the legacy graph and pivot views and
that all their extensions have been converted, we can finally remove
them from the code base.

closes odoo/odoo#99734

Related: odoo/enterprise#31112
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-15 19:20:53 +02:00
Nicolas Bayet 10af6e83bf [IMP] web_editor,mass_mailing: adapt fields to use owl
- adapt the html field and mass_mailing_widget to be owl components
- adapt the mass mailing view to be an owl view

task-2898432

closes odoo/odoo#94875

Related: odoo/enterprise#30915
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-12 11:38:00 +02:00
damr f3974bea4b [IMP] project,*: improve user experience
This commit (and its enterprise equivalent) purpose is to smooth the
user experience and remove unnecessary steps.

The commits:
- Remove all stat buttons except the status and collaborators one from
  the project edit form.
- Add multiple small changes to string/name fo fields in views
- Change the custom O2M widget for a standard M2M for the management of
  child tasks
- Add the milestone field to the portal page of shared project.
- Remove the wizard 'marked_as_reached_milestone'
- Add the automatic generation of milestone when a SO is confirmed if
  some SOL need it

task-2941835

closes odoo/odoo#98546

Related: odoo/enterprise#30628
Related: odoo/upgrade#3798
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-07 23:10:37 +02:00
Barad Mahendra cd0c245eae [FIX] project: fix the portal chatter button's visibility
Before this commit, Chatter in project sharing: the
'employees only' and 'visible' buttons are not toggled and both
are visible at same time.

So in this commit fixes the issue by making the 'employee only'
and 'visible' button as toggle button same as portal chatter.

task-2858336

closes odoo/odoo#99326

X-original-commit: eee722bb74db70a49ba88250afd0359c510e5ade
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-01 10:30:14 +02:00
Xavier BOL (xbo) b8ef0cc4f2 [REF] project,*: convert kanban, list and form views in OWL
Before this commit, all the custom code for the widgets, form, list and
kanban views are always in OWL and have to be migrate to the new JS
framework.

This commit converts all the widgets, list, kanban and form views used
in the project app in OWL. Some JS tours has been adapted according to
the OWL views, the project right side panel has been reviewed since it
was LegacyComponent (in old component in OWL)

task-2944742

Part-of: odoo/odoo#98380
2022-08-30 20:22:34 +02:00
Samuel Degueldre a6dd7075b3 [FIX] *: remove display: contents from field widgets and adapt code
With the conversion of the views to owl, we added an extra div around
fields that represents the whole field, and wraps potentially multiple
elements that may be rendered by a field widget. This changes the DOM
structure, and to allow concrete fields to control everything about the
way they are displayed, we decided to use the css rule "display:
contents" for that div. As it turns out, while this does give more
control to the field widget, it breaks a lot of existing css rules, and
also prevents classes that are applied on that div from the arch from
affecting any css property related to layout (such as margin, position
or padding).

Because of that, we decided to revert this change, and set this div's
display property to inline-block (the same as legacy field widgets) and
adapt the few fields where this does not work out of the box, which
fixes many issues.

Part-of: odoo/odoo#98711
2022-08-25 03:11:45 +02:00
Denis Ledoux 0501bbd62e [IMP] base: uniform "groups" in back-end view
This revision is to make uniform the behavior of the `groups` attribute
on the Python model fields
and on the node in the view architecture.
In both cases, remove the node from the view completely.

Before this revision,

in a back-end view:
 - In the Python model, if a field has the `groups` attribute set
   and the user is not part of
   the groups, the field is removed, completely, from the view.
 - In the view architecture, if a node has the `groups` attribute set
   and the user is not part of
   the groups, the node is made invisible (not completely removed, just
   made invisible).

in a front-end view:
 - if a node has a "groups" or "t-groups" set and the user
   is not part of the groups, the node is removed from the view.

So it's 2/3 cases removing nodes restricted to a group.
and 1/3 case making invisible nodes restricted to a group.
It's simpler to have a uniform behavior for the 3 cases,
simpler to understandard for developers.

In addition, this will help for the goal to cache back-end views.
It makes possible to convert views using the `groups_id` field
by moving the content of these views directly
in the view to which they add content which is suppose to be completely
removed when the user has not the according group.
By getting rid of the `groups_id` many2many field on `ir.ui.view`,
it makes possible to cache the view architecture without
requiring to use the groups in the cache key.
Currently, if we want to cache the view architecture,
it would be required to use the intersection of the user
groups with the `groups_id` groups of the view,
making it costly to compute the cache key,
therefore altering the performance point to cache the view
architectures.

closes odoo/odoo#95729

Related: odoo/enterprise#29592
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-08-19 19:10:39 +02:00
stefanorigano (SRI) b89296c12b [REM] *: drop o_debounce_disabled class in favor of bootstrap defaults
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:15 +02:00
stefanorigano (SRI) bd2a1110a0 [REM] *: drop o_cursor_default & o_cursor_pointer classes
Drop custom cursor classes in favor of Bootstrap default ones.
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:12 +02:00
Adesh Jolhe (adjo) 540c740ae4 [IMP] sale_,hr_(project,timesheet): generic improvements for project
Purpose of this PR to improve generic usage of project app.

So in this commit did the following changes:
 - Changed recurrence conformation messgae
 - Changed Burger menu actions  in
   project.project kanban view
 - Added quick search Description in project.task search view
 - In product form view hide button based on condition
 - Added sample data in project_milestone_views
 - switch the state and the author fields from place and add author
   label underneath it's value
 - switch the date and the progress fields from place
 - Added table-stripes class
 - Changed label sprint summary to summary in project_update_default_description
 - In project.project form view and project.update right-side panel hide
   'collaborators' button on condition

task-2895388

closes odoo/odoo#95245

Related: odoo/enterprise#29089
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-03 20:47:50 +02:00
dafl-odoo cc207bbe66 [REF] web,project: stacked line chart generalization
Add stacked option on line chart.
The option already existed in Project for burndown graph, so I exported
and adapted everything concerning stacked lines from Project to Web.

closes odoo/odoo#96833

Task-id: 2929576
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-01 14:44:00 +02:00
jlzhou a04c2f134e [FIX] project, web_editor: fix user_id missing bug in this.getSession()
auth_totp module added user_id in session_info, but it's not in the depends of project and web_editor module.

To avoid traceback after uninstalling auth_totp module:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0'),

we should use uid instead of user_id in js code.

closes odoo/odoo#96880

X-original-commit: 81b92a61907028f71b1337b11d0d60ee98bb5775
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-01 10:55:37 +02:00
+2 bc0a0cead6 [IMP] web,*: enable owl list & form views
The new list and form views were merged recently [1], but they
weren't activated because they weren't 100% ready yet. This is now
the case. This commit adds those views to the view registry. As a
consequence, a lot of qunit tests and tours needed to be adapted,
mostly for selector changes.

We also add legacy list and form views to the view registry, with
keys 'legacy_list' and 'legacy_form'. This allows to force those
legacy views when necessary. For instance, we did it in views
using complex custom legacy x2many field widgets that haven't been
converted yet (we have a compatibility layer but it isn't complete
and doesn't support every advanced usecases).

[1] odoo/odoo#92475

Part-of: odoo/odoo#78221
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-07-22 16:21:45 +02:00
Laurent Stukkens (LTU)andYannick Tivisse ac7cd0e874 [IMP] project: improve burndown chart performance
Purpose of this commit
======================

The Burndown Chart report was very slow on big databases as it was not
possible for Postgresql to optimize the query as it was based on a view
that was using several generate series.

This commit aims to improve the performance by injecting the constraints
at a lower level than it was in the past, lowering the amount of data
processed in the higher level of the query.

/!\ Important note
------------------

Overwriting the `read_group_raw` is really not a good practice and should
be avoided in most case. If you fall on this implementation by grepping
the source code, please be advised that this is not the right way of doing
things.

Implementation details
----------------------

- The report is now run by generating the `SQL` that is executed by the
  `read_group_raw`. This allows inserting `SQL` constraints at a lower
  level and simnifically improves performance. As there is no other way
  to do it, the code is unfortunately a modified copy of the actual
  `read_group_raw`.
- The pivot view has been removed as it had no meaning and was creating
  confusing data.
- The `Group By` menu has been limited to `stage_id` and `date` as bringing
  more data trough the different `GROUP BY` statements up to the higher level
  is costly. Further more, additional `Group By` did not bring added value
  as the Chart was less readable.
- The JS code has been adapted in order to force a group by both `stage_id`
  and `date` so that the date displayed is always making sense.
- The sort ascending and descending options have been removed as creating
  confusing data.
- The compare with previous period has also been removed as the chart only
  really make sense when seen chronologically.
- A lot of tests have been added in order to ensure that changes that would
  be harmful for the report will trigger test fails.

task-2845729

Co-authored-by: Yannick Tivisse <yti@odoo.com>
2022-07-20 15:57:32 +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
Xavier BOL (xbo) c227ff755a [IMP] project: update contextValue for components in right side panel
This commit directly add the `default_project_id` key in the
`ProjectRightSidePanelComponent` component to get it in all components
which extends on the that component.

task-2861207

Part-of: odoo/odoo#95721
2022-07-12 01:29:24 +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 23c3a31a0d [REF] *: BS5: removal of .media class
https://getbootstrap.com/docs/5.1/migration/#grid-updates
https://getbootstrap.com/docs/5.1/utilities/flex/#media-object
https://github.com/twbs/bootstrap/pull/28265

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:19 +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
Géry Debongnie fde1ca963c [IMP] web, project: introduce and use renderToMarkup
Part-of: odoo/odoo#92475
2022-06-30 09:29:50 +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
Sébastien Theys 9de429e747 [IMP] mail, project: move chatter container setup code in init
Setup was conditionally done in render lifecycle methods, but it could be moved
to init instead, allowing to simplify the code and remove unnecessary methods
and overrides.

Part of task-2871070

closes odoo/odoo#94307

Related: odoo/enterprise#28893
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-27 15:11:13 +02:00
Xavier BOL (xbo) 84e17847fe [FIX] project: stringify the domain list before using Domain.and
Before this commit, when we use a domain list made by the old
implementation of the Domain in js and in this domain we have a date in
a right leaf then this date is an object of Date class. However, with
the new implementation of the Domain, the date will be converted into a
PyDate/PyDatetine object and so when we create a domain with the new
implementation by giving a list containing the result of the old
implementation. The date will be converted as a plain object instead of
a date formatted or instead of a date object.

This commit converts the list in string before using `Domain.and` with
the new implementation to having a date formatted as a string to avoid
the issue.

for instance, when the user choose a filter containing a date in the
right of a leaf in the domain. The old implementation of domain class
will return `[['date', '=', new Date(1970, 1, 1)]]`
```js
new Domain([['date', '=', new Date(1970, 1, 1)]]).toList()
// result: [['date', '=', {day: 1, month: 1, year: 1970}]]
```
if the list is converted as a string before passing the result will be:
```js
new Domain(JSON.stringify([['date', '=', new Date(1970, 1, 1)]])).toList()
// result: [['date', '=', '1970-01-01']]
```

closes odoo/odoo#93884

X-original-commit: 44d4a44dc4695b40a52c7d4cfccf0e9238d39b19
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-06-16 22:34:33 +02:00
Xavier BOL (xbo) e058472d21 [IMP] project: display wizard to reach milestone if all tasks linked are done
Before this commit, when the user changes the stage of a task linked to
a milestone, he cannot know if after that task, there is another one
before reaching the milestone related.

This commit displays a wizard to allow the current user to directly
mark as reached the milestone when the user changes the stage of a
task linked to a milestone to a closed stage and all tasks linked to
that milestone are done too. However, if the milestone is already
reached, no wizard will be displayed.

task-2829542
2022-05-31 10:29:08 +02:00
Xavier BOL (xbo) 41b72e0398 [IMP] project: display in green milestone if all tasks linked are done
Before this commit, when all tasks linked to the milestone are done, it
means all tasks are in a closed stage. Then, the user has no visual
feedback to know if all tasks linked to the milestone are done to be
sure he can mark the milestone has reached without missing a task to
complete.

This commit checks if all tasks of unreached milestones shown in the
project update are done or not. If it is the case the milestone is
greened to show to the user that milestone can be marked as reached.

task-2829542
2022-05-31 10:29:08 +02:00
Xavier BOL (xbo) a118555a40 [IMP] project: link milestone to task
Before this commit, the milestones are only linked to a project without
any link to the tasks of the same project. However, the tasks could be
considered as steps to reach a project milestone.

This commit adds a link between the `project.task` and
`project.milestone` models. This link is added in the `project.task`
model with the Many2One field called `milestone_id`. With this field,
the user will be able to link a milestone to a task.

task-2829542
2022-05-31 10:29:08 +02:00
Audric Onockx (auon) fd521e8d39 [FIX] project : allow to continue recurrence
This fix corrects the error committed in a previous fix :
https://github.com/odoo/odoo/pull/85209

closes odoo/odoo#92381

X-original-commit: d6bff1a9ccfc52adf98dbbf5c9c56c4a1a4fb3e8
Signed-off-by: Xavier <xbo@odoo.com>
2022-05-31 09:06:18 +02:00