Commit Graph
5878 Commits
Author SHA1 Message Date
Thibault Libioulle 741663f9de [FIX] project: fix project update default
Prior to this commit, the case where the update status was not set is
not handled in the STATUS COLOR mapping.

This commit associate a lighten dark color to the unset update status.

See PR : #68899
See task-2393768

PR : #70527

task-2458135
2021-09-06 10:41:14 +02:00
Cedric Prieels (cpr) 1ec2b3c0b0 [IMP] project: improve project updates
This commit improves the project updates panel and the data reported
in the update description.

This commit prepares the removal of the project overview feature.

PR : #72736
See odoo/upgrade#2706

task-2545084
2021-09-06 10:41:13 +02:00
Raphael ColletandXavier Dollé 1595c0ee27 [REF] core: replace thread-local "envs" by cursor-bound "transaction"
Refactor the Environments object into a Transaction object, which is
bound to one cursor, and is no longer shared among several cursors.

The following methods/properties have been changed:
 - Environment.envs no longer works (because of the design change);
 - Environment.manage() is deprecated (no longer useful);
 - Environment.reset() is now an instance method;
 - env.clear_upon_failure() is deprecated in favor of cr.savepoint().

closes odoo/odoo#75598

Related: odoo/enterprise#20451
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2021-09-03 15:45:46 +00:00
Raphael Collet 765ec7837c [REF] core: add methods flush() and clear() on cursor
This deprecates the ugly and inconvenient functions flush_env(),
clear_env(), and avoids explicit calls to precommit.run().

Part-of: odoo/odoo#75598
2021-09-03 15:45:46 +00:00
Priyanka KakadiyaandXavier BOL ebf163c6a4 [IMP] hr_timesheet, portal, {sale_}project: few improvements for portal
PURPOSE

Generic UX improvements for the portal

SPECIFICATIONS

For projects list view,

- clicking on the project should open the list view of tasks with groupby stage
- the number of tasks should not be clickable

For tasks list view,

- display the fa-star of the priority field on the left of the name of the task
- add the following fields on the right of the name:
  user_id, time spent, kanban_state
- for the kanban_state,
  only display the colored dot and indicate the name of the state on hover
- for the time spent:
  indicate the nb of hours recorded / nb of planned hours(or days(as per unit))
  (if the nb of planned hours = 0, only display the nb of hours recorded)

For tasks search view,

- add a group by priority and status and reorder accordingly
- add a quick search on status and priority and reorder accordingly
- add a sort by priority, assigned to and status and reorder accordingly

For task form view,

- display the fa-star icon of the priority field on the left of the name of task
- add the kanban state in the top right corner

the kanban_state field should be editable by portal users
increase nb of items displayed in the list view to 80 items per page(generic)

Task-2613330

closes odoo/odoo#74996

Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
2021-09-03 15:45:24 +00:00
Thibault Libioulle dd706ea024 [IMP] (sale_)project,hr_timesheet: add analytic account and tags on task
Previously, all costs allocated to a task were associated, if set, to
the analytic account of their project.

This commit adds a deeper level of granularity, as the user will be able
to override the project analytic account and add analytic tags.
When creating timesheets or creating account move line related to SO
linked to a task, the analytic account of the task is now taken into
account rather than the one defined on the project. If an analytic
account is set on the SO, it remains the default account used.

If a task is related to an SOL and an invoice line is created from this
SOL, the analytic tags of the task are also given to the account move
line.

If different analytic account are linked to a same SOL through the
project using this SOL or the tasks using this SOL, than no default
analytic account is set on the invoice line.

PR : #70527

task-2458135
2021-09-03 12:45:58 +02:00
Kevin Baptiste d9e47e23ef [IMP] project: UX improvements
- Align colors of Project Update bubble's to kanban colors
- Allow Project User to manage Project Updates

TaskID: 2615316
Related: odoo/enterprise#20426
Related: odoo/upgrade#2773
2021-09-01 14:22:38 +02:00
William Braeckman 7563b448da [IMP] project: add personal task stages and multiple assignments
Adds personal stages to tasks.
Users assigned to tasks will be able to have their own pipeline to
handle their tasks independently of the project's pipeline.

The assignee field on Tasks has also been changed to a Many2many to
support multiple assignees on one task.

