Commit Graph
530 Commits
Author SHA1 Message Date
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
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
Vincent Larcin 55d8da526d [IMP] project: adjust portal visibility followers behavior
Currently, portal followers of a project and its tasks are removed when
the project visibility is changed to something else than portal.
=> We want to keep the behavior, but only when changing the visibility
from portal to something else.

When the project visibility is changed to portal, we currently add
its customer to its followers.
=> In that case, we also want to add the customer of the tasks to the
followers of the corresponding task.

When the customer of a project in portal visibility is changed, the
new customer is added to the followers of the project.
=> We want to remove this behavior.

When a project is created with a customer and the portal visibility,
the customer is added to the followers of the project.
=> We want to remove this behavior to avoid mistakenly showing a project
that is not ready yet to the customer.

This commit implements those changes, and also adds a warning when
changing the visibility of the project if that change will automatically
add/remove followers to the project and its tasks.

Related: https://github.com/odoo/enterprise/pull/25800

Task-2812551

closes odoo/odoo#87747

Related: odoo/enterprise#25800
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-21 13:22:32 +02:00
Barad Mahendra b5f8f2133b [IMP] project: unarchive tasks when unarchiving stages
Currently, all of the tasks contained in a stage are archived
when the stage is archived. However, the tasks remained archived
when the stage is unarchived.

So in this commit, If the user unarchives a stage, ask the user to
unarchive the tasks it contains in the process.

task-2835624

closes odoo/odoo#94008

Related: odoo/enterprise#28301
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-21 12:20:53 +02:00
Adesh Jolhe (adjo) 8f192a9b57 [IMP] project(_sms),hr_timesheet: generic improvements for project
Purpose of this PR to improve generic UI of project app.

So, in this PR done following changes:
  - Added group by assigned to under reporting -> customer ratings
  - In quick search, changed "rated rated" operator to "assigned to" under
    project.project search view
  - Removed rating_status field from project > configuration > settings > customer
    ratings
  - Switched the 'timesheets' and 'planning' features from place from
    project > configuration > settings
  - In project.task  extra info notebook:
     - Added the 'parent task' field above the 'analytic account' field
     - Added the 'company' field above the 'sequence' field
  - Added send mail and sms action in project.project and project.task
    list view.

task-2806292

closes odoo/odoo#88446

Related: odoo/upgrade#3459
Related: odoo/enterprise#26207
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-20 12:16:04 +02:00
Fabio Barbero dc66b7aec3 [IMP] mail, various: use overridden method in message_notify
Purpose
=======

In message_notify, when called on a recordset, call model methods instead of
base one defined on MailThread. This allows to use internal methods overrides.

Also perform some linting on calls to ``message_notify`` in order to better
spot calls, parameters, ...

Task-2852908

closes odoo/odoo#92868

Related: odoo/enterprise#28038
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-18 10:23:03 +02:00
Vincent Larcin 8d6960a706 [FIX] project: fix project privacy_visibility tooltip
The project privacy_visibility tooltip doesn't reflect the actual behavior
for the "Invited portal users and all internal users" selection.

This commit rephrases the tooltip of that field in order to correctly match its behavior.
It also slightly changes the name of the options to match the new tooltip.

Task-2871771

closes odoo/odoo#93911

X-original-commit: 9ef7030e3346eda267bc27b47a8a168acdc4a7b9
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-17 14:14:52 +02:00
Vincent Larcin d9342a9c4d [FIX] project: disable basic features on all projects
Steps to reproduce
------------------

1. Install project and fsm.
2. Enable a basic project feature (sub-tasks/task dependencies) in the settings.
3. Enable the same feature on the fsm project.
4. Disable the feature in the settings.
5. The feature is still enabled on the fsm project
	- This can be hard to see since the field will be hidden on the settings of the project, but you can see that the "Sub-tasks" tab is still visible on tasks if you enabled sub-tasks.
	- Also, when re-enabling the feature globally, it should be disabled for the fsm project, but won't be.

