Commit Graph
6279 Commits
Author SHA1 Message Date
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
Vincent Larcin 7f908c6a69 [FIX] project: make personal stage non required in task form view
Since https://github.com/odoo/odoo/pull/90588, the personal stage is a required field in the task form view in debug mode.
However, we only generate personal stage for a given user when that user is first assigned to a task.
If a user creates their first task and assign it to themselves, they won't be able to give it a personal stage.

To prevent issues linked to the current users not having personal stages, this commit makes the field not required, but prevents the user from unsetting it

closes odoo/odoo#99735

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-14 21:21:45 +02:00
Vincent Larcin b79c0e20c8 [FIX] project: no personal stage when editing someone else's task
Since odoo#90588, the personal stage is a required field on the task form view in debug mode.
However, it does not make sense to have to set a personal stage when editing a task assigned to someone else.

This commit therefore hides the field when the user edits a task they are not assigned to.

Part-of: odoo/odoo#99735
2022-09-14 21:21:45 +02:00
Gorash 39ea7a1fab [IMP] web/all: XML templates are now declared into the python manifest.
Adapt all manifest, split some XML file and update JavaScript files.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
Gorash 5410b7c238 [IMP] base/web: XML templates are added into the asset bundles.
XML files are now declared in python module manifests. During the qweb
't-call-asset' directive, assetbundle will fetch the declared xml files,
apply the inheritance (t-inherit) and create a javascript service (for
eg: 'web.assets_backend.bundle.xml') which is added at the end of the
*.js mimifier file.

When the debug mode is activated, comments are added in the template
indicating which file the template comes from as well as the
inheritances applied to it.

****

JavaScript:

assets.js (module @web/core/assets) takes care of loading libraries,
javascripts and styles.
`loadJS(url)` (loads the javascript and returns a resolved promise when
the templates are also loaded via the '*.bundle.xml' service)
`loadCSS(url)` (loads the style a resolved promise when the file is
loaded)
`loadXML(xml, app=assets.defaultApp)` (load template into
application/owl, used by the `*.bundle.xml` services)
`getBundle(bundleName)` (get the bundle descriptor)
`loadBundle(desc)` (load the files and bundle from a descriptor)

templates (XML element content all owl templates)

A new `ready(serviceName)` method on boot.js lets you know when a
service is loaded are the require.

The xmlDependencies attribute no longer exists.

Python:

The xmls taken into account by assetbundle.py, applying `t-inherit`
inheritances and adding an `name_of_the_bundle.bundle.xml` service in
the generated JavaScript file.

****

Every manifest changes is into the next commit, except 'web_tour' in
this current commit as example.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
Pierre-Yves Dufays bee4a2659d [IMP] {test_}mail: merge notif email template layout to keep only one
Make mail_notification_layout as the default mail template and remove
message_notification_email. We now only have 2 main notification mail layout
templates (outside of a light one): the default one and one that inherits from
it to only change the signature to the responsible instead of the author one.