The same table is used to store those information, essentially a triplet
(task, user, stage), to ensure that:
1) personal stages only apply to tasks to which you are assigned to.
2) synchronizing to make sure that you don't have a personal stage for a
   task on which you are not assigned anymore.

Alongside those changes, some minor changes have also been made:
- Modified the task's tree view.
- Renamed the Tasks menu to 'My Tasks'.
- The default view is now the kanban view for the 'My Tasks' action.
- project_id is not required anymore, tasks with no project are
  considered 'private', those tasks are only visible to those that are
  assigned to it.
- Added tracking of both user_ids and depend_on_ids in the chatter.

Closes odoo/odoo#74087

Task ID: 2398734
2021-09-01 07:17:40 +00:00
William Braeckman b74960f571 [IMP] project: hide dependency change subtype if option is disabled
A recent commit allows mail subtypes to be hidden depending on the
record fields. This allows us to hide the dependency changed subtype if
the option is disabled.

Closes odoo/odoo#75749

Task-2628818

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-31 12:43:54 +00:00
Laurent Stukkens (LTU) 2b9584101f [IMP] project: improve milestones design
closes odoo/odoo#75734

Related: odoo/enterprise#18045
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-30 21:05:04 +00:00
yhu-odoo 45912aaebd [IMP] analytic, project, *: Improve views
Improve the views of analytic.account and project.project.
Add category to analytic.line.

Task-2469742
PR #68708
2021-08-27 16:40:49 +00:00
Xavier BOL (xbo) 7fd05a3864 [IMP] project: review content in '/my/project/<id>' route
Before this commit, this route displayed the portal form view of the
project. This view does not seem useful for the external user and prefer
directly see the tasks of this project.

This commit replaces the portal form view of the project by the tasks
list containing in the project. Moreover, another route has been added
to allow the external user to go to the portal form view of the task
selected in ths list.
This route is called '/my/project/<project_id>/task/<task_id>'.

We decide to replace the content of the route because we want to allow
the public user to access to the tasks list of the project with the
access_token of the project. Also, with this same token, the public
could access to the form view of the selected task and send a message if
he needs.

task-2379518

closes #73341
2021-08-26 16:57:23 +02:00
Xavier BOL (xbo) e9134c71b6 [IMP] project: remove the create and edit in views of collaborators
Before this commit, the project manager could edit the collaborator
records. That is, he could change the shared project or the
collaborator.

This commit allows the user to only see or remove the collaborators for
a shared project. If the user wants to add some new collaborators, he
has to use the project share wizard.

task-2379518

closes #73341
2021-08-26 16:57:23 +02:00
Xavier BOL (xbo) 5d5be956f3 [IMP] project,hr_timesheet: enable project sharing feature when needed
Before this commit, the project sharing feature is enabled by default
when the Project app is installed but the user could never use the
feature and thus we add more access rights to portal user for nothing.

To avoid this, this commit removes by default all additional access
rights given by project sharing feature and adds this access rights only
when a collaborator is added.
If the user removes all collaborators for all projects then we need
to disable the feature. That is, we will remove the access rights and
ir.rule records added.
So, the feature will not really disable but we remove the additionnal
access rights and ir.rule records added with this feature.

task-2379518

closes #73341
2021-08-26 16:57:23 +02:00
Xavier BOL (xbo) a571faa3db [IMP] project: limit access to portal user in project.collaborator 2021-08-26 16:57:23 +02:00
Xavier BOL (xbo) a28cc6333a [REV] project: select access rights in project sharing
This reverts commit fc7778f8c512202dc3361d6b87be8c28b299c3c8 because of
a change in the spec.
The access mode are removed and replaced by this access mode for portal
user:
- read: the user goes to the classic portal view
- edit: the user is added as collaborator of the shared project and can
access to project sharing views.

To do this, the portal share is inherited by the project share wizard.
This new wizard can be open to share in readonly and open to share in
edit mode via 2 buttons in the form view of the shared project.
A new stat button is added to form view of project to see the
collaborators of this project. That is, the ones can access to the
project sharing views. The project manager will can remove or also add
new collaborators via the views in this stat button.

task-2379518