Expected behavior
-----------------

The feature should be disabled on all projects, including fsm ones, when disabling it globally

---

This commit fixes this bug by selecting all projects, and not just basic ones,
when disabling a basic feature globally, to disable that feature on all projects.

Related: https://github.com/odoo/enterprise/pull/28036

Task-2871448

closes odoo/odoo#93820

X-original-commit: 84f8957533e85672d3b17d1a9004193b091f9fea
Related: odoo/enterprise#28488
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Larcin Vincent (vila) <vila@odoo.com>
2022-06-16 17:27:16 +02:00
Prakash Prajapati afe41c4e88 [IMP] project: always assign current user to private task
This commit ensures that, when creating a private task, the current user
is always part of the assignees.

This commit also adds tests on the different `project.task` creation scenari
to ensure it gets not broken in the future.

task-2818486

closes odoo/odoo#89041

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-15 19:17:01 +02:00
Prakash Prajapati 47f453c1d4 [IMP] project: prevent assigning non-personal stages to private tasks
Before this commit, it was possible to assign a non-personal stage on a private task,
which is a nonsense as the task does not belong to a project. Only personal stages
should be set to a private task.

After this commit, if a non-personal stage is set on a private task, a UserError is raised.

task-2818486

Part-of: odoo/odoo#89041
2022-06-15 19:17:00 +02:00
Florian Charlier dae28c4b46 [IMP] base: add _is_internal method to res.users
No method was readily available to know if a user is `internal` (has
group `base.group_user`), which was inconsistent with other base groups.

_is_internal is now used in the codebase where it is clear that
`.has_group('base.group_user')` is called on a single record.

Part-of: odoo/odoo#85703
2022-06-14 09:35:57 +02:00
Thibault Francois a84f6965ee [FIX] project: Fix random access error on task creation with public
Use case:
---------

Create a task with public user

At the end of the transaction sometimes the flush
is done with an env where su is False.

This cause the public user enable to read data needed
for the recomputation of is_closed field which is related_sudo=False

Why is this random ?
--------------------
The flush in transaction select the first env in the set of
env with a user. Since the order in the set is not deterministic
Sometimes an env with su=True is choosen and everything is fine
but sometimes it's not and we get an access error

It happened in 3 acts

this commit f98470e6cf add
related_sudo=False for perf improvement pre v13.0

this commit 42c430a539 introduce
a new related field is_closed that copy paste the related_sudo=False

this commit cf8bb933ac3a9fd6344ca79617a2f7317fbc20af stored the field
and stored computed field should always be compute_sudo=True

Solution
--------
Remove all the related_sudo=False, they don't make sense since v13.0

closes odoo/odoo#93349

X-original-commit: e0fe5c5a1c6932f02ca0822c5c26618c91fd50b3
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Thibault Francois <tfr@odoo.com>
2022-06-10 19:46:41 +02:00
Vincent Larcin 26cbec91cd [IMP] project: rework documents management
This commit gives a name to the Analytics section in the settings
to allow us to change its name easily with an xpath.

It also extracts the attachments domain in tasks so that it can be
overriden in documents_project to exclude attachements linked
to a document.

Related: https://github.com/odoo/enterprise/pull/26696
Related: https://github.com/odoo/upgrade/pull/3557

Task-2802803

Part-of: odoo/odoo#92044
2022-06-03 16:40:49 +02:00
Raouf 83760b9f10 [IMP] project: improve ux
Before this committ:
- Stats buttons were hidden when records are zero
- Some wordings were insignificant
- Existing filters don't allow us to check blocked, blocking and tasks soon in overtime and some other information
- Product form fields need some changes in their order

After this commit:
- All stats button are displayed when records are zero
- Wordings fixed
- New filters added to check blocked, blocking tasks and tasks in overtime soon
- Fields were rearanged

task-2726465

closes odoo/odoo#82253

