Commit Graph
337 Commits
Author SHA1 Message Date
Raphael Collet 34d6f87d54 [REF] core: put field.depends on registry and make field.recursive explicit
The attributes field.depends and field.depends_context are problematic
for sharing fields across registries, because they depend on the model's
registry class, which may vary from one registry to another.  In order
to make computed fields shareable, we have to move those values away
from fields.

For the same reason, field.recursive should not be inferred, because its
value may depend on the registry, although it is generally not the case.
Moreover, the flag recursive=True is set on a field when field triggers
are determined (on the registry).  A compute method may be called before
the flag is set (if no update has been done yet), and that can lead to
incorrect computations.

This happened in test TestUsers2.test_reified_groups in module 'base'.
The user groups view was apparently determined without the flag being
set, and the view depends on the recursive field 'trans_implied_ids',
which was not correctly computed.

We thus force developers to be explicit about recursive computed fields.
The code now logs a warning when the flag is not set up properly.
2021-05-03 12:33:29 +00:00
Barad Mahendra f93e054050 [IMP] project: generic UX improvement for project configuration
Purpose of the task is to do a generic UX improvement in project

Specification:
--------------

1) Stages(project.task.type)

* List view:
  - move the 'folded in kanban' field to the right of the project_ids one
  - remove the description field from the list view
  - make the list view editable in batch
* Form view
  - rename 'stage name' into 'name'
  - move the sequence field below the 'rating email template' one
  - change the copy of the tooltips to: "At each stage, employees can
block tasks or mark them as ready for the next step. You can customize
here the labels for each state."
  - the tags should be colored according to the project's color
  - reduce the space in between the icons and the name of the states
  - add some space in between the legend_done field and the description
  - when creating a new mail template, set 'project.task' as model_id
of the template
* move the 'Stages' menu into below the 'Projects' one
* add the project_ids field to the kanban view
* search: rename 'Tasks Stages' into 'Name'

2) Tags(project.tags):

- configuration > tags menu: change the helper to: "Tags are perfect
for categorizing your tasks."
- add an optional list view -> only the color field should be optional
and displayed by default
- new tags should be created at the top of the list

- Also removed some of the unused(deprecated) css which are not applied
anywhere in the project.

closes odoo/odoo#69636

Taskid: 2508642
Related: odoo/enterprise#17865
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-04-28 08:53:48 +00:00
Mitali Patel 95091a1d88 [IMP] (hr,sale)_timesheet, (sale_)project: generic improvements in view
Purpose of the commit is to do the generic improvement for the
refactoring of some module's view.

So in this commit, done the following changes:
- Reporting > Tasks Analysis , average progress of each task display correctly
- In project overview:
  - state button is fit correctly in report view
- In task quick create, added placeholder for name field
- In Product form view:
  - service_tarcking field: rename 'don't create task' into 'don't create a task'
  - display the share button if privacy_visibility should be portal
  - remove the 'Documents' stat button
- In Tasks list view, allow users to edit the stage of the task in batch if the project is in the context
- In project kanban view, remove the 'profitability' link and the corresponding stat button on sale.order

task-2458123

closes odoo/odoo#68146

Related: odoo/enterprise#17201
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-04-28 14:16:48 +00:00
Thibault Delavallée effebe148f [FW][FIX] mail, various: fix document access link computation
Purpose of this commit is to fix computation of access link. In some cases
msg_vals modification leads to invalid URL computation, notably for frontend
or backend differentiation for target recipients.

Followup of odoo/odoo#63292 .

Task ID-2513724
COM PR odoo/odoo#69607
ENT PR odoo/enterprise#17849

X-original-commit: e618597876692f2d24f8e9308c747b8d1f2d8905
2021-04-23 15:24:58 +00:00
Nicolas Seinlet b2a3471293 [FIX] project: fix count for task with NULL project_id
This commit fixes a regression introduced in #62577 .

Tasks are only taken into account iff their project_id is in self.ids.

closes odoo/odoo#69303

