Commit Graph
99 Commits
Author SHA1 Message Date
William Braeckman 3d10c7c708 [IMP] project,*: improve project UX
* = hr_timesheet, sale_project, test_main_flows

Smaller changes:
 - Projects created on the fly (through `name_create`) will now come with a
   default `new` stage in order for them to not be empty.
 - Removed task auto assign upon creation besides in FSM's 'My tasks' menu.
 - Allow the reordering of projects without needing to group by
   anything.
 - Make `project.task`.`description` and `project.tags`.`name`
   translatable.
 - Disable the creation of records in the view when clicking on `Tasks
   in recurrence` stat button.
 - Track the planned date of the task in the chatter
 - Disable the creation of records in the view when clicking on
   'invoices' stat button and add the kanban view to that action.
 - Make milestones completely available to regular project users.
 - Remove the 'Documents' button in the project's kanban settings menu.
 - Add kanban, pivot and graph views to the 'Hours Recorded' stat button
   on projects
 - Add the calendar view on the 'Hours Forecast' stat button on projects
 - The 'Sales Orders' stat button on the `project.project`'s form view
   will now display the amount of sales order linked to the whole
   project. So the one linked to the project itself if it exists + all
   the tasks. It will also open them, form view if 1 else list view.
 - Fix a typo in the settings 'projets' => 'projects'
 - The analytic account  of the project will now be assigned to the
   sales order when a task is created through the 'Create a task in an
   existing project' option.

Changed the portal task view to include a sidebar similar to sales
orders, with a simple menu leading to different parts of the screen.

Changed the `project.task` 'rating' stat button:
 - The icon will now represent the latest review.
 - The action will directly lead to the record's form view if there is
   only 1 rating.
 - Make some fields readonly in the form view.
 - Display the % of satisfaction instead of the number of ratings.

Reorder all stat buttons on the `project.task` form view in this order:
 - Products, Worksheet, Sales Order(s), Invoices, Ratings, Hours
   Forecast, Parent Task, Tasks in recurrence, Tickets, Quotations and
   lastly Customer Preview

Make the status of the project editable directly through the kanban
view. A new widget has been added to handle that properly. When editing
the status through that means, a `project.update` will be created with
the current date and the appropriate status. In addition to that a new
status has been added (only on `project.task`, not `project.status`)
namely `to_define` in order to differentiate new and running projects.
Projects now start with the `to_define` status.

The `project.project`'s  rating stat button has been changed in the
following ways:
 - The icon will now change in function of the satisfaction percentage,
   smile above 66%, meh between 33% and 66% and frown below 33%.
 - The color will also change depending on the rate, smile is green, meh
   is orange and frown is red.
 - The ratings will now be in function of the last 30 days instead of
   all time and the action will also filter on those 30 days.
 - Change the action name from 'Rating' to 'Ratings'.

`project.project` ticket stat button:
 - Will now open the form view when there is only one record.
 - Added the activity view.
 - Disable the creation of new records.
 - Rename the action to 'Tickets'.

Closes: odoo/odoo#75269

See: odoo/enterprise#20334

Task ID: 2611006

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-28 15:27:36 +00:00
Laurent Stukkens (LTU) fd2a6c904d [IMP] project: add task dependencies in demo data
This commit adds task dependencies data in the demo data.

task-2647340
Related PR: odoo/enterprise#21391

closes odoo/odoo#79103

X-original-commit: d7c2a7eb5b6ee77772b0f104515125f3f31eb50d
Related: odoo/enterprise#21933
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-27 19:24:01 +00:00
Kartik Chavda 9e0621db01 [IMP] project: improve follow and unfollow functionality for project
Currently, unfollowing a project removes the user from all the tasks he was
following. Conversely, following a project or updating your notification
preferences makes the user a follower of all the tasks of the project without
distinction. These consequences are a bit extreme in case the user misclicked,
or simply decided he no longer wanted to be a follower of every newly created
task.