Related: odoo/enterprise#23257
Related: odoo/upgrade#3185
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-02 18:58:14 +02:00
Xavier BOL (xbo) 3f263f1eae [IMP] project: display milestone field in the tasks in Project Sharing
Before this commit, the external collaborator cannot see in which
milestone the tasks in the project are linked in the Project Sharing
feature.

This commit adds the milestone field in the Project Sharing to show the
milestone linked to a task in the project shared.

task-2829542
2022-05-31 10:29:09 +02:00
Xavier BOL (xbo) e058472d21 [IMP] project: display wizard to reach milestone if all tasks linked are done
Before this commit, when the user changes the stage of a task linked to
a milestone, he cannot know if after that task, there is another one
before reaching the milestone related.

This commit displays a wizard to allow the current user to directly
mark as reached the milestone when the user changes the stage of a
task linked to a milestone to a closed stage and all tasks linked to
that milestone are done too. However, if the milestone is already
reached, no wizard will be displayed.

task-2829542
2022-05-31 10:29:08 +02:00
Xavier BOL (xbo) 41b72e0398 [IMP] project: display in green milestone if all tasks linked are done
Before this commit, when all tasks linked to the milestone are done, it
means all tasks are in a closed stage. Then, the user has no visual
feedback to know if all tasks linked to the milestone are done to be
sure he can mark the milestone has reached without missing a task to
complete.

This commit checks if all tasks of unreached milestones shown in the
project update are done or not. If it is the case the milestone is
greened to show to the user that milestone can be marked as reached.

task-2829542
2022-05-31 10:29:08 +02:00
Xavier BOL (xbo) d128a7683b [IMP] project: add 'Late Milestone' filter in tasks
Before this commit, the milestone is displayed in red in project update
when its deadline is in the past. To display the tasks containing a late
milestone, a filter need to be added.

This commit adds this filter to display the tasks containing a milestone
with a deadline in the past. This filter is also added in the `Tasks
Analysis` and the `Burndown Chart` reports.

task-2829542
2022-05-31 10:29:08 +02:00
Xavier BOL (xbo) a118555a40 [IMP] project: link milestone to task
Before this commit, the milestones are only linked to a project without
any link to the tasks of the same project. However, the tasks could be
considered as steps to reach a project milestone.

This commit adds a link between the `project.task` and
`project.milestone` models. This link is added in the `project.task`
model with the Many2One field called `milestone_id`. With this field,
the user will be able to link a milestone to a task.

task-2829542
2022-05-31 10:29:08 +02:00
Manisha Tulsiyani d2daaf95b4 [FIX] project: fix the traceback when clicking on blocking stat button
Currently, clicking on the blocking stat button throws an error when
there is more the 1 task in blocking stat.

So this commit, fixes the issue by removing the extra comma so that
clicking on blocking stat button doesn't throws an error.

task-2834743

closes odoo/odoo#92257

X-original-commit: cd7b7b02523e0982366f4ca60b6df2448d7e9cb5
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-25 14:38:11 +02:00
William Braeckman 46efe7df1b [IMP] project: allow modification of personal stages
This commit allows project users to create and modify their own personal
stages.
A lot of overrides have been done on the kanban view to handle our
multiple cases.

Project user will now only see the options to create columns/edit stages
when grouping by personal stage.
This is hardcoded and does not follow possible custom access rules
however.

Any stage created while grouping by personal stage will directly be
assigned to the user and will be seen in the 'My Tasks' menu.

A special method has been added to delete a personal stage.
Upon deletion any task assigned to this personal stage will move to a
lower sequence stage if possible otherwise the next in line.

TaskId-2858445

closes odoo/odoo#92103

X-original-commit: 7b3acbc0b0c21ab106b1b34d9f5c8bc1ceb2fe58
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-23 18:36:14 +02:00
std-odoo 9c1cdd330e [IMP] mail: avoid email loops when Odoo reply automatically
Purpose
=======
In this commit, we will fix the loops that occur when you send an email
to an alias (to create a ticket e.g.). In that case Odoo can reply
"Your ticket has been created" and then the auto-replier of the user
can reply to this email and the loop occurs.