X-original-commit: 5be4970ddec2d9052d3b044e6e156aef94442c9a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-04-15 10:48:43 +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
Xavier BOL (xbo) 642fb2e6dd [IMP] project,{hr,sale}_timesheet: review dropdown in project kanban card
Before this commit, we add various buttons in the bottom of each card with a
certain condition, the problem is the lack of place to display more and
more information in each project kanban card.

This commit reviews the dropdown menus in each project kanban card.
Two sections is added one for another 'Views' to redirect to documents,
timesheets, sales order and planning, for instance. And the last section
for 'Reporting' like burndown chart.

task-2458017

closes #68343
2021-04-08 08:27:49 +02:00
Thibault Libioulle 9e3ca57dfc [FIX] project: keep create enabled in dependent task
Prior to this commit:

Once the user clicked on View Task in the "Blocked By" task list, the
Create button in the form view of the targetted task is hidden. Also,
in the subtask notebook the user is not able to create additionnal
subtasks.

Reason:

In the action, the create argument is set to False.

After this commit:

We merge the two action_open_task and action_open_task_form into a
unique one. We remove the create set to false.

Related PR : #66740

closes odoo/odoo#68652

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-04-01 14:10:39 +00:00
Thibault Libioulle b83dcc7231 [FIX] project: fix display_project_id initialization
Prior to this commit:

1) The display_project_id was not set if user created a task from the
form view.
2) The project_id followed the display_project_id once the
parent_id and display_project_id was modified and set to False

Reason:

1) The display_project_id was set to False in the vals and not overriden in
the create method.
2) The project_id always followed the display_project_id if the
display_project_id was modified.

After this commit:

1) The display_project_id follows the project_id if the task has no
parent_id.
The project_id follows the display_project_id if the task has a
display_project_id defined and a parent_id.
2) The display_project_id always follows its project_id if it has no
parent_id
The project_id always follows the display_project_id if set or the
parent_id.project_id if not and is changed only when the
display_project_id is modified.

task-2497080

closes odoo/odoo#68647

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-04-01 12:34:40 +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
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
Barad Mahendra a6ae6d8217 [IMP] project,web: generic improvement for project revamp
Purpose of the commit is to do the generic improvement for the
refactoring of project.

So in this commit, done the following changes:
 - move the date_deadline and the tag_ids field to the right column
 - remove the warning 'by saving this change, the customer email and phone
number will also be updated.'
 - track the priority field on task
 - move the deadline field above the fa-star and fa-clock-o icons
 - the name of archived tasks should be crossed out
 - project form add a 'deadline' field below the user_id one
 - project form remove the 'description' notebook
 - remove the 'project' field from the quickcreate of task.

Related Ent PR: odoo/enterprise#16559
TaskID: 2451287
2021-03-22 08:41:04 +00: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) 1c691c26a8 [IMP] project: filter task list for depend_on_ids Many2many field
Before this commit, we can add the same task as dependency or the tasks
in which the allow_task_dependencies is disabled.

This commit adds a domain to filter the task list when the user wants to
add a task as dependency.

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
Xavier BOL (xbo) 70d7f31d58 [IMP] project: add task dependencies feature in project settings
This commit brings a new feature for the Project App and project
configuration. This feature is called "Task Dependencies" and it allows
to the user to determine the order in which to perform tasks in a
project.

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
Goffin Simon 0cf682ca7e [FIX] project: Creating project via service product deletes contact's data
Steps to reproduce the bug:

- Let's consider a customer C1 with email address A1 and phone P1
- Let's consider a project PR with C1 as customer
- Let's consider a service product P with:
   - Milestones (manually set quantities on order) as Service Invoicing Policy
   - Create a new project but no task as service tracking
   - PR as project template
- Create a sale order SO with C2 as customer with A2 as email address and P2 as phone
- Confirm the SO

 Bug:

 The email address and phone of C2 were changed into A1 and P1 instead of keeping A2 and P2

 opw:2439459

closes odoo/odoo#66709

X-original-commit: 1c23eba5ab4dc4108ef6209ebc529ab363c3cc6b
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-02-23 14:59:13 +00:00
bit-odoo c2d20902f6 [FIX] project: filter when not required
Before this commit:

A method action_subtask is including the other actions context if have which
reflects while clicking on the Sub-tasks stat button. For examples:

- When click on the stat button 'Sub-tasks' of any task which one is clicked by
  systray activity icon results
- When click on the task menu in project there a default search filter 'My task'
  which also passes when click on 'sub tasks' stat button

After this commit:

Remove the context that startswith `search_default'.
Hence, now subtask will display with the correct context.

Task-2413127

closes odoo/odoo#66401

X-original-commit: b13fc817d150f642254c4738cfbd91ac2ecaa65f
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-17 16:51:41 +00:00
Xavier BOL (xbo) 8ba137edbc [IMP] project: rename the priority field to Starred in project.task
task-2440564
2021-02-01 13:48:00 +01:00
Priyanka kakadiya 37147dbde2 [FW][FIX] project: propagate internal subtypes to tasks
before this commit:

while changing subtypes of the project it was only
propagating those subtypes to the task, whose parent_id is set.
internal subtypes are not propagating in the task of a project.

So, filter internal subtypes and concat them with the subtypes which
have parent_id.

after this commit:
internal subtypes will also propagate to their tasks

closes odoo/odoo#64767

X-original-commit: f29e9e5edbe08e1a356ceb7c2dbb2f60fb6d3ff5
X-original-pr: odoo/odoo#47336
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-19 18:11:53 +00:00
Francois (fge) 568fe91341 [FIX] project: fix various bugs
Restore Project Kanban view for mobile.
Added a name for the default stage of the tasks in the Internal project
Removal of redundancy for the creation of the Internal project and its tasks
Fix task_reccurrence for the type 'after'. (too much task created or bad task created)

Task-2326258

closes odoo/odoo#64607

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-15 12:20:54 +00:00
Raphael Collet 7463b721d7 [FIX] project: remove dependency cycle in compute method
The issue was triggered by the fact that editable fields are no longer
computed when they have a default value.

closes odoo/odoo#64503

X-original-commit: f047e0bdbcea2b707ecd24c6badbc3bfff0a71e9
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-01-13 16:19:16 +00:00
Achraf (abz)andThibault Delavallée f5adb5b25d [FIX] mail: send notification mail with right access link when using mail.thread
PURPOSE

Notification may be sent using a generic mail.thread record, notably when
sending user notifications. In that case links to view document are
incorrect.

HOW TO REPRODUCE

Issue

    - Install "Approvals"
    - Submit new approval with you as "Request Owner"
    - Click on "View Approval Request" in your mailbox

    The link redirects to a 505 error

Cause

    The model is not the correct one and the res_id is undefined

Solution

    Specify the model and the res_id to _notify_get_action_link
    when creating the link with kwargs

SPECIFICATIONS

Propagate message value through various notification sub methods. That way
we can rely on them if model seems void.

Also limit values given as URL parameters to some white listed values.

LINKS

opw-2358846
Task ID-2379766
Followup of odoo/odoo#60998
Followup of odoo/odoo#61545
Closes odoo/odoo#63292
Closes odoo/enterprise#15585

closes odoo/odoo#64229

X-original-commit: 58bac5d242d6548d54f0163328fa64b319852e40
Related: odoo/enterprise#15634
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Achraf Ben Azzouz <abz@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2021-01-07 17:44:37 +00:00
Kamesh Patel 9a18bb89fe [FIX] project: Fix wrong recipient display based on email_from
Currently, The customer that is not selected anymore is suggested
as a recipient

steps to reproduce:
1. create a project task without a customer set
2. select a customer, then remove it, then save
3. send a message in the chatter
--> the customer that is not selected anymore is still suggested as
a recipient.
The issue is due to invalid value of partner's email in the field
email_from on task.

So in this commit, when the customer is not defined or is not a child
task then keep the email_From of the task.
(Here we are checking the task.parent_id because when someone update
the email_from on parent it should be updated in child task's
email_from and when we remove the email_From in parent it should not
be removed from child task)

closes odoo/odoo#63055

Taskid: 2339894
X-original-commit: 46fd7d7979f25c5fe8fe36999186a10ffb6376dc
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-08 17:13:53 +00:00
Kevin Baptiste 81430accb9 [FIX] project: show "View Task" to portal customers
Since commit 62024ca the portal customer of a task were missing the
"View Task" button.

closes odoo/odoo#63008

Taskid: 2393286
X-original-commit: 98c69f50d04f1a86ca62937eb2a4c5676a2b9cfe
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2020-12-08 11:32:27 +00:00
Adrian Torres 679185f3e8 [IMP] *: replace all raises inside unlink by api.ondelete
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
2020-12-04 09:16:16 +00:00
Kevin Baptiste 4f4c643a0b [FIX] project: don't send rating email when disabled on project
The rating emails were still sent even if the rating feature was
disabled on the specific project.

This commit ensures the emails are only sent to project with the feature
enabled.

closes odoo/odoo#62181

Taskid: 2390802
X-original-commit: 3fe5416f07e76ccca6c0bb05a6fa12d8e2ca0e6c
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2020-11-23 13:19:27 +00:00
Victor Feyens a4fd0ee84e [REM] project: remove duplicate python constraint
The constraint method _check_parent_id was defined twice.
This commit removes the second definition, less efficient because not using
_check_recursion correctly (it can be called on a recordset with multiple records directly).

Task Id: 2328664
COM PR: https://github.com/odoo/odoo/pull/55525
ENT PR: https://github.com/odoo/enterprise/pull/12250
2020-11-20 10:04:27 +00:00
Kevin Baptiste 32c7b1442e [IMP] project: stop recurrence on delete/archive task
closes odoo/odoo#57226

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-11-17 19:47:38 +00:00
Dominik Rubo 3e768c232f [FIX] project: fix language errors
This commit fixes various types of language errors in strings visible to the
user, including
- singular/plural mix-ups
- missing or incorrect punctuation
- missing or incorrect articles
- inconsistent use of title case and sentence case and other capitalization
  errors
- mixed-up words
- missing words
- incorrect prepositions
- missing or incorrect apostrophes

closes odoo/odoo#60189

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-11-17 17:19:30 +00:00
Martin Trigaux e433bc57ff [FIX] *: rephrase, correct typos
Courtesy of Transifex's translators for reporting bad/unclear sentences.

closes odoo/odoo#61804

X-original-commit: f5d0f4a1ebf406583889e9e04912d40c0693343e
Related: odoo/enterprise#14769
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-11-16 16:47:28 +00:00
Martin TrigauxandXavier Morel 49838338e0 [FIX] *: sanitize action content reading
The open_action_with_context was not using _for_xml_id, producing an
error when reading the action content.

In open_action, the action_name was taken from the context and needs
sanity checks. Ensure only actions from the account module can be
read and only if the user has access to the target model.
This is a limitation of the previous behaviour but, at the moment, all
known calls are made refering to an action from the account module.
Limit the scope of this method while the 14.0 is still early to avoid
having a door open to ready any action, and difficult to close later.

Remove old action fetching from the context in create_move that is no
longer used.

closes odoo/odoo#61602

X-original-commit: a39e94f7e4dc74e850650ac90bbc5f85af130bc8
Related: odoo/enterprise#14695
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Xavier Morel <xmo@odoo.com>
2020-11-10 16:04:29 +00:00
Nicolas Martinelli 227bd5d8bf [FIX] project: add follower as project user
- Create a user A with access rights to Project set as 'User'
- As user A, add a follower to a task

An AccessError is raised.

It happens because `allowed_user_ids` has the group
`project.group_project_manager`.

Since a Project User is allowed to set followers on a task, it is
legitimate to set the appropriate portal user as allowed.

opw-2369674

closes odoo/odoo#60725

X-original-commit: 5ee045b2532ce97094dea2fe6b5e354585d67691
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-26 11:01:58 +00:00
Nasreddin (bon) f224da276c [FIX] project: wrong subtask count
Issue

	- Install "Project" module
	- Active "Sub Task" feature in settings
	- Create a new project `X`
	- Go to settings of project `X` and activate "sub task" feature
	- Add a Task `A` in project `X`
	- Add a subtask `B` to task `A`
	- In menu, click on `Tasks` to list all tasks
	- Edit view and add `subtask_count` field then save

	Wrong value in `subtask_count` field.

Cause

	Retrieving childs of self instead of "current" task (`for task in self:`).

Solution

	Use "current" task instead of self.

opw-2361013

closes odoo/odoo#60230

X-original-commit: c961638d49a392468ac4a521bcb208dd9d68a99d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-19 07:45:47 +00:00
Jorge Pinna Puissant 811444829f [FIX] project: access token on task
- Create a new Project with 'Portal user and all employees' as
  visibility;
- Add a portal user as customer;
- Create a new task in the Project, without assigning the task to
  anybody;
- Connect to the portal as the portal user;
- Send a message on the task.

Before this commit, an Error 403 forbidden was raised, this error occurs
because the task don't have an access token created, this token will be
created when an internal user send a message on the task.

Now, the access token is created if the project has a 'Portal user and
all employees' visibility, and the portal user can post a message on
the task.

opw-2345070

closes odoo/odoo#59733

X-original-commit: 64e93794efb4193b3dfa7aa43360a1ef274e623d
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-10-12 11:00:37 +00:00
jdoutreloux b8d71b799d [FIX] project : fix issue with alias and display issue in portal
When the alias had been set, if the user wanted to disable it
he had to erase the email first. Otherwise unchecking the check box
didn't work.

Task-2299286

closes odoo/odoo#58634

X-original-commit: 45cd13e14fef0bab6921a1fff79335df9015cbf0
Related: odoo/enterprise#13613
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-28 10:57:13 +00:00
jbm-odoo 90b46ce3b2 [FIX] hr_timesheet: Widget for planned hours
Before this commit:
The field `planned_hours` and `subtask_planned_hours` are present
twice. This causes problems with widget: different widgets are put
on different fields, but only the last on was put on all of them.
Code to edit label with hours/days is not flexible, we need to
write each possibilities.

After this commit:
All fields are present only once in the view. A new widget is
created to manage days with a factor. In this new widget, instead
of having a toggle button, we can insert a float.
When the widget timesheet_uom is set on a field, we modify his string
with hours/days.

closes odoo/odoo#57557

Taskid: 2326216
X-original-commit: 5b3804402b3ebee5abe7004b8f8caccadaabfe1e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-11 15:00:33 +00:00
Victor Feyens c482fdbf05 [IMP] various: improve code style and performance by improve `all()` usage
PURPOSE

Clean code. Be more performance oriented.

SPECIFICATIONS

Improvements applied in this commit

  * not all() --> any(not) for earlier returns;
  * all([generator]) --> all(generator) to avoid unnecessary list casting.
    This code construct is better managed by all;

This commit will probably not have a big performance effect on standard
production databases. However each performance and cleaning improvement
is welcomed.

LINKS

Task ID-2328619

closes odoo/odoo#56810

X-original-commit: 1cc6bb1231401ea7f501d2f5b5e9641ec8734850
Related: odoo/enterprise#12802
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-08-31 13:59:27 +00:00
Kevin Baptiste 375bfc66c8 [FIX] project: remove constrains for multilevel subtasks
The commit 79132f6 allowed multiple level for the subtasks, but a
remnant from the ancient time was left.

closes odoo/odoo#56104

Taskid: 2317929
X-original-commit: ace68ceceb92f8d7c16155fd72acd469424accd0
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-19 08:38:57 +00:00
Arnaud Joset f2a1a00081 [IMP] hr_timesheet,pad_project,project,rating,sale_timesheet: back2basics project
Multiple UI and UX changes

taskid: 2299401
2020-08-13 13:25:22 +00:00
Martin Trigaux 6156f98288 [FIX] *: adapt action content retrieval
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.

Add sudo for other operations on ir.actions.*
2020-08-17 09:09:02 +00:00
Martin Trigaux d5c1649239 [IMP] base,web: _for_xml_id as a safe access point
/web/action/load is the public controller that Should be used by the
webclient to fetch actions
_for_xml_id is the default access method on actions that implements
fields filtering to avoid leaking server action code or other
information not needed by the webclient

Implementing whitelist of fields that can be access per model
2020-08-17 09:08:23 +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
Nisha patel e0a7add01f [FIX] project: Fix sub-tasks stat button count
Currently, In the project module, the archived/deleted sub-task is
not deducted from the count of the 'sub-tasks' stat button.

Steps to reproduce:
 - Go to Project > Configuration > Settings > Enable 'sub-tasks'
 - Go to a Project with sub-tasks enabled, open a task and create a sub-task
 - Archive/Delete this sub-task

So in this commit, we applied filter on sub-task which show only active
sub-task on the stat button.

closes odoo/odoo#55347

Taskid: 2304887
Closes: #54904
X-original-commit: 81db237e3324922ff16f2b290922f21d98046738
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-03 15:49:52 +00:00
Victor Feyens 5dc8b7bdd8 [IMP] *: replace default_get overrides by default attribute on fields.
Leave the generic management of fields default to the orm as much as
possible.

* Default method is not called unless necessary.
* Default values are correctly post-processed by the orm when necessary.
2020-07-23 16:38:17 +00:00
Toufik Ben Jaa 04a757d596 [FIX] project: allow non manger to duplicate tasks
- The field `allowed_user_ids` is only accessible to Project Manager.
  When trying to duplicate a task, an access right issue is raised
  if you are not project manager.
  This is due to the fact that when trying to duplicate this field is
  read.

  To avoid this issue, we specify that this field should be copied thus
  not be read.

closes odoo/odoo#54509

X-original-commit: 95dedd23cc7a7d66d7a7dc17b9f9ac4f5473e226
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2020-07-15 12:42:59 +00:00
snd cb26f1aabd [FIX] project - send rating mail by project
opws: 2269230, 2248760
When a database has a lot of projects with many tasks, and needs
to send a lot of feedback mails, the cron tries to send mails to
all tasks at the same time, thus it times out.

This fix will allow to treat projects one at a time so that when
the cron times out, it will not restart from the beginning.

closes odoo/odoo#53922

X-original-commit: 07c828b48741500573b4286480b23752a28163c7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-07-01 15:36:56 +00:00
Martin Trigaux 400cc4f14e [FIX] *: correct all or improve code translation lookup
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
  _("Foo %s", bar)

to progressively migrate the code to the new syntax.

A few calls were not technically incorrect but still detected by the
linter.

  _("Foo" +
    "Bar")

has been converted to

  _("Foo"
    "Bar")

as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).

closes odoo/odoo#53683

Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-06-30 10:19:59 +00:00
qho 1424a3839a [IMP] hr_timesheet: Improve the usability of timesheet portal
1. Generic timesheets improvements

    - Portal /my/timesheets
    - Add a group bys task, date, employee
    - Add search in project, name, employee, task
        * The task column should not be visible if none of the timesheets have the Task field set
    - If a group by task, date, employee or project is applied, the corresponding column should not be visible

2. Timesheets from sub-tasks on parent tasks

    - Portal /my/tasks
    - Display the 'Total Hours' spent on a task at the end of the list of timesheets
    - Below the list of timesheets for the task, display another table detailing the respective timesheets (and total hours) of each sub-task linked to this task (= 1 table/list per sub-task)
        * Title should be: 'Timesheets for sub-task: xyz'
        * only visible if there are sub-tasks linked to this task
        * only visible if total hours > 0

3. Timesheets on Invoices

    - Portal /my/invoices
    - Add Project + task fields
        * Task field only visible if set on one of the timesheet entries
        * Project field only visible if there are at least 2 different projects in these timesheet entries

4. Correct visibility for the portal users
    - Portal users is allowed to see timesheets if the users are added in allowed portal users list in the project
    - When a portal user is added as the message follower of the project, the user is added to allowed portal users as well
    - When a portal user is removed from allowed portal users, the user is also removed from message followers

closes odoo/odoo#47248

Taskid: 2201908
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-29 11:56:36 +00:00