Commit Graph
6259 Commits
Author SHA1 Message Date
Laurent Stukkens (LTU) fc705d423e [FIX] project: display fields in the right order in list view
Prior to this commit and since odoo/odoo#98913 and odoo/odoo#95729
the `xpath` that are using `company_id` in the views that inherit
`project.view_task_tree2` and `view_task_form2` are no more working
as the `xpath` targets the first match.

This commit fixes this issue.

closes odoo/odoo#99232

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-07 00:04:49 +02:00
Rohitkumar (roku) e849ca6fa7 [IMP] sale_(project),hr_timesheet: generic UX improvement for project
Purpose of this commit to improve generic usage of project app.

So in this commit done the following changes:
 - apply the 'open tasks' filter by default for my task menu
 - the search view set  the one from accounting and not timesheet for
   gross margin stat button
 - add a 'stalling for 30 days+' filter that should return open tasks whose
   last stage update was more than 30 days ago  for project task form view
 - move the 'stage' quicksearch above the 'project' one for burndown chart
 - when archiving a project containing tasks that are recurrent, disable their recurrence instead of
   raising an error
 - format some field in timesheets notebook in project sharing
 - display the 'rating email template' field by default for task stages

task-2899490

closes odoo/odoo#95636

Related: odoo/enterprise#29270
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-06 12:01:26 +02:00
Denis Ledoux 1744870d8d [IMP] base: cache back-end views
The master plan finally comes to an end.

Thanks to:
- odoo/odoo#87522 refactoring `load_views`,
- odoo/odoo#94337 refactoring `common.Form` to prevent changing
    invisible fields in unit tests using `Form` instances,
- odoo/odoo#95729 refactoring the behavior of `groups=` in views,
- odoo/odoo#98551 removing the need of the `groups_id` many2many field
    on back-end views.

The result returned by `get_view`/`get_views` can now finally be easily
and efficiently cached, in order to cache back-end views.

The goal of this revision is to cache the model views and fields
already post-processed for the web client
(with the modifiers, etc., already computed)
without group restriction.
Then, from this cached version, post-process group related features,
such as removing nodes restricted with a `groups=` attribute,
set the create/write button according to the user access rights to models, ...

Not including the groups in the cache key allows:
- to have less cached versions,
  (otherwise it would be one cached version per different group combination)
- to not have to fetch the user groups to compute the key
  (with the current cache key,
  there is nothing to fetch from the database to compute the key)

Besides, post-processing the groups features
after taking the view from the cache of the view doesn't take a tremendous time:
 - parsing arch from/to string with etree is fast,
 - removing the `groups=` nodes using etree is fast,
 - adding the `create="False"`, `write="False"`, `delete="False"` on the view
   root node according to the access right of the user on the model is fast.

This allows way faster calls to `get_views` by the web client,
as the server no longer need, for each call, to fetch the views in database,
combine the inherited views, post-process the modifiers attributes, etc.

Timing tests are available on the pull request of this revision.

Part-of: odoo/odoo#99417
2022-09-05 16:54:01 +02:00
Adesh Jolhe (adjo) 854260f436 [IMP] project,sale,hr(_timesheet): generic improvements for project
Purpose of this PR to improve generic usage of project app.

So, in this PR done following changes:

- In project.project form view :
  - Added name label above name field
  - Changed placeholder name of field to 'e.g. Office Party'
- in project_project_view_form_simplified:
   - displayed name as Title
   -  renamed 'create' into 'create project'
- in project.task form view > extra info notebook :
   - added the 'personal stage' field (Only visible in debug mode)
- in project.project form view:
   - based timesheet encoding unit set the 'cost' field name to Daily cost
     if uom in Days or In Hourly cost if uom in Hours
-  configuration > projects: if possible, clicking on a project kanban card
   will be open its form view

task-2821488

closes odoo/odoo#90588

Related: odoo/enterprise#26977
Related: odoo/upgrade#3492
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-05 14:49:49 +02:00
sash-odoo 5bfcead619 [FIX] project: fix the field 'recurrent' visbility in form view
Before this commit, the 'recurrent' field still be visible even if the
'recurring tasks' feature is disabled in the settings.

So in this commit, fixes the issue by adding the recurrent group and
updating the attrs on field.

task-2858336

closes odoo/odoo#99392

X-original-commit: f83451b9ba86fd919184fc78093535625c0459ef
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-02 19:13:57 +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
Panagiotis Kyriakou 6c029700ff [IMP] project: modify the planning explanation in project settings
In this commit we have modified the planning explanation in the project settings
in order to accomodate the removal of tasks from the planning app
(see enterprise repo of the same branch)