In this commit, when unfollowing a project should not remove the user from
the followers of all the tasks, and following a project should not add the user
to the followers of all the existing active tasks, neither should updating the
user's notification preferences But if the user explicitly update the user's
notification preferences for the project then its propagated to all the tasks
that the user is currently following.

closes odoo/odoo#67142

Task-id: 2440659
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-26 20:25:04 +00:00
Laurent Stukkens (LTU) 3384e4aee2 [IMP] project: add task dependency test
This commit adds a python test for the task dependencies.

task-2663173

closes odoo/odoo#78980

X-original-commit: a71862fb86e6eef801093add300c2668458aa964
Related: odoo/enterprise#21887
Signed-off-by: Xavier <xbo@odoo.com>
2021-10-26 19:40:46 +00:00
5652e7ee91 [FIX] project: Fix user_ids access issues on project sharing
Both developments 6c4910a and 7563b44 have been introduced nearly
at the same time in the saas-14.5 version, but the later one is
introducing a side effect that breaks the project sharing feature.

Indeed, before there was one assignee per task (user_id), and now
we can assign several collaborators (user_ids).

As the read on a M2O is just calling the name_get method, it wasn't
an issue.

Now, as it implies to read the res.users (and the res.partner) model,
the assigned users were filtered according to a specific ir.rule
for the portal users:

    <record id="res_partner_rule" model="ir.rule">
        <field name="name">openerp.portal.res.partner</field>
        <field name="model_id" ref="base.model_res_partner"/>
        <field name="groups" eval="[(6,0,[ref('group_openerp_portal')])]"/>
        <field name="domain_force">[('id','child_of',user.commercial_partner_id.id)]</field>
    </record>

This commit creates a new compute non-stored field called
`portal_user_names` to display the name of all assignees in each task in
the project sharing feature. Thus, the portal user can see all assignees
via this char field. The `user_ids` field is removed in the views of
project sharing since the portal cannot see all assignees with this
field.
By doing this, a collaborator cannot edit the field to assign or unassign
himself to a task. To keep this behaviour, two buttons are added in the
form view of task. One called 'Assign To Me', the current collaborator
will be able to assign himself to the task when he will click on this
button. The other button called 'Unassign Me' is to allow the
collaborator to unassign himself to the task.

part of task-2633229

closes odoo/odoo#78538

X-original-commit: 3b5a657df086b54def0bc0bdae89c19c89cb39f5
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2021-10-18 14:01:36 +00:00
Thibault Libioulle 2d15f586fd [IMP] project: add test on recurring subtasks
This commit adds a test in order to strengthen the behaviour of
recurring subtasks.

This test asserts that child with depth > 3 are not copied in a
recurrence, that recurrent subtask are well copied with the recurrence
correctly set.

This commit prepares the recurrence refactoring.

task-2660756

closes odoo/odoo#77632

Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-10-04 09:16:13 +00:00
Thibault Libioulle 3b426db10a [REV] project: re-allow recurring sub tasks
With the modification introducted in the PR #62577, create recurring
subtask was no more allowed.

This commits reverts this limitation and adds tests to verify this
behaviour.

PR : #77126

task-2522076

X-original-commit: f6b12588757bd7f2d7802264fc7cd1aaae4c6c57
2021-09-24 20:23:49 +02:00
Xavier BOL (xbo) edd25f3261 [IMP] project: add tour js for project sharing feature
This commit adds an unit test to start a tour with an internal user
connected to test the project sharing feature. Another test is
created to start a tour with a portal user connected to test the
project sharing feature.

part of task-2633229

closes odoo/odoo#76906

X-original-commit: db7825efb1b5cc052ecc795f9c81db5f3f58a5d3
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-09-22 05:41:16 +00: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
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
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) 768c63b15e [IMP] project: add unit test for project sharing feature
task-2379518