Specifications
==============
To solve this issues, we add 2 system parameters
- <mail.gateway.loop.minutes>, 120 minutes by default
- <mail.gateway.loop.threshold>, 20 by default

When an email is sent to an alias, we look on the last records created
<mail.gateway.loop.minutes> minutes ago. If we overcome the limit
<mail.gateway.loop.threshold> the email is ignored.

Alias creation detection
========================
To detect the number of records created by a specific email address we
use the `_primary_email` attribute set on the model.

Task-2294034

closes odoo/odoo#78597

Related: odoo/enterprise#21772
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-20 13:14:56 +02:00
Rohitkumar (roku) 4a8f31e25f [IMP] project,sale_timesheet: generic UX improvement for project
Purpose of this commit to improve generic usage of project
app.

So, in this commit done following changes:
  - change the placeholder of the name to 'e.g. Monthly review' in
    project_update_view_form
  - set the 'analytic account' of the project on the tasks by default
  - change the placeholder to 'e.g. Product Launch' in project_milestone_view_form
  - the 'cabinets' milestone should be linked to a milestone service,
    not a manual one so change data to milestone in demo data
  - rename the 'rating' stat button into 'last rating' in view_task_form2
  - set another employee than Mitchell for the 'customer care (prepaid hours)'
    SOL field in sale_service_demo_data
  - display a separator on the right of the stat button so remove unwanted
    properties in project_rightpanel.scss
  - add the 'name' field to the 'fields to export' when 'i want to update data'
    is set to true
  - remove the 'Getting Things Done (GTD)' example from kanban examples wizard
  - add a 'tasks due today' filter that should return tasks whose deadline falls on
    today's date in view_task_search_form

task-2809188

closes odoo/odoo#88271

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-19 18:06:09 +02:00
Manisha Tulsiyani 849c5e128b [FIX] project: fix tags filtering based project for mobile view
Before this commit, when we click on the tag field in mobile view
it will display all the tags because in mobile view it will open
the kanban view on click of m2m field so 'search_read' called
instead of '_name_search'.

So in this commit, fixes the issue by applying the same filter
domain in search_read.

task-2790019

closes odoo/odoo#91670

X-original-commit: f23089f1fc14852fdd67916d38881746b15ebd19
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-18 17:09:36 +02:00
kais-odoo 60faa91ab1 [IMP] project: add the creator of task as default follower on task
Before this commit, if user does not follow the project then
while creating the task the creator(current user) is not added as
a follower of the task.

So in this commit, add the user creator of a task as follower
by default, even if (s)he is not following the project.

task-2784885

closes odoo/odoo#91170

X-original-commit: bc62557cc3bdcf792f6d3e19d0f0c87e34057f00
Related: odoo/enterprise#27234
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-12 13:43:26 +02:00
Vincent Larcin 9daa5c023d [IMP] project: add project.project calendar and activity views
This commit adds new calendar and activity views for projects.

Task-2741733

closes odoo/odoo#86008

Related: odoo/enterprise#25080
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-05 15:14:35 +02:00
Vincent Larcin 689ebe4a1c [IMP] project: link private tasks to personal stages in form view
This commits adds a status bar with the user's personal stages
in a private task form view.

Task-2741733

Part-of: odoo/odoo#86008
2022-05-05 15:14:34 +02:00
Vincent Larcin 483a4358a8 [IMP] project: move rating warning in task stage form view
This commit moves the 'Customer Ratings' warning to be right under the
Rating Email Template field in the task stages settings view.

It also slightly reorders other fields and fixes a typo.

Task-2741733

Part-of: odoo/odoo#86008
2022-05-05 15:14:33 +02:00
Vincent Larcin 1d2adbd8c9 [IMP] project: add project color in task calendar filter
This commit colors the project filter checkboxes on the right side panel
of the task calendar view with the color of the corresponding project.

It also changes the color of the events in the tasks in the calendar so it
uses the color in the project in the view "All Tasks", and the color of
the tasks in a calendar view of a specific project.