task-2941828

closes odoo/odoo#98035

Related: odoo/enterprise#30404
Related: odoo/upgrade#3771
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-31 23:49:52 +02:00
Xavier-Do b1b66b82a6 [FIX] crm, project: fixing some non-total order
Non total order can lead to randomized order in some case, making some
test behaviour random and/or difficult to debug.

Adding some fallback 'id' order shouldn't hurt

closes odoo/odoo#99324

X-original-commit: 6e40e5fe775273a2d3a968ac113cbeb578318dd1
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-08-31 21:12:12 +02:00
Achraf (abz) 6d3f2ae602 [FIX] project,survey: Fix gutters in kanban_grouped
https://getbootstrap.com/docs/5.1/migration/
add g-0 to rows to remove gutters in the project and in the elearning kanban view

Steps (survey):
- Go to eLearning/Certifications
- Set kanban mode
- Use a groupby

Steps on project are the same as survey

closes odoo/odoo#98967

Related: odoo/enterprise#30769
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2022-08-31 12:37:40 +02:00
Xavier BOL (xbo) 810d1020e2 [FIX] project: cannot change stage if stage contains rating email
Before this commit, when the portal user changes the stage of a task and
the new stage contains a rating template email, he got a traceback
saying he has no access to `mail.template` model.

This commit fixes the issue by sending the email in superuser when we
are sure the user can write on that task.

Steps to reproduce:
==================

1) Enable the rating feature in the settings of Project App
2) Create a Project A and edit it to enable the rating feature on that
project and select "Rating when changing stage" (if it is not already
the case)
3) Set a rating email template on a stage of the project
4) Create a new task and save
5) Change the stage of that task to the stage contained the rating email
template

Actual Behavior:
---------------
A traceback is occurred saying the user has no access to `mail.template`
model.

Expected Behavior:
-----------------
The stage of the task should be changed and the rating email should be
sent.

closes odoo/odoo#99248

X-original-commit: c5093988411e5697f49ca2a128e93203c2d6aac9
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-08-30 21:25:46 +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
Denis Ledoux b84dbc975a [IMP] project: move group inside the view
The goal being to get rid of the `groups_id` feature for backend views

See the related commit in the enterprise part of this pull request.
Here is the commit message for easyness:

In this case, the renaming of the label to "planned date"
is done directly in the base view,
in the community part of this pull request.

It made no sense to change the label from "Dates" to "Date Planned"
when you became a planning user, for all projects.

Either it should be "Planned date" for everyone,
either it should be "Planned" date only for projects using planning.
But not when the user is granted "Planning / User".

It was decided to make this label by default in the base view

Part-of: odoo/odoo#98551
2022-08-29 22:42:55 +02:00
Denis Ledoux 30549a3454 [IMP] project: move group inside the view
The goal being to get rid of the `groups_id` feature for backend views

The revision achieves the same thing,
grouping the project by stages when the "Project stages" features is
enabled,
without having to require a view for that purpose.

Part-of: odoo/odoo#98551
2022-08-29 22:42:55 +02:00
Denis Ledoux 8b91cab67f [IMP] base: remove groups_id from ir.ui.view
The goal of this revision is to get rid of the `groups_id` field of the model `ir.ui.view`.

- This feature wasn't really known or used by most developers,
   and not straight-forward to understand.
   Removing it allows one less complicated thing to learn for developers.
   Besides, thanks to odoo/odoo#95729,
   changing the behavior of the `groups=` attribute,
   we can easily get rid of this `groups_id` feature
   by simply adding `groups=` in the elements of the views
   using the `groups_id` field, it will have the same effect:
   adding the elements in the view only for the users part of the specified 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.

Part-of: odoo/odoo#98551
2022-08-29 22:42:50 +02:00
Abdelouahab (abla) b342fe8460 [FIX] project: grouping by date_deadline access error
To Reproduce
=============

- share a project with a portal user (with editing rights)
- connect to portal with this user and try to group tasks by deadline

Problem
=======

An access error is raised stating that this user doesn't have right to read
`deadline_field:week` field.

The issue comes from this line :
https://github.com/odoo/odoo/blob/42cb8ad0a31162d9d1b93e4eae0562c89685fe3c/addons/project/models/project.py#L1621