closes #73341
2021-08-26 14:59:33 +02: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
f6ab481ad9 [FIX] project: improve performance of burndown chart report
Before this commit, for the db with old active tasks and many
projects and tasks. The report takes several hours to execute the sql view.
Because we take the create date of the oldest task as the begin date
of each generate_series to calculate the different group bys (day, week,
month, quarter and year) until CURRENT_DATE.

This commit hugely improves the performance of the sql view execution
for the burndown chart report.

closes odoo/odoo#72664

X-original-commit: 89726a22862cf14f7b88e130fb79ddc74bffff5e
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Co-authored-by: Nicolas Seinlet (NSE) <nse@openerp.com>
Co-authored-by: Thibault Libioulle (TLE) <tle@odoo.com>
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
2021-06-24 07:22:52 +00:00
Thibault Libioulle 0953b6a839 [IMP] project: add project updates tests
This commit adds project update tests.

PR : #68899

task-2393768
2021-06-01 15:08:42 +02:00
Yannick TivisseandXavier BOL 29bdb04421 [IMP] project: Improve task's partner_id management
Purpose
=======

During the development of the task #2169100, it appeared that the synchronisation
of a task's partner_id according to its project's partner_id and its parent's
partner_id was not very clear.

A first idea was to simplify the partner_id management: as it could be annoying
for the customer to see all the task's partner_id overriden after project's
partner_id modification, the idea was to just use the parent's parnter_id or the
project's partner_id as default value of the task's partner_id. Then, if the
partner_id of the project or of the parent is changed, there is no more impact
on the task partner_id itself.

The main problem of this solution is that the management of the task's partner_id
is also extended in several others modules like sale_project and sale_timesheet.

You can find below what seems to happen with all these task partners.

Start following rules according to which module is installed.
(for the record: sale_timesheet depends on sale_project which depends on project).

Rules are applied in the order they are written.

Rules labelled "O" only apply when changing the project through the task form view.
Rules labelled "C" apply everywhere.

technical: C=compute, O=onchange

project
C.1 If parent's partner changes and the partner is not set, then set the parent's
    partner
C.2 Else if project's partner changes ant the partner is not set, then set the
    project's partner

sale_project [+ project]
C.1 If the project's sale order line's partner changes and the partner is not set,
    then set the project's sale order line's partner
C.2 Else apply (project.C) rules

sale_timesheet + [sale_project + project]
C.1 Apply (sale_project.C) rules
O.1 If the project is billed "At Project rate" or "At Employee Rate" and the
    partner is not set, then set the project's sale order's partner
    the sale order line's partner

Specification
=============

- If the partner changes, we ignore all current tasks and let them be. We set the
  new partner as default value on all new tasks. In detail, we have done
  this:
    - When the user creates a task give the customer of the default project or the
      task parent as default customer for the task.
    - When the user changes the project and no partner in the task, we take the
      partner of the new project (if this project has a customer).
    - When the user changes the customer of the project, the linked tasks are not
      impacted by this changes, even if some tasks have not a customer yet.
    - When the user changes the customerf of the parent task, the child tasks are
      not impacted by this changes, event if these tasks have not a customer yet.
- remove the onchange rule to remain consistent.

TaskID: 2232042

closes #51471

Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
2021-05-20 13:32:18 +02:00
Thibault Libioulle 64969cfccf [FIX] project: change default stage when changing project
Prior to this commit, the default stage didn't follow the value of the
display project id as the project_id was only updated after the write
call.

This commit makes the project_id to be updated after the display
project id changes.
This allows the default stage to be updated too once the onchange is
done.

Tests
---------------

This commit changes the behavior of a test making the use case more
smooth.
Previously, when a user removed both display project id and parent id
from a subtask, the project id was set to False. Now, if the display
project id is removed, the project id goes back to parent project, and
when the parent is set to False, it doesn't affect the display project.

PR: #50576

task-2522066

closes odoo/odoo#71029

X-original-commit: a908b9e8e6577bb7f8c8769db730c855fcad9504
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-05-19 11:31:18 +00:00
Thibault Libioulle bc86a101a8 [IMP] project: add tests for subtasks
This commit adds tests concerning PR #62577.

