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>
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>
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
closesodoo/odoo#95193
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
> 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
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
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
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
closesodoo/odoo#94307
Related: odoo/enterprise#28893
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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']]
```
closesodoo/odoo#93884
X-original-commit: 44d4a44dc4695b40a52c7d4cfccf0e9238d39b19
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
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
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
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
This commit allows project users to create and modify their own personal
stages.
A lot of overrides have been done on the kanban view to handle our
multiple cases.
Project user will now only see the options to create columns/edit stages
when grouping by personal stage.
This is hardcoded and does not follow possible custom access rules
however.
Any stage created while grouping by personal stage will directly be
assigned to the user and will be seen in the 'My Tasks' menu.
A special method has been added to delete a personal stage.
Upon deletion any task assigned to this personal stage will move to a
lower sequence stage if possible otherwise the next in line.
TaskId-2858445
closesodoo/odoo#92103
X-original-commit: 7b3acbc0b0c21ab106b1b34d9f5c8bc1ceb2fe58
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit removes the unnecessary condition on modelName as the code
stands in `ProjectTaskKanbanColumn` which is only used in the
`project.task` kanban view.
closesodoo/odoo#91965
X-original-commit: cb55586bd3da19a6fbbb22728f9d2961830e1592
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Upon deleting a column in the project task view a popup will be
displayed warning the user that the stage will not be deleted but
instead archived.
Prior to this commit that popup would be displayed regardless of the
group by option that is selected. However this could lead to issues when
opening the archive wizard with an id from another record.
closesodoo/odoo#91872
X-original-commit: 24d307716cbd9e05a32dde108838e16d04309116
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Purpose of this commit to improve generic usage of project
app.
So, in this commit done following changes:
- change the placeholder of the name to 'e.g. Monthly review' in
project_update_view_form
- set the 'analytic account' of the project on the tasks by default
- change the placeholder to 'e.g. Product Launch' in project_milestone_view_form
- the 'cabinets' milestone should be linked to a milestone service,
not a manual one so change data to milestone in demo data
- rename the 'rating' stat button into 'last rating' in view_task_form2
- set another employee than Mitchell for the 'customer care (prepaid hours)'
SOL field in sale_service_demo_data
- display a separator on the right of the stat button so remove unwanted
properties in project_rightpanel.scss
- add the 'name' field to the 'fields to export' when 'i want to update data'
is set to true
- remove the 'Getting Things Done (GTD)' example from kanban examples wizard
- add a 'tasks due today' filter that should return tasks whose deadline falls on
today's date in view_task_search_form
task-2809188
closesodoo/odoo#88271
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Currently, when we go to the project sharing and task chatter in
the portal view the avatar icon of portal chatter
contains more size than the avatar icon size of normal chatter
so this commit fixes the issue by applying a CSS property so that the icon
has the same size in the portal chatter.
task-2720976
X-original-commit: 220565b56493fe13d0c1757da8a0554295ebae19
Part-of: odoo/odoo#90897
Before this commit, when we go to project.task > kanban examples wizard:
the kanban state icons are missing in the description.
This commit fixes the issue by adding the d-inline-block class.
task-2720976
X-original-commit: 2593fb1e51354096c1aa6107023e05a199b49593
Part-of: odoo/odoo#90897
To make it more clear that the calendar view of the project tasks
only shows the deadline of the tasks, this commits appends
" - Tasks by Deadline" to the title of the view
Task-2741733
Part-of: odoo/odoo#86008
This commit changes the project status column in list view to copy
the behavior of the kanban status column for tasks, by removing
the column label and show the status text on hover.
Task-2741733
Part-of: odoo/odoo#86008
In the fullcalendar library, you can by default resize events with the mouse
to alter the start and end dates. However, since for project tasks, we use
the calendar to show deadlines, it wouldn't make sense to resize them.
This commit therefore disables the ability to resize tasks.
Task-2741733
Part-of: odoo/odoo#86008
Purpose of this commit to improve generic usage of project
app.
So, in this commit done following changes:
- add 'my department' filter in project search view.
- add 'my department's tasks' and 'my department's projects filter
in task search view.
- add quick search, filter and groupby in task analysis report search view
to make task analysis report search view same as task's search view.
- improve portal template of my/tasks page.
- project.task form view > timesheets: display the employee avatar
on mobile.
- make 'Task: Rating Request' template auto_delete false.
- settings: make following features disabled by default: sub-tasks,
task dependencies, recurring tasks.
- project.update kanban list: align the stat buttons with the kanban
list cards.
- add sample data to the project stages > list view.
- project.task quickcreate: enable the creation of new users on the
fly.
- move tags quick search below project.
- add title to show project full name on hover of project name in kanban
view of project.
- copy user_ids for task in recurrence.
- improve UI visibility of planned_hours and subtask_planned_hours field in
timesheet page of task form view.
- improve project sharing wizard and project.collaborator tree
view.
- add grid,kanban,pivot and graph views to 'hours spent on
sub-tasks' button's action.
closes: #83482
task-2742725
Related: odoo/enterprise#23788
Related: odoo/upgrade#3480
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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.
closesodoo/odoo#89889
Related: odoo/enterprise#26728
Signed-off-by: Géry Debongnie <ged@odoo.com>
- The starred field was renamed as priority.
- The assigned date is now set back to False when the user is unassigned from the task
- An action helper was added to the collaborators view
- The year mode was added to the calendar view of tasks
task-2802506
closesodoo/odoo#87139
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
before this commit,
in kanban view of task sub-task count of task is visible when
sub-task feature is disable from setting.
after this commit,
sub-task count of task will not be visible in kanban view of
task when sub-task feature is disable from setting.
task-2758779
X-original-commit: 1e45586c16443c3a19ae16f604882087dea3cc4e
Part-of: odoo/odoo#89329
In a project burndown chart, we currently have two measures, "Count" and "# of tasks".
Those measures are identical, but the default "Count" one is less explicit.
We only want to keep "# of tasks", but rather than discarding the default measure,
we could rename it and remove the other one.
This commit removes the "# of tasks" measure, and renames the default "Count"
into "# of tasks".
Task-2734458
closesodoo/odoo#86110
Related: odoo/upgrade#3357
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit add a css style when a td (= table column) has the class
`text-bold` to put in bold the text in that column.
task-2814466
Part-of: odoo/odoo#88219
Before this commit, the user could having a bit difficult to read a
row in Sales or Profitability section shown in right side panel of
project update view since there is not much space between 2 rows.
The idea is to add a color when the user hover a row to correctly see
the row that he sees.
This commit greys a row when the user hovers a row like we did for the
line in the milestone section in the right side panel.
task-2814466
Part-of: odoo/odoo#88219
Before this commit, when the amount is big the monetary symbol is
displayed either above or below the amount associated.
This commit replaces the basic space by a no line break space to keep
the symbol at the same line than the amount.
task-2814466
Part-of: odoo/odoo#88219
Before this commit, when the user clicks on a row in Sales section
displayed in the right side panel of project update, the action display
the list view even if there is only one record to display.
This commit passes the `res_id` with the action to the frontend to
call the action and directly display the form view when we are sure
there is only one record to show.
task-2814466
Part-of: odoo/odoo#88219
Before this commit, the context retrieves when the user clicks on a
Profitability section is not parse, and since this context is a string
containing the JS object with the context added, the context is not
correctly added with the existing context.
This commit parses the added context to correctly append it with the
initial one.
task-2814466
Part-of: odoo/odoo#88219
Before this commit, the components created and used in the right side
panel are components for the `project.milestone` and we cannot reused
some components for another context.
This commit refactors a little bit to create a parent component with the
common code useful for another components than `project.milestone` ones.
task-2710808
Before this commit, the label is giving with the data computed for the
project profitability.
This commit separes the label with the data to avoid translating many
times the same things.
task-2710808
Before this commit, the profitability section is shown even if data is
found. That is, no cost and/or revenue are found to display the project
profitability.
This commit hides this section in the case where no data is found.
task-2710808
This commit reviews the project profitability displayed in right side
panel of project update kanban view. The goal of this commit is to add
more information to allow the user to see all information concerning the
profitability of his project.
task-2710808
This commit completly reviews the Sales section. This section will
display all Sales Order Items linked to the current project shown
instead of displaying the sold section with the total sold section.
This section will shown the name and ordered, delivered and
invoiced quantities for each Sales Order Item related.
The name displayed in this section will be clickable if the product linked to
the Sales Order Item is a service one and if there is at least one
timesheet linked.
Finally, this commit also moves the Sales section initially defined in
sale_timesheet module into the `sale_project` one.
task-2710808
Steps :
Create a recurrent task.
Delete it.
Run the cron "Create Recurring Tasks".
Issue :
IndexError: tuple index out of range.
Cause :
The cron calls a method which takes the last task of the recurrence
as a model. As there is no such task, an python error is thrown.
Fix :
Do not display the "Continue Recurrence" button when deleting the last
task of it.
opw-2743788
closesodoo/odoo#86309
X-original-commit: 9cfe0042dd6846cf8b52aebeb9dd6e7432b32322
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
*crm, project
With owl2, the `el` of components is no longer available. It still
works in Odoo on LegacyComponent, which has been introduced to ease
the switch from owl1 to owl2, and we're now incrementally removing
it.
With this commit, the action scrolling helpers no longer rely on
component.el, meaning that views using them (through the hook
`useSetupAction`) no longer need to extend LegacyComponent.
More specifically, we move the action scrolling helpers from core/
to webclient/actions, as those helpers make no sense outside the
context of actions (and thus are unnecessary in the frontend).
Tests have been adapted as well.
closesodoo/odoo#85631
Related: odoo/enterprise#24902
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>