Finally, it adds some colors to tasks in demo data to better showcase
that feature.

Task-2741733

Part-of: odoo/odoo#86008
2022-05-05 15:14:32 +02:00
Kartik Chavda c0da9d934c [IMP] (sale_,)project,hr_timesheet: improve generic ux of project
Purpose of this commit to improve generic usage of project
app.

So, in this commit done following changes:

- add 'my department' filter in project search view.
- add 'my department's tasks' and 'my department's projects filter
  in task search view.
- add quick search, filter and groupby in task analysis report search view
  to make task analysis report search view same as task's search view.
- improve portal template of my/tasks page.
- project.task form view > timesheets: display the employee avatar
  on mobile.
- make 'Task: Rating Request' template auto_delete false.
- settings: make following features disabled by default: sub-tasks,
  task dependencies, recurring tasks.
- project.update kanban list: align the stat buttons with the kanban
  list cards.
- add sample data to the project stages > list view.
- project.task quickcreate: enable the creation of new users on the
  fly.
- move tags quick search below project.
- add title to show  project full name on hover of project name in kanban
  view of project.
- copy user_ids for task in recurrence.
- improve UI visibility of planned_hours and subtask_planned_hours field in
  timesheet page of task form view.
- improve project sharing wizard and project.collaborator tree
  view.
- add grid,kanban,pivot and graph views to 'hours spent on
  sub-tasks' button's action.

closes: #83482
task-2742725

Related: odoo/enterprise#23788
Related: odoo/upgrade#3480
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-03 17:53:45 +02:00
Florian Damhaut bbfb8cb099 [FIX] project: Copy task dependency on project copy
Step to reproduce:
- Create a project with 2 task A and B
- Set task A blocked by task B
- Duplicate Project

Current behaviour:
- Duplicate project is also blocked by original project's task
- Original project's tasks are blocked by new duplicate project's
 task

Behaviour after PR:
- Original project's tasks are not changed
- Duplicate project's tasks are blocked by duplicate project's task
 if they were blocked by the original project.
- Tasks are still blocked by tasks not linked to the original
 project

opw-2818476

closes odoo/odoo#90256

X-original-commit: 5c184628b2278814d2b28366587c8e4b813d0374
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-04-30 11:43:52 +02:00
Adesh Jolhe (adjo) 92de5d9502 [IMP] project: fix the rating visibility on kanban,list,form views
Before this commit, the rating feature is visible in some
`project.task` views even if the customer rating field is
disabled on the project related.

Unexpected behavior when the feature is disabled on the project:

  - the rating column field is visible in project.task list view
  - the rating icon is visible in project.task kanban and form view

This commit fixes the rating icon and rating field visibility by adding
a condition to check if the feature is enabled on the project.

task-2762166

closes odoo/odoo#86103

Related: odoo/enterprise#25129
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-04-26 13:25:06 +02:00
Cedric Prieels (cpr) 75c4468b9a [IMP] project: rename starred field and other generic improvements
- The starred field was renamed as priority.
- The assigned date is now set back to False when the user is unassigned from the task
- An action helper was added to the collaborators view
- The year mode was added to the calendar view of tasks

task-2802506

closes odoo/odoo#87139

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-04-25 14:42:04 +02:00
Kartik Chavda 43644341a6 [FIX] project,sale_project: fix action of milestone stat button
This commit fix button action of milestone stat button.

task-2784776

closes odoo/odoo#89326

X-original-commit: 70f67d8ca012ccc7980a2cc8da1c2fea1fd15678
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-04-22 19:57:46 +02:00
Laurent Stukkens (LTU) 892a0d6aaa [FIX] project: rename Ancestor into Ancestor Task
This commit change the ancertor_id field string to `Ancestor Task`

closes odoo/odoo#89461