Tests also address errors in PR #68647 and #69170.

PR #70576

task-2388034
task-2522066

X-original-commit: b76e277f03c881ce6fd4d92fc8c8fb3e0ab704ea
2021-05-19 11:31:17 +00:00
ram c89e6587a9 [IMP] rating: update stored rating keys
Purpose is to lessen used storage space by shortening rating keys. See related
branches for more details.

Task ID-2439720
COM PR odoo/odoo#66992
ENT PR odoo/enterprise#16757
UPG PR odoo/upgrade#2302

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-26 14:10:20 +00:00
ram ddf7195ae3 [IMP] rating, project, im_livechat: improve handling of ratings
RATING

Rating texts currently have a negative skewness. Indeed apart top rating
all ratings have a negative feeling. In this commit we update them
to match more closely a 1-5 range from dissatisfied to satisfied, ok being
the middle value.

PROJECT

Filter customer rating were taking in account ratings from first e-mail
instead of current satisfaction.

IM LIVECHAT

Livechat did not catch feedbacks without comment.

Task ID-2439720
COM PR odoo/odoo#66992
ENT PR odoo/enterprise#16757
2021-04-26 14:10:20 +00:00
Thibault Libioulle b1f0e1a42a [REV] project: following a private project no longer required
This reverts commit odoo/odoo@7059b17.

This commit translates tests introduced in this reverted commit to be
aligned with the current workflow.

This commit reverts functionality or business logic linked to the
reverted commit :
- odoo/odoo#47248 : You no longer have to be an allowed user to see the
timesheets but only a message partner.
- odoo/odoo#49021 : We no longer deal with allowed_user_ids or
allowed_portal_user_ids
- odoo/odoo@f2a1a00 : We no longer deal with the allowed users lists.

This commit removes the button project_privacy_visibility for functional
reasons.

Closes: #65367
task-2439329

Related: odoo/upgrade#2128
Related: odoo/enterprise#16067
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-04-09 12:12:54 +00:00
Thibault Libioulle 8bbf0e9e64 [IMP] project*: improve sub tasks workflow
We want to ease user experience regarding sub task creation and
management. We thus enforce the values of subtask stage, project and
parent task. we want to remove the ability of a user to choose a
third-party subtask project different than the actual one. Also, we want
to remove the ability to make one sub task recurrent. In general, We
want to improve and strengthen the relation parent-childs for Tasks. A
sub task is dependant of its parent all along the workflow.

This commit address those needs and, especially, removes the subtask
project configuration discussed in :
- odoo/odoo@66a0e5a
- odoo/odoo@b709e22

1) With this commit we want to change the way to link a subtask with its
project	for UI reasons, we want to be able to easily distinguish
subtasks that are linked to the project of their parent from subtasks
that are linked to another project. To do so, the idea is to create a
field display_project_id not required. Only relevant tasks are linked
to their project through this display_project_id, the other are linked
to their project only via project_id. As a result, domains in the
application are only based on the fact that tasks have
display_project_id. The other are simply hidden.

2) The number of subtasks is shown on kanban and list views with a
   wigdet to easily render it and extend the UI.

3) The default sub-task assignee is the assignee of the parent task.

4) Task form is modified to integrate those changes.

5) Various searches on project task are restricted with a clause where
display_project_id must be not null. Except in portal, in which context
we always display all tasks and subtasks.

PR community: #62577
PR enterprise: odoo/enterprise#15043
PR upgrade: odoo/upgrade#1984

task-2388034

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-26 13:51:39 +00:00
YOGRAJ TANDELandMohammed Shekha 7da9c296eb [ADD] calendar,lunch,web: weekly recurrent widget
with this commit we adding weekly recurrent widget, currently proeject and
calendar shows boolean for each day vertically but with this widget we displays
week days and its boolean horizontally.