closes #73341
2021-08-26 16:57:23 +02:00
Xavier BOL (xbo) 0de3f3ace5 [IMP] project: allow portal user to see only active tasks
Before this commit, the portal user could see archived tasks by filtering the
tasks with the search view.

This commit adds a condition in the domain of the `ir.rule` for this user
to allow him to see only the active tasks.

task-2379518

closes #73341
2021-08-26 14:59:34 +02:00
Xavier BOL (xbo) 7ed6e9e16b [IMP] project: detect if the user changes the access rights
Before this commit, the user cannot remove all access rights for project
sharing feature of a project with allow_project_sharing enabled.

This commit checks if the user has made a change in the access rights if
yes then the 'Confirm Access' button appears otherwise only 'Send'
button appears.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 57b8eb7e3b [IMP] project: not allow portal user to archive tasks
Before this commit, the portal can archive tasks via the kanban views

This commit removes the buttons thanks to the `archivable` option set to
false.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Yannick Tivisse 82b522ce3b [IMP] project: protect orm methods
Before this commit, the portal user could use the public orm methods to
get more information than he allowed.

This commit checks in the orm methods if the fields used in those
methods can be accessed by this user.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 768c63b15e [IMP] project: add unit test for project sharing feature
task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 19a8bf9527 [IMP] project: check portal user can access to project sharing chatter
Before this commit, when we change the access right to the portal user
and this user is in task form view with chatter. He can send message
even we remove the access right.

This commit checks if the user has the access before sending the
message.

task-2379518
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) a60aaa3910 [IMP] project: use project sharings in portal route
Before this commit, when the portal user can access to project sharing
and click on the shared link of the project. He is redirected to the
`/project_sharing/<int:project_id>` route. Since only the portal user
can access and no public users, we could directly redirect to the portal
route and display project sharing views.

This commit removes the `/project_sharing/<int:project_id>` route.
The main route will always be the `/my/project/<int:project_id>` and
we check if the user can access project before rendering.

If the user can access to the project via the shared link:

1. If he is a public user then we render the classic portal view.
2. If he is a portal user then
    - we check if he is an access to project sharing, if yes then we
      render project sharing views otherwise we display the classic
      portal views.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo)andYannick Tivisse 5ea5ddafea [IMP] project: select access rights in project sharing
Before this commit, when the portal user can access to project sharing
views, he can just read. If we just add ir.rule to allow the edition,
the portal could create/edit. We have to allow the project manager to
define the access rights of portal users when he want to share them a
project with the project sharing feature.

This commit adds 3 access modes portal users in project sharing views.
1. **Readonly**: the portal can only see the tasks in the different views.
2. **Comment**: the portal can use the chatter in task form view.
3. **Edit**: the portal user can create and edit tasks.

task-2379518

closes #73341

Co-Authored-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 716f47d14b [IMP] project: give create/write access right to portal user
Before this commit, the portal users can only see the tasks in the
project sharing views.

This commit allows these users can also create tasks and edit some
fields in task.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) bad706d34c [IMP] project: check if the chatter is visible before mounting it
Before this commit, if we put an invisible in attrs of div tag for the
chatter, the attrs is not taken into account because when the chatter
is mounting this div is replaced.

This commit changes the class for the chatter in project sharing and
check if the div is visible before mounting the chatter.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo)andYannick Tivisse a8af1361e5 [IMP] project: limit access to portal user in project sharing
Before this commit, the portal user can read all fields in the
`project.task` model.

This commit checks when the portal user wants to read task record(s) if
this user can see all fields given in parameters. When the portal user
edits or creates a task, we check if this user can edit fields and
create/edit the task based on his access rights and the ir.rules.

task-2379518

closes #73341

Co-Authored-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) d3ecc4962e [IMP] project: update chatter when create/change task
Before this commit, when the user changes the task, the chatter is not
updated so we keep the messages of the previous task. Same thing when
the portal user wants to create a new task.

This commit updates the chatter to allow to fetch the messages when the
user changes the task and also disables the chatter when the user is
creating a new task.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 0c7b99987a [IMP] project,portal: allow portal user not follow task to use chatter
Before this commit, if the portal user is a follower of the project he
can use the chatter of new tasks in the project sharing feature since
the follower of the project is automatically the follower of new tasks.
But if he is not a follower of the task (for instance, old task in the
project) then we have to check if the
access token is the one of the shared project to give the access to
the chatter.