Signed-off-by: Xavier <xbo@odoo.com>
2022-04-22 17:00:07 +02:00
Kartik Chavda d67e1e4b8f [FIX] project: fix rating stat button UX in project update
before this commit,
in project update right side panel view rating stat button's icon is
static it does not update depending on rating percentage and percentage
not showing properly.

This commit display rating average percentage in project update right
side panel view's rating stat button instead of just displaying
rating_avg_percentange field's value and rating stat button's icon will
update depending on rating percentage.

task-2758779

closes odoo/odoo#89209

X-original-commit: 549e1750cf51f27befe6278a71250cca0c720139
Related: odoo/enterprise#26423
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-04-21 11:34:04 +02:00
Kartik Chavda fd3a334637 [IMP] hr_timesheet, **: improve generic ux for timesheet
** = hr_timesheet_attendance,project_timesheet_holiday,
sale_timesheet

Purpose of this commit to improve generic usage of
timesheet app.

So, in this commit done following change:

- change no content helper for reporting menu actions.
- change no content helper for attendance report menu action.
- make timesheet editable in batch.
- add suspicious duration filter in timesheet search view.
- add analytic tags in timesheet views only visible when analytic
  tag feature enable from accounting settings.
- remove group group_no_one from section_leaves div.
- remov group group_no_one from timesheet group in leave type
  form view.
- improve search view.
- remove form view reference from project_id of timesheet.
- add a condition for decoration danger in o2m tree view for
  timesheet_ids in project form view.

task-2725525

closes odoo/odoo#82305

Related: odoo/upgrade#3355
Related: odoo/enterprise#23284
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-04-19 16:39:53 +02:00
Xavier BOL (xbo) 8e0ef46e32 [FIX] project: fix duplication of project containing subtasks
Before this commit, when the user duplicates a project with subtasks the
subtasks are duplicating twice. This is because we now duplicate the
subtasks when a task is duplicated.

This commit fixes this issue to duplicate once the subtasks when the
project is duplicated.

Steps to reproduce:
==================
1) Create a project A
2) Create a task T with a subtask
3) Duplicate the project A

Expected Behaviour:
==================
The duplicated project should have 2 tasks (subtasks included)

Actual Behaviour:
================
The duplicated project has 3 tasks (subtasks included), the subtask is
duplicated twice.

This bug has been found during the development of task-2726465

Related PR: #86997

closes odoo/odoo#88264

X-original-commit: dcf780026bfa7d76a58aa766b8d190022818ce45
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-04-08 14:48:42 +02:00
Thibault Delavallée 05c7e84239 [IMP] rating: make methods private
Purpose is to lessen access to internal methods and make them private. No
need to expose internal computation.

Task-2812665 (Rating: Cleanup rating flow code)

Part-of: odoo/odoo#80707
2022-04-04 17:48:23 +02:00
Thibault Delavallée cce67a0a4d [REF] rating, various: cleanup rating from routes
PURPOSE

Cleanup code and flow of customer rating: routes, rating_apply, rating and
message creation and update.

SPECIFICATIONS

Cleanup code about rating controllers and rating_apply. Notably correctly
link a message to a rating once a feedback is posted, whatever the flow.

Update ``rating_apply`` to use either a token, either an existing rating to
udpate it and post a message. Always link the message and the rating to
be sure DB data are coherent.

This requires an update in several demo data to correctly set tokens on
ratings and use it in calls to ``rating_apply`` done in xml files.

Extract default subtype computation of rating_apply in a sub-method to allow
setting this parameter without having to deal with ``rating_apply`` details.

CODE CLEANUP

Split behavior that is generic but actually used only in project about stage
update based on rating. Move it directly in project. As it is used only once
and as generic approach is hardcoded based on fields names better keep it
localized.

Task-2812665 (Rating: Cleanup rating flow code)

Part-of: odoo/odoo#80707
2022-04-04 17:48:23 +02:00
Xavier BOL (xbo) e26bdb3282 [IMP] project,*: sort the row displayed in profitability section
Before this commit, the order of rows shown in costs and revenues is not
fixed and depends on the order of the modules.