Here widget will display first day as per language's week_start field, also we
adds FieldDependencies on custom widget and consider those FieldDependencies
while processing view node in basic_view.js

We add support of registry to contain owl custom widgets and add support
of rendering owl custom widgets.

Also with this commit we removes fields like sun, mon, tue etc. from view and
instead use "web_weekly_recurrence" custom widget to display boolean for each
week day.

Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-03-26 12:25:44 +00:00
Odoo's Mergebot c975d128cc [MERGE] project: add task dependencies feature
Purpose
======

Sometimes, a task can only be completed once another is (e.g. 'install boiler' can only be done once 'order boiler' is complete). Communicating this information is key to organize a project and for the users to know on what they can start working when.

## Settings in Project App

- Add a 'Task Dependencies' setting under the 'Tasks Management' section
- Add the same setting on the project form view.
- As for the sub-tasks feature, enabling this feature in the settings of the app, should enable it on all existing and newly created projects with is_fsm = false.

## Task form view

- Add a 'Blocked by' notebook.
- In this notebook:
    - add new many2many field called *depend_on_ids* containing the tasks in which the current task depends on these tasks with the following fields displayed by default: name, user_id, date_deadline, stage_id.
    - add a 'view task' button on each line that should open the corresponding form view.
- Filter task list for depend_on_ids Many2many field.
- Check no cyclic task dependencies.

task-2387984

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#66740

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-26 11:08:10 +01:00
Xavier BOL (xbo) 63777d3c3f [IMP] project: check no cyclic task dependencies
Before this commit, if we have for instance 3 tasks called A, B and C
where A depends on B and B depends on A then we have a cyclic dependency.
Another example with the same tasks, we can have a cyclic dependency if
A depends on B, B depends on C and C depends on A.

This commit checks we have no cyclic dependencies when the user adds a
dependency on a task.

task-2387984

closes #66740
2021-03-12 14:15:36 +01:00
Xavier BOL (xbo) d2dadbcc3b [IMP] project: add task dependencies feature in project.task model
This commit adds two new fields in the project.task model.
The first one called 'allow_task_dependencies' is a related field to the
one project.project model. The other field called 'depend_on_ids' is a
Many2many field will contain the tasks which the current task depend on.

In the form view of project.task model, these fields are added.

task-2387984

closes #66740
2021-03-12 14:15:36 +01:00
Thibault Delavallée 7991118bfe [REF] mail, various: remove support of channels from message_subscribe API
RATIONALE

Channel model is a mail.thread enabled model behaving strangely with followers,
notifications and discuss. Its code should however be simplified to be more
self contained and avoid unwanted side effects on other models.

SPECIFICATIONS

Remove ``channel_ids`` argument and support from ``message_subscribe`` and
``message_unsubscribe`` API. Indeed we do not support adding channel-based
followers anymore. Only partners should be added or removed from followers.
It also allows to simplify API and understanding of both methods.

Various addons are updated to match the simplified (un)subscribe API. Some
enterprise addons may also be impacted.

LINKS

Task ID-2070632 (main task)
Task ID-2419762 (followup task)
COM PR odoo/odoo#62859
ENT PR odoo/enterprise#15172
UPG PR odoo/upgrade#2005
2021-03-17 18:16:11 +00:00
Victor Feyens bc2a8dd04d [FIX] project: fix infinite recurring tasks creation
for repeat_type = 'forever' recurrences.

Consider a recurrence creating a task every 15th day of the month.
When the cron runs, it updates the next recurrence dates of the
recurrence.

But currently, the updated "next_recurrence_date" can be set to an
earlier date than today, if the fixed day of the recurring task is
earlier than the current day.

This means that the recurring task to create every 15th of the month
will be created the 15, the 16, the 17, the 18, ... until the next month
begins (no task will be created when the cron runs before the 15th of a
month).

This commit enforces the next recurrence_date to be set after the
current cron run, to ensure a task isn't wrongly created multiple times.

This commit also includes the tests that led to the discovery of this
bug.

