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
closesodoo/odoo#99326
X-original-commit: eee722bb74db70a49ba88250afd0359c510e5ade
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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
Before this commit, the `getFirstElementForXpath` function is used in
the unit test for the burndown chart. This function is used to select a
HTMLELement with xpath expression and could be used outside the unit
test of the burndown chart.
This commit externalizes this function in a project test utils JS file
to use this function in another unit tests file if needed.
task-2924268
closesodoo/odoo#97574
Related: odoo/enterprise#30173
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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
This commit's purpose is to improve the user experience when using the
burdown chart as well as preventing fetching all the data in order to
prevent long loading time on big databases.
This commit adds `Allocated Hours` (`planned_hours` field) in the chart
measures as well as default filters in order to restrict the data to
the tasks which stage have been modified this year or the previous
one, or which current stage is not `closed`. This commit also hides the
`stage_id` field from the one that are available in the group by as this
report requires it to be set (and thus we need to prevent the user from
removing it).
task-2941625
closesodoo/odoo#97321
Related: odoo/documentation#2551
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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.
closesodoo/odoo#95729
Related: odoo/enterprise#29592
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
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
- Purpose
Improve the UX of the "column creation" mechanism in the kanban view
so that users better understand what it is they are creating.
- Specifications
In the kanban creation mechanism, use the name of field on the model
(e.g. when grouped by stage_id in project.tasks kanban, "Add a Column"
would become "Add a Stage" because the stage_id field's name is "Stage").
task-2755570
closesodoo/odoo#95550
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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
closesodoo/odoo#95245
Related: odoo/enterprise#29089
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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.
closesodoo/odoo#96833
Task-id: 2929576
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
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.
closesodoo/odoo#96880
X-original-commit: 81b92a61907028f71b1337b11d0d60ee98bb5775
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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