In this operation the layout of message_notification_email has been integrated
in mail_notification_layout to support outlook mail client for which
message_notification_email has just been reworked (odoo/odoo#92847).

Technical note: we have integrated the "internal communication" banner from
"message_notification_email" into the new default template
"mail_notification_layout" which cause one added query in the test for querying
the flag internal from mail.message.subtype.

Task-2801600

Part-of: odoo/odoo#88466
2022-09-14 19:13:45 +02:00
Pierre-Yves Dufays a577afc75e [IMP] account,crm,project,purchase,sale,[test_]mail: improves activity notif
Ease the understanding of the notifications sent when users are assigned to an
activity or a model (task, lead, ...).

Technical note:
- the customization of data sent to the email layout template (here subtitles)
should be done by overriding
mail_thread._notify_by_email_prepare_rendering_context on the model.
But in this case, we send an activity (ex.: todo) for a model (ex.: crm.lead)
which involves 2 models. Data from both models must be sent to the template
layout. To solve this problem an optional parameter to
mail_thread.message_notify has been added: subtitles. This allows the
caller which knows about the 2 models to set the values for subtitles for
the template.
- mail_activity._render_notify_header has been added to render the subject and
subtitles using the language of the recipients through the context lang
variable.
- a generic mail notification template has been added and the specific
mail_notification_paynow has been derived from it as the only change is the
handling of the signature.

Task-2801600

Part-of: odoo/odoo#88466
2022-09-14 19:13:44 +02:00
Xavier ALT 5c0a3f03b8 [FIX] project: fix typo in /my/task/<task_id> controller
Missing comma, introduced by db379b6838b8

closes odoo/odoo#100111

X-original-commit: a86a153169a7a1b5f40532d987a36b9381e9a10f
Signed-off-by: Xavier <xbo@odoo.com>
2022-09-14 04:23:53 +02:00
William Braeckman e2ba23ea17 [IMP] mail: Migrate many2many_tags_email widget to Owl
closes odoo/odoo#99230

Related: odoo/enterprise#31254
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-13 13:53:08 +02:00
Xavier BOL (xbo) 347f66bc22 [FIX] project: redirect /my/task/<task_id>
Before this commit, the commit [1] renames the routes to keep the url
and add the id when the user selects a task id.
However, the redirection is missing for `/my/task/<task_id>` due to
an issue in the routes selected for the redirection.

This commit redirects the `/my/task/<task_id>` to `/my/tasks/<task_id>`
to keep the old route accessible.

[1] b517fdc19d

closes odoo/odoo#99713

X-original-commit: db379b6838b8883ae8fef2659912854dd08cf31c
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-13 09:31:14 +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
Xavier BOL (xbo) 91d25c932f [IMP] project,hr_timesheet: no open project in list view
Before this commit, the project field in task and timesheet models is
clickable in list view of those models.

This commit prevents to open the form view in the list view since the
form view of project is now more a view to configuration the project and
so once the configuration is done, the user will not always need to go
to that view.

closes odoo/odoo#99949

Related: odoo/enterprise#31212
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-09 22:49:57 +02:00
Vincent Larcin 158b5d2c77 [IMP] project: add project id to task values in portal
This commit adds the id of the project to the task values sent to the front end in the portal.
This allows us to easily know which project the task is in from the front end and direct the user to the right documents pages.

Enterprise: odoo/enterprise#30838
Upgrade: odoo/upgrade#3749

Task-2944247

closes odoo/odoo#99151

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-09 14:41:05 +02:00
Vincent Larcin 2df1d0d7d5 [IMP] project: wrap project name in div in portal task list
This commit wraps the span containing the project name in the portal task list in a div, in order to allow easily adding the "Documents" button next to it.

Enterprise: odoo/enterprise#30838
Upgrade: odoo/upgrade#3749

Task-2944247

Part-of: odoo/odoo#99151
2022-09-09 14:41:05 +02:00
Vincent Larcin 68d3c7ef93 [IMP] project: rename 'Task' variable in _prepare_tasks_values
This commit renames a 'Task' variable to 'Task_sudo' in the _prepare_tasks_values method, to make it clearer that it does have sudo rights.

Enterprise: odoo/enterprise#30838
Upgrade: odoo/upgrade#3749

Task-2944247

Part-of: odoo/odoo#99151
2022-09-09 14:41:04 +02:00
hiroh-odoo bffc5dc658 [IMP] project,sale(_purchase,_timesheet): improve generic UX for project
Purpose of this PR to improve generic usage of project app.

So in this commit done the following changes:
 - move the the filter 'tasks_due_today' and 'late_milestone' above the
  'late' filter.
 - change label for 'remaining_hours_on_so' according to timesheet uom.
 - add placeholder in milestone wizard
 - make remaining_hour field colour red when it's value < 0.
 - added filter in project_sharing_view search view 'overtime',
   'remaining_hours_percentage','tasks_due_today','late_milestone',
   'open_tasks','closed_tasks','closed_last_7_days','closed_last_30_days'.
 - added optional field in project_sharing_view sub-task list view
   'subtask_effective_hours', 'total_hours_spent','priority','remaining_hours_so'.
 - added optional field in portal tree view 'timesheet_uom','progress','priority',
   'portal_user_names','remaining_hours_so'.
 - re-arrange quick search options in search view options in portal view.
 - make the 'subcontract service' field company dependent and add
   fa-building icon on form view.

task-2889829

closes odoo/odoo#96149

Related: odoo/enterprise#29563
Related: odoo/upgrade#3712
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-08 17:31:45 +02:00
Yannick Tivisse faf1fe1b41 [FIX] project: Fix tags name_search perf
closes odoo/odoo#99762

X-original-commit: 4eaddc72ab09c70b200479872c397d5707cee6ab
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-08 09:38:41 +02:00
Panagiotis Kyriakou 73b6284213 [IMP] project: add gateway tip in digest
This commit introduces a new digest tip which
informs the user about the possibility to create
tasks in a project by receiving an email in its
email alias.

If a project with an email alias is set up it will
show it as an example. Otherwise the tip will be a
generic message.

This introduction will further help explain odoo
capabilities to its users.

Task-2973540

closes odoo/odoo#99740

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-08 01:08:11 +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
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