closes odoo/odoo#63989

X-original-commit: e4943afef0f66703bafd78780764ff6f0b039d3e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-01-04 10:19:30 +00:00
Victor Feyens 5fc28342a2 [FIX] project: fix infinite recurring tasks creation
For recurrences of repeat_type = 'after', the daily cron would create
tasks infinitely.

* The cron creates recurring task for all recurrences for which
next_recurrence_date < today.
* next_recurrence_date was never updated.

This commit ensures that next_recurrence_date is set to False for
repeat_type = 'after' recurrences, when the last recurrence is created.

X-original-commit: e7be857bea964628b80d4d3c1314dc231e0da947
2021-01-04 10:19:28 +00:00
Raphael Collet 1398b6b44c [IMP] tests: deprecate SavepointCase
closes odoo/odoo#62031

Related: odoo/enterprise#14872
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-11-24 13:23:32 +00:00
Martin Trigaux c59c10f1bc [FIX] *: correct typos and bad English
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61010

X-original-commit: 62a18bdb372e234107fd2099a2df5f9e3a442c96
Related: odoo/enterprise#14489
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 19:23:41 +00:00
Dominik RuboandKevin Baptiste a93f1e8d9b [IMP] project: enable config-selected features in projects
This change ensures that when the user activates optional features of the
project app, they are enabled in existing projects as well as newly created
projects automatically, which is likely what the user expects.

For most optional features, this behavior was already in place. It was not in
place yet for the sub-tasks and timesheets features, which this change fixes.

Two added tests check the behavior described above for features that are
activated through a `group_*` field on `res.config.settings` (sub-tasks,
recurring tasks and ratings). The tests do not cover features that are
activated through a `module_*` field, as such fields require the installation
of further modules and we cannot simulate this.

Task 2297054

closes odoo/odoo#60106

X-original-commit: 8dd0edae898a532dbe7e4f18c9118b9b68e57900
Related: odoo/enterprise#14119
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Kevin Baptiste <50135801+kba-odoo@users.noreply.github.com>
2020-10-15 14:18:30 +00:00
Kevin Baptiste 1b62bd9508 [IMP] project: add recurring tasks
Some interventions are done on a regular basis (e.g. maintenance of
fire alarms, safety inspections). Having tasks auto-generate would
facilitate the process and would ensure that the next intervention
isn't missed/forgotten.

closes odoo/odoo#55517

Taskid: 2172156
Related: odoo/enterprise#12246
Related: odoo/upgrade#1604
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-12 08:39:32 +00:00
Rémy Baranx (bar) 972e097dbe [IMP] project: convert onchange to stored-editable computed fields.
The 'stage_id' field is now a stored-editable computed field.

The 'company_id' has been converted to a stored-editable computed field.

The modification of the 'partner_id' field in the onchange method has been
moved and merged into the _compute_partner_id method.

Remove the empty 'onchange' method from the project.task model and also remove
this method call from the sale_timesheet module, which inherits from the project.task model.

Adapt the _compute_partner_id to retrieve exactly the behaviour before the onchange
method deletion.

Update code and tests of the task/subtask partner_id management after discussion with Alexandra to clarify the behavior.

Add the 'multi_edit' attribute to tree views.
2020-06-23 08:57:08 +00:00
Benjamin Frantzen (bfr) e4a4ffb974 [IMP] customer ratings flow improvements
- Rename the 'Use Rating on Project' feature into 'Customer Ratings'
- Rename the 'Set Email Template to Stages' link to 'Set a Rating Email Template on Stages'
- Add an optional list view for the Stages menu
- display warning if the rating_template_id field is set and if one of the selected project_ids doesn't have the rating_status field set to true
- Project form view revamp
- rename the '% on tasks' stat button into 'Customer Satisfaction'
- Remove the 'no option' for the rating frequency field because it is required
- project form : Add a 'Go to Website' stat button
- Project dashboard: remove the 'Customer Ratings' menu item in more
- Ratings page: the 'Last 30 days' filter include ratings from today
- remove the Appointment / Helpdesk Customer Satisfaction / Live Support menu items