This commit adds a sequence on each row and then sort the rows to fix
the order of those rows.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 31b2ddc42f [IMP] project*,sale_timesheet: add profitability label
Before this commit, the label is giving with the data computed for the
project profitability.

This commit separes the label with the data to avoid translating many
times the same things.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 4d20d315e9 [IMP] project: get action for profitability sections
This commit adds a generic method for all sections in the project
profitability to get the correct action based on the which section the
user clicks. Moreover, a new parameter is added into
`_get_profitability_items` method to add the action data in the
profitability items or not. This parameter will be useful for the unit
tests.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 812940237d [IMP] project,*: filter AAL to avoid compute many times in profitability 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 3e721c28c4 [IMP] project: add format monetary in project update components 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) f13568c809 [IMP] project: review project profitability in right side panel
This commit reviews the project profitability displayed in right side
panel of project update kanban view. The goal of this commit is to add
more information to allow the user to see all information concerning the
profitability of his project.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 80bf615bbb [REM] project_*,{hr,sale}_timesheet: remove some stat buttons in project update
This commit removes stat buttons displayed in the right side panel in
project update kanban view to prepare the revamp of the content
shown in that project update. Indeed, the content in the right side
panel will show the information shown in those stat buttons but with more
details.

task-2710808
2022-04-01 15:32:59 +02:00
Gorash 880954ebfc [IMP] *: remove _render from ir.ui.view and simplify report
There were inconsistencies in the calls to `_render`.
* the view context could contain information that misled developers.
Indeed, the context and value of the view are not supposed to be found
in the rendering. Thus by calling `ir.qweb` with the name of the
template, we ensure that there is no unwanted information and in
addition the cache key is that of the name of the template which saves
a query.
* the context used for rendering was modified by a method on
`ir.ui.view`, except this is not information used by this model. There
is now a `_prepare_environment` method residing on `ir.qweb`. This
method allows to modify the value dictionary as well as the context in
which the rendering will be done. This preparation of the data as well
as my security check is done only once per rendering. This also saves
some queries
* Freeze options for rendering were inconsistent. It could be that
options on which rendering depends were not part of the cache key. Thus,
depending on the user who generated the generation of the rendering
function, there was or was not information in the template. For example
for automatic branding. This is no longer possible, because it is the
context that is used. The options serving as a cache key are only
recorded for information (for the profiling system for example). A
simplification of the `ir.qweb.field` models could be made.

The report rendering and call `ir.qweb` instead of `ir.ui.view`.

Part-of: odoo/odoo#85110
2022-03-29 10:56:15 +02:00
Ivan Yelizariev 2f1bd13274 [FIX] project: make custom fields copiable again
Since #73341 copy_data is filtered to avoid leaking information to portal user.
Partically, it makes custom field not copiable.

Fix it by disabling the filter for internal users. This may lead to a problem
with hacky field `personal_stage_type_ids`. To avoid extra complexity in the
code, just mark it as `copy=False`. The latter change is kind of an improvement
from functional point of view, since using default personal stage seems to be a
better idea rather than copying the stage.

---

opw-2746922

closes odoo/odoo#87064

X-original-commit: 9947e82c5c25cde030aca43f7eb6fe1293300329
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-03-23 19:25:12 +01:00
Cedric PrieelsandPriyanka Kakadiya aa24c3a757 [IMP] *: improve report security
* hr_timesheet_{attendance}, project, rating, sale_timesheet

- removed the 'admin' group on the reporting menu items so that 'users' can
  access these menus.
- 'timesheet / attendance' menu should only show if user has access for both
  the attendance and timesheet.
- Project/User should access 'Task Analysis' report And Added rule for user.
- customer ratings: only show ratings which has access of their project/task.
- ratings: user should not able to edit ratings.

task-2467564

closes odoo/odoo#82634

Related: odoo/enterprise#23439
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Co-authored-by: Priyanka Kakadiya <pka@odoo.com>
2022-03-16 16:07:00 +01:00