This commit checks the `access_token` of the project when we are in the
project sharing form view to allow the portal user to use the chatter.

task-2379518

closes #73341

Co-authored: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 60e97e4ffb [IMP] project: add chatter in project sharing form view
Before this commit, the chatter is not available in form view of project
sharing even for portal user. Since the portal views, we have a chatter
for the portal users, we need a chatter for those users in project
sharing.

This commit integrates the portal chatter in the form view for only the
portal users.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 2bbb038f22 [IMP] project: replace the basic portal views when project selected
Before this commit, when the portal user is connected and selects a project
in the list when he is in `/my/projects` route, we redirect him in the
task list of this project.

This commit replaces the basic portal view by the project sharing views
if the Project Sharing feature is enabled for this project.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 36f5982e18 [IMP] project: remove the action contextual menu in project sharing
Before this commit, the user in the project sharing views can
Archive/Unarchive the record via the action menu. He can also click on
the share button in the action menu.

This commit removes the default action buttons defined in the action
menu for form and kanban views.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 0e1961b1dd [IMP] project,mail: disable click on avatar
Before this commit, there is no options to disable the click on the
avatar to open the chat in `Many2OneAvatarUser` widget.

This commit adds an option called `no_open_chat` set by default to false
and this option allow to disable the click when it is true. This option
is useful for the project sharing views.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 0e659dc4d7 [IMP] hr_timesheet,project: override project sharing views
This commit override the project_sharing views to add fields defined in
`hr_timesheet` module.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 58a12e03ab [FIX] project: remove duplicate field in project task kanban view
task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) 45c96edae7 [IMP] project: remove the longpolling for project sharing views
Before this commit, the longpolling is active in the project sharing
views but it is not necessary for these views, since the chat is
disabled and the goal of these views is to give access to external
users to `project.task` views.

This commit removes the files about the longpolling for the bundle used
for project sharing.

task-2379518

closes #73341
2021-08-26 14:59:33 +02:00
Xavier BOL (xbo) e50bc12002 [IMP] project: add Project Sharing feature
Purpose:
=======

This commit adds the project sharing feature. This feature consists to
share the backend views about project.task to portal users.

About the access rights:
- The project manager can share a project with project sharing feature.
  To do this, he need to give access to portal users that we want their access in project sharing views.
  He can choose between 3 differents accesses:
    1. Readonly: the portal with this access right will only have read access to the project
        sharing views of the project shared.
    2. Comment: the portal with this access right will can use the chatter in task form view.
    3. Edit: the portal with this access right will can edit some fields of `project.task` model.

The difference between the classic backend views and the project sharing
views is in the project sharing views, we list the fields that the user
can read/write, so the portal users can see only the fields in
our list.
Moreover, the actions and the contextual menu (actions dropdown) are not
available in the project sharing views and the stat buttons are visible
but the click on these buttons are disabled.

Implementation details:
======================

This commit is realized in many steps:

- create the webclient and routes.
- create own qweb bundle.
- add project sharing views.
- use the session to define the action and active_id
- create public fields for project sharing: in this step, we lists all field
names of the `project.task` model that we want to display for the
portal user. Two lists are created, one for only readable field names
and the other one for the writable field names.
Moreover, two properties are defined in the `project.task` model to use the
both lists.
- use `access_token` and check model in project sharing route: in this
step we check if the model is `project.project` and the `access_token`
is the one set in the project since we have the id of the project in the
params url.
- allow only `GET` method to enter project_sharing routes: the
`/my/project/<int:project_id>/project_sharing` route must only be
called with a `GET` method because this route is only used to have the template
to render the project sharing webclient.

task-2379518

closes #73341
2021-08-26 14:59:32 +02:00
Thibault Libioulle 4968cc3444 [IMP] project,sale_timesheet: improve update views implememtation
This commit add various information in views, like name attribute, to
better handle extension.

It improves also the way the FormViewDialog is rendered in the project
right side panel, we no longer have to call willStart at each insertion
of the Form in the DOM since the form is rerendered automatically by
owl once the state changes.