where `fields` contains `date_deadline:week` but `self.SELF_READABLE_FIELDS` contains `date_deadline`
that's why `date_deadline:week` will remain in `unauthorized_fields` .

Solution
=========

To solve the issue we take only the field name from the groupby when computing `fields_list` that
will be checked by `_ensure_fields_are_accessible`

opw-2949047

closes odoo/odoo#98953

X-original-commit: 1d0a62d0d235a4f0686e17033bb9d144d5583907
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2022-08-26 08:07:55 +02:00
Audric Onockx (auon) 2d0e0bff45 [FIX] project: display partner_id dropdown
Steps :

In a ONE company environment,
\- Go to Project Task list view.
\- Display 'Customer' column.
\- Select multiple records (multi-edit).
\- Click on a 'Customer' cell to display the dropdown list.

Issue :
Traceback : company not found.

Cause :
partner_id's domain refers to company_id,
which is not present in the vue if not in multicompany.

Fix :
Add it in ivisible.

closes odoo/odoo#98913

Signed-off-by: Xavier <xbo@odoo.com>
2022-08-26 05:40:10 +02:00
Xavier BOL (xbo) 8d46e54c96 [IMP] project: externalize getFirstElementForXpath in test utils file
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

closes odoo/odoo#97574

Related: odoo/enterprise#30173
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-25 19:57:32 +02:00
Thibault DelavalléeandAdrien Dieudonné 22c3cc51ed [FIX] rating: fix bootstrap and styling of rating email and pages
Rating page is broken since migration to bootstrap5. This commit fixes various
issues linked to btn-group, display and usage of group checkboxes. Overall
html structure is cleaned and bootstrap 5 rules are applied.

Some small display improvements are also applied to the rating email.

Task-2207626 (Rating: Log ratings, post feedbacks)

Part-of: odoo/odoo#95623
Co-authored-by: Adrien Dieudonné <adr@odoo.com>
2022-08-25 19:57:17 +02:00
std-odooandThibault Delavallée 6ebb72332e [IMP] rating: improve rating notification with delaying until feedback
Purpose
=======

When someone receives an email with a rating request, he can click on a
smiley. But if he does not write a feedback, nobody is notified. This means
some rating as somehow lost and people are not notified of it.

Specifications
==============

Now, when the user clicks on the smiley, a message is posted but notifications
are not yet sent. This uses the new ``mail.message.schedule`` mechanism added
in this PR. It gives the user some time to write their feedback and send it.

If they write and submit a feedback, the notification process is launched.
Emails and inbox notifications are created and sent.

If they don't write a feedback notification process is launch after 2 hours.

Testing
=======

Some cleaning is done in tests, notably to split some fields tests from
performance test. A bit performance test is also split into sub tests in
order to better understand queries.

Task-2207626 (Rating: Log ratings, post feedbacks)

Part-of: odoo/odoo#95623
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2022-08-25 19:57:17 +02:00
luvi c8c34b7e0e [REV] project: revert changes in template
This commit reverts changes that are no longer
necessary since PR #98711 which fixed a lot
of issues regarding styles and alignments.

closes odoo/odoo#98867

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-25 12:05:40 +02:00
Thibault Delavallée d13d251a2f [MOV] various: move and split mail data
Just doing the summer file cleaning. Move mail data into files named based on
their model, easing maintenance and searching for those data.

Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)

Part-of: odoo/odoo#98661
2022-08-25 10:31:56 +02:00
Thibault Delavallée 0419de7ff2 [MOV] various: move / rename rating files
Just doing the summer file cleaning. Move rating code into files named based on
their model, easing maintenance and searching for those data.

Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)

Part-of: odoo/odoo#98661
2022-08-25 10:31:56 +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
luvi f1ce90f158 [FIX] project: fix the style of icon
This commit fixes the style of the lightbulb icon
present in the settings of a project.
After this commit, the icon is now displayed
inline with the text.

closes odoo/odoo#98755

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-24 19:53:59 +02:00
Matthieu Stockbauer fe699a241d [IMP] *: adapt client code to use websocket instead of longpolling
*: bus, calendar, hr_attendance, iap_mail, im_livechat, project, snailmail,
snailmail_account, survey, web, web_editor, website_livechat.

This commit is part of the websocket integration in Odoo.
This bus service now communicates with a shared worker in order to provide
a single websocket connection for multiple tabs. It is designed to
be used as a websocket except that events are slightly different,
re-connection is handled automatically. If the browser does not support shared
worker (Safari), the service fallback on a simple web worker.