TASK ID : 1251
2020-05-08 12:17:20 +00:00
Thibault Delavallée d53150dd6f [FIX] project: fix ACLs tests
Currently there are some issues wiht ACLs tests, notably transaction errors
due to new_test_user helper tool. Standard new_test_user tool allows to speedup
user creation in tests. It may cause issues if reset password is involved as
there is a savepoint done. Mail has an improved helper allowing to avoid that.

Also tests were actually not working due to cache being invalid. First fix
allowed to spot it and this is fixed now.

Followup of 7059b177ee .

Closes PR #49485

closes odoo/odoo#49504

X-original-commit: 2c766fa8b66c4e05d373ae550a2d43fa2500616c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-14 10:15:07 +00:00
Lucas Lefèvre 900f0175db [FIX] project: Allow multi company ir rule relaxion
If you want to de-activate the multi company ir.rule, those checks will
still raise an error.

Task 2198433

closes odoo/odoo#47291

X-original-commit: 12a81a3a5265cbd18f5c00ab439cd1486696521b
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-03-10 13:44:20 +00:00
Kevin BaptisteandYannick Tivisse 2ac06038dd [IMP] project, industry_fsm: Improve subtasks and configuration UX
Purpose
=======

In Project, the configuration has to be done twice: in the settings of the
app and on each project.

During the onboarding, the user won't understand that a feature has to be
enabled at both places and will think that the system just doesn't work.

If the user enabled a feature, he most likely intends on using it for most
of his projects. Therefore, having to do a double configuration for each
new project is annoying.

By the way, sub-tasks is the only global feature (it can't be enabled or
disabled by project), so we are breaking it down by project to remain
consistent with the rest.

Specification
=============

1/ Enable subtasks per project
Before this commit, sub-tasks were a global feature (i.e. once enabled
they were enabled for all projects). This commit gives the ability to
enable/disable sub-tasks per project.

2/ Make project_id on planning required

3/ Change default rating status on new projects

4/ Default value for allow_subtasks

5/ Enable timesheets on existing projects

6/ Hide Total Hours if subtasks are disabled

7/ Create project in the company context.
Otherwise some records generation could use a default company which is not
the company for which we want to create a project.

8/ Default value for allow_forecast, is_fsm

9/ Change reference to timesheet product

10/ Fix tracback on industry_fsm_report.
Before this commit, there was a traceback when enabling "Worksheets"
(industry_fsm_report) after "Time and Material" (industry_fsm_sale).

11/ Convert some onchange method into computed editable stored fields

closes odoo/odoo#41218

Taskid: 2146474
Related: odoo/enterprise#6998
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2020-01-31 15:35:54 +00:00
fw-bot fccaa703c4 [MERGE] project, hr_expense: Fix several multi-company issues + tests
Purpose
Fix multi-company access issues following the big changes that happened
(the 13.0). Make the usability better in order to avoid potential
multi-company issues for the user.

Specification
Check the related commits to see the different fixes that have been
made. For more information about the technical/functional considerations,
check the related task.

Taskid: 2088891
X-original-commit: 5c8df3a5e5f7960e5eab6439e0a32a06224ba826
2020-01-15 15:11:50 +01:00
Lucas Lefèvre 7059b177ee [IMP] project: Following a private project no longer required
=======
Purpose
=======

Currently for a user to be allowed to see a private project they must follow the
project. This means that they will be added as a follower of all new tasks in the
project which causes them to receive 1000000 notifications, especially if there are a
lot of tasks in a project.

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

1) Add an Employee m2m field on project next to 'Invited Employees'
    - only visible if the 'Invited Employees' option is selected
    - the project should only be visible to employees selected there (regardless if they
      are followers or not)