Some click handlers now prevent propagation to ease the addition of
handlers for further needs.

task-2555323
2021-08-23 13:21:24 +00:00
Martin Trigaux d9e3aab69b [FIX] mail: convert res_model_id to selection
Following the removal of read access on ir.model (odoo/odoo#69120),
the mail.activity.type model was not accessible to non-admin users due
to the res_model_id many2one field.

Before this commit, a project user could not access the Activity Type
menu.

Convert it to a selection field with the selection values being
computed in sudo.

closes odoo/odoo#74981

Related: odoo/enterprise#20214
Related: odoo/upgrade#2734
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-08-23 06:56:00 +00:00
William Braeckman 25f8554426 [IMP] project: add project stages
Adds new optional stages for the project.project model.

Previously projects would stay dormant when they were finished, we can
now define stages for those projects to determine where a stage is in
it's lifecycle.

Also adds some small changes to the project itself, such as adding tags.

Closes odoo/odoo#73648

Task ID: 2581575

Related: odoo/upgrade#2646
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-08-23 07:45:56 +00:00
Kevin Baptiste 5ca6619691 [FIX] project: focus on task name
When creating a new task the name field was not automatically focused.

closes odoo/odoo#75271

Taskid: 2585999
X-original-commit: a1f4cc03bc4df556f9a832a91d47f1c3727ab115
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-08-18 15:25:46 +00:00
Kartik Chavda 8590cf9c1b [FIX] project: improve kanban view of task
Purpose of this commit improve kanban_state field layout in
kanban view of task.when user_id doesn't set on task it show
blank div for m2oAvatar which move kanban_state field to left
of that div.

So, In this commit show m2oAvatar only when use_id
is set on that task.

closes odoo/odoo#75258

Taskid: 2557892
X-original-commit: b22d0eaadd8875cc6c5286fe037c199160b65726
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-18 13:13:45 +00:00
yograj tandel 31d5fce20b [FIX] project: improve the translation buttons layout on stages
Purpose of the commit is to fix the  translation buttons layout on
stages form view.

closes odoo/odoo#75257

Taskid: 2605763
X-original-commit: c52647b8828cc4904f44ba2d1919915aa8258f0a
Related: odoo/enterprise#20323
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-18 13:13:00 +00:00
William Braeckman 729e00da1e [FIX] project: prevent setting pane overflow
Previously if one of the text in the project's kanban view's setting
pane was too long, the setting pane would overflow and display a
horizontal scrollbar in order to fit everything.

Closes: odoo/odoo#74822

Task ID: 2618321

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-09 10:32:29 +00:00
William Braeckman d793ff5493 [FIX] project: prevent settings pane toggle from disappearing
Previously the settings pane toggle (on the project's kanban view) would
disappear when the cursor would not be hovering the kanban record.

Closes: odoo/odoo#74822

Task ID: 2618321
2021-08-09 10:32:22 +00:00
William Braeckman 7c23d3b247 [REF] project: refactor project_kanban.js
Replaces multiple .includes in favor of .extend for cleaner code.

Closes: odoo/odoo#74822

Task ID: 2618321
2021-08-09 10:31:35 +00:00
William Braeckman d8a0912bbf [IMP] project: track dependencies in tasks
Tasks that are blocked by other tasks don't get any other information
from those tasks.
In order to get updates on the state of the blocking tasks we now track
some fields (determined by the `task_dependency_tracking` attribute) in
the parent's chatter.

Task ID: 2601448

closes odoo/odoo#73965

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-18 11:19:38 +00:00
William Braeckman 296e3cc15f [FIX] project: fix project status bubble form display
This commit fixes the display of the status bubble inside of the status
button on the project form view. It wasn't visible since the recent css
changes.

Closes: odoo/odoo#74610

Task ID: 2615293

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-03 09:24:30 +00:00
Mathieu Duckerts-Antoine dd8bf39d2a [REF] web: legacy template name
We prepare the rewritting of the search components for the new weclient:
we rename some legacy templates to allow the new components to use the
natural template names.
2021-08-16 12:53:50 +00:00
Martin Trigaux c7bac3dee0 [IMP] *: make ir.model.data helper private
No reason to interfact with them directly in RPC
2021-08-10 13:49:04 +02:00