Available events are:
   - connect : fired upon a successful connection.
   - disconnect : fired upon reception of the websocket close event.
     The close code and reason are given to the listeners callback.
   - reconnect : fired upon a successful re-connection.
   - reconnecting : triggered when the worker starts to try reconnecting.
   - notification : fired upon the reception of notifications.

Since multiple tabs are now handled by a worker, the cross_tab bus is no longer
required and has been removed.

Part-of: odoo/odoo#75510
2022-08-23 17:55:10 +02:00
Laurent Stukkens (LTU) b653c5f647 [IMP] project: add measure and filters to burndown chart
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

closes odoo/odoo#97321

Related: odoo/documentation#2551
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-22 18:03:13 +02:00
Romeo Fragomeli a5d6b3cafd [FIX] project,web: 'bg-muted' doesn't exist anymore
`bg-muted` as been replaced by `bg-200` in odoo/odoo#97051, but there
are still non-converted ones.

closes odoo/odoo#98555

Related: odoo/enterprise#30635
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-22 16:48:57 +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
Vincent Larcin 4bdd65d9c2 [FIX] project: force project active_id in view tasks action
Steps to reproduce
------------------

1. Install sale_project.
2. Create a product that creates a project on order.
3. Create a Sales Order with this project and confirm it.
4. Click on the 'Projects' stat button on the SO.
5. Try to click on one of the projects, you should get an error.

---

This commit fixes this error by properly using the id of the project
as `active_id` in the action to view its tasks.

Task-2957905

closes odoo/odoo#98464

Signed-off-by: Xavier <xbo@odoo.com>
2022-08-19 17:49:00 +02:00
Miquel Raïch a669992509 [FIX] project: use correct lang when creating personal stages
It's expected that the personal stage is in the lang of the user_id. This commit assures it happens.

closes odoo/odoo#97523

X-original-commit: 2ab1f055b77ab50b62245ab8e34de91500d0c423
Related: odoo/enterprise#30322
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-08-12 23:37:19 +02:00
Xavier ALT ccb987dada [FIX] rating: ensure rating_last_value computation is deterministic
Running tests for `project` module only fails with the following error:

```
2022-08-02 08:19:41,777 5669 ERROR testdb odoo.addons.project.tests.test_project_report: FAIL: TestProjectReport.test_avg_rating_measure
Traceback (most recent call last):
  File "/build/odoo/saas-15.3/addons/project/tests/test_project_report.py", line 22, in test_avg_rating_measure
    self.assertEqual(self.task_1.rating_last_value, 5.0)
AssertionError: 4.0 != 5.0
```

With the ORM flush mechanisms when multiple ratings are created at once
they all have the same `create_date` and/or `write_date`, this commit
ensure the order is deterministic.

closes odoo/odoo#97691

X-original-commit: 567d27cc600bdbb39d62e7aa75b37d48b33d27a5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-09 02:24:57 +02:00
Rohitkumar (roku) fada786edf [FIX] project: hide the milestone option from burger menu
Before this commit, milestone is still visible in project burger
menu even if we disable the milestone feature and due to that while
creating the milestone it was generating the traceback.

So in this commit, add groups on milestone option on project burger menu.

task-2918411

closes odoo/odoo#97629

X-original-commit: 1a7e2a298c2cbf076ce96dae85805f9dd77c7e0d
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 22:16:24 +02:00
Manisha Tulsiyani 038bfa2ca1 [IMP] project,sale_timesheet: generic improvement for the project
Purpose of the commit is to do the generic improvements for project.

So in this commit did the following changes:
 - the 'upsell opportunity' activity should be generated even
   if the service has already been invoiced
 - project.task hide the 'create' button if the project in the
   context is archived
 - project.task portal form view: only the ref of the invoice
   should be underlined on hover, not the empty space.

task-2857924

closes odoo/odoo#94776

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 10:50:50 +02:00
hiroh-odoo 543f36d9e4 [IMP] project: add ancestor_id field in task analysis report
This commit add a ancestor_id field in task analysis report.

task-2824000

closes odoo/odoo#91023

Related: odoo/enterprise#27166
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 10:50:33 +02:00
Rohitkumar (roku) a819d6a597 [IMP] sale_(project),hr_timesheet: improve generic UX for project
Purpose of this commit to improve generic usage of project app.