2) Add an Employee m2m field on tasks below the 'Email cc' one in debug mode
    - only visible if the 'Invited Employees' option is selected on the related project
    - should be pre-filled with what is set on the project
    - the task should be visible to employees selected there (regardless if they are
      followers or not)
3) Add a Portal users m2m field on project next to 'Portal users and all employees'
    - only visible if the 'Portal users and all employees' option is selected
    - the project should only be visible to portal users selected there (regardless if
      they are followers or not)
    - rename the option into 'Invited portal users and all employees'
4) Add a Portal users m2m field on tasks below the 'Email cc' one in debug mode
    - only visible if the 'Portal users and all employees' option is selected
    - should be pre-filled with what is set on the project
    - the task should be visible to portal users selected there (regardless if they are
      followers or not)
5) Following a project/task should not grant the user/employee the ability to see the
   project/task

Task 2031527

closes odoo/odoo#40505

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-14 16:26:32 +00:00
ryv-odoo c7a1a2d964 [REF] rating, various: improve rating.rating ACLs
PURPOSE

Rating model should be available only for internal users. External users
access them only through dedicated routes or controllers using sudo and/or
granting access through tokens. Therefore simplifying ACLs should be feasible.

SPECIFICATIONS

Remove access to rating.rating for public and portal users. Only employees
can access it, with full access given to system admins.

Update various functional flows to use sudo() and check that access is
verified before using sudo.

Impacted modules

  * rating / mail: add groups on some rating related fields as only
    internal users should access them now;
  * rating / mail: set some statistics fields using compute_sudo as their
    value should be accessible for external people even without access to
    the underlying rating.rating records;
  * project: makes some use of rating and has to be updated, notably for
    the public rating page;
  * website_{livechat, rating, slides}: add sudo in public routes as access
    is already granted;
  * website_slides: set statistics field using compute_sudo as their
    value should be accessible for external people;

TASK ID 2053096
PR #36592

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-19 15:46:51 +00:00
Yannick Tivisse bae2d9f717 [IMP] crm, product, ...: Clean some common test classes 2019-11-12 11:34:36 +00:00
Andrea Grazioso (agr-odoo) a128fb5b03 [FIX] project: can delete archived project with tasks
Create a Project with tasks, archive it, delete it.

The project is deleted, but this should not happen:
tasks are present, but they are hidden because when the project is
archived all its tasks are archived too (active flag is set to false).
On project unlinking only active tasks are checked, thus allowing the
deletion. Using a context flag to avoid filtering the non active tasks.

opw-2080515

closes odoo/odoo#38320

X-original-commit: 71a79f26e6319c6987397950c7f9df6c61dfb0d9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-10 06:28:20 +00:00
jem-odoo 0fdee29bb4 [IMP] project: multi company subtasks
This commit makes possible the task delegation in a multi company
environement. A subtask is a normal task with a parent, but can
now be in a different company, to be use as subcontracting task in
another company.
Tests are added to check multi company consistency for the project
app in general and for the subtask cases.

Task-1999686
2019-09-27 11:43:13 +00:00
Raphael Collet 9920f20e4c [IMP] models: ORM speedup
This branch is the combination of several optimizations in the ORM:

* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;

* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;

* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);

* make method `modified` take advantage of inverse fields to inverse
dependencies;

* filter records by evaluating a domain on records in Python;

* a computed field with `readonly=False` behaves like a normal field
with an onchange method;

* computed fields are computed in superuser mode by default.

Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.

closes odoo/odoo#35659

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-20 12:43:59 +00:00
Raphael Collet b7fd679a6c [FIX] *: sudo() -> with_user() 2019-07-04 11:32:22 +00:00
Sébastien Theys df7326f0be [IMP] tests, *: add start_tour helper
Before this commit, the syntax to start a tour was extremely verbose.
With this new method, it is possible to start a tour by just giving the
essential parameter: the tour name.
The full set of features from browser_js are kept by using **kwargs.

closes odoo/odoo#32316

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-04-04 08:44:59 +00:00