So in this commit done following changes:
 - when deleting a project, delete all of its tasks in the process instead of
   raising an error
 - make the list view editable bottom
 - add a 'view task' button to open the task form view
 - the 'download' and 'print' buttons should be centred
 - rename 'planned hours' into 'allocated hours' (or 'allocated days' if the
   timesheet encoding unit is in days)
 - when a project is linked to an SO manually, he should appear in the
   'projects' stat button of the SO; same goes for tasks
 - remove the 'profitability' setting
 - display the SOL and the quantity in red as well if the milestone hasn't been
   reached yet for update right side panel
 - add a project field for quickcreate in kanban view
 - 'fa-check-square-o x/y' in muted on the project kanban cards

task-2838372

closes odoo/odoo#92262

Related: odoo/enterprise#27758
Related: odoo/upgrade#3561
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-05 03:38:02 +02:00
Rohitkumar (roku) 2720bc2034 [IMP] sale_(project),hr_timesheet: generic UX improvement for project
Purpose of this commit to improve generic usage of project app.

So in this commit done following changes:
 - add the following filters for project.update search view
 - display 'due mm/dd/yyyy' in red if the deadline is in the
   past and the milestone hasn't been reached yet for milestone section
 - add an 'x Milestones' stat button that should open a list view of all of
   the Milestones that are linked to an SOL of this SO for sale.order form view
 - add an 'unread messages' filter with separated from other filter
 - rename 'create' into 'create project for project wizard
 - change to "Create projects to organise your tasks. Define a different workflow
   for each project." for project.project action helper

task-2864875

closes odoo/odoo#94936

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-04 18:35:23 +02:00
Kartik Chavda 873dd773c0 [IMP] project: set default analytic account and analytic tags in task
Currently, the project's analytic account and analytic tags are not set by
default in the task.

Technical-
- In this task, we have added a demo of analytic tags in the project.
- The default_get() method does not call when the demo data is loaded, so
  the analytic account and analytic tags are not set. So we called
  default_get() from _load_records_create().

task-2861376

closes odoo/odoo#94144

Related: odoo/enterprise#28656
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-04 18:35:11 +02:00
Kartik Chavda 02d485779f [IMP] *_: add the analytic tag on projects, tasks, and timesheets in demo data
*_ = project, hr_timesheet

Currently, the analytic tag is not added to the project, task, and timesheet.
In this commit, we have inserted analytic tags in some projects, tasks, and
timesheets. If an analytic tag is inserted in the project, it will be automatically
added to the task and timesheet.

task-2861376

Part-of: odoo/odoo#94144
2022-08-04 18:35:11 +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) 56064ff1e4 [REM] *: drop oe_clear class in favor of clearfix bootstrap default
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:14 +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
Audric Onockx (auon) 45f26fdd43 [IMP] web: dynamic placeholder for column creation
- 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

closes odoo/odoo#95550

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-03 20:47:56 +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
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +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
Panagiotis Kyriakou 4b34897416 [IMP] project: add access info on project visibility settings
This commit introduces some information/instructions regarding the access
to the project/tasks depending on what the user has selected for the project visibility.
This should reduce confusion and thus increase productivity on the user side by
making the task of granting access rights more straightforward to the user.

closes odoo/odoo#95947

Task: 2917471
Related: odoo/enterprise#29455
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-07-22 18:53:52 +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
hieu 19549afdfc [FIX] project: fix access error when internal user access to project
form

Before this commit, when the internal user without any access rights to
the Project app and has a link to access to the form view of a "public"
project, an access error is occurred when that user when to access to
the
project form view. The reason is the `project.collaborator` is only
accessible to the user with an access right to the Project App and since
the number of collaborators displayed in a stat button is computed with
the access rights of the current user, the compute cannot be done for
the
internal user.

This commit executes the compute is superuser to prevent the user having
access error and to correctly access to the project form view as before.

Steps to reproduce the bug:
--------------------------
1) Create a Project P and add *Marc Demo* in the followers of that
project
   if the Privacy Visibility is "Invited internal users".
2) Remove the access rights to the Project app for *Marc Demo* user.
3) Copy the link to the form view of project P.
4) Log in as *Marc Demo*.
5) Paste the link copied in step 3 to access to the form view of project
P.

Actual Behavior:
---------------
An access error is occurred because the user without any access to the
Project app cannot access to the `project.collaborator` model.

Expected Behavior:
-----------------
The internal user without any access rights to the Project App should
access
to the form view of the project P.

closes odoo/odoo#96497

X-original-commit: c725c3fbb29eff49eff3794aff9d407175599e63
Signed-off-by: Xavier <xbo@odoo.com>
2022-07-21 12:29:47 +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