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.
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.
closesodoo/odoo#69636
Taskid: 2508642
Related: odoo/enterprise#17865
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
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
closesodoo/odoo#68146
Related: odoo/enterprise#17201
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
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
This commit fixes a regression introduced in #62577 .
Tasks are only taken into account iff their project_id is in self.ids.
closesodoo/odoo#69303
X-original-commit: 5be4970ddec2d9052d3b044e6e156aef94442c9a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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>
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
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 : #66740closesodoo/odoo#68652
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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
closesodoo/odoo#68647
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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>
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
closesodoo/odoo#66740
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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
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
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
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
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
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
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
closesodoo/odoo#66709
X-original-commit: 1c23eba5ab4dc4108ef6209ebc529ab363c3cc6b
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
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
closesodoo/odoo#66401
X-original-commit: b13fc817d150f642254c4738cfbd91ac2ecaa65f
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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
closesodoo/odoo#64767
X-original-commit: f29e9e5edbe08e1a356ceb7c2dbb2f60fb6d3ff5
X-original-pr: odoo/odoo#47336
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#64607
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The issue was triggered by the fact that editable fields are no longer
computed when they have a default value.
closesodoo/odoo#64503
X-original-commit: f047e0bdbcea2b707ecd24c6badbc3bfff0a71e9
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
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#61545Closesodoo/odoo#63292Closesodoo/enterprise#15585closesodoo/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>
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.
closesodoo/odoo#63989
X-original-commit: e4943afef0f66703bafd78780764ff6f0b039d3e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
You may want to use an analytic account for several projects of different companies, thus the correct way to proceed should be removing the company of the analytic account.
closesodoo/odoo#63172
X-original-commit: f1005e7624e84e6ee7ef467ae3bbccd16c59ce99
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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)
closesodoo/odoo#63055
Taskid: 2339894
X-original-commit: 46fd7d7979f25c5fe8fe36999186a10ffb6376dc
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Since commit 62024ca the portal customer of a task were missing the
"View Task" button.
closesodoo/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>
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
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.
closesodoo/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>
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
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
closesodoo/odoo#60189
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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.
closesodoo/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>
Unify the behavior for smart buttons on res.partner view form
Let's consider generic records R on a specific model M
- All the R of the children and archived children of a contact C must be counted in smart button of M
in the form of C
- Clicking on the smart button of a contact C must display all R of the children and archived
children of C
closesodoo/odoo#61241
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
- 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
closesodoo/odoo#60725
X-original-commit: 5ee045b2532ce97094dea2fe6b5e354585d67691
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#60230
X-original-commit: c961638d49a392468ac4a521bcb208dd9d68a99d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/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>
- 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
closesodoo/odoo#59733
X-original-commit: 64e93794efb4193b3dfa7aa43360a1ef274e623d
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
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
closesodoo/odoo#58634
X-original-commit: 45cd13e14fef0bab6921a1fff79335df9015cbf0
Related: odoo/enterprise#13613
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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.
closesodoo/odoo#57557
Taskid: 2326216
X-original-commit: 5b3804402b3ebee5abe7004b8f8caccadaabfe1e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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
closesodoo/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>
The commit 79132f6 allowed multiple level for the subtasks, but a
remnant from the ancient time was left.
closesodoo/odoo#56104
Taskid: 2317929
X-original-commit: ace68ceceb92f8d7c16155fd72acd469424accd0
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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.*
/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
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.
closesodoo/odoo#55517
Taskid: 2172156
Related: odoo/enterprise#12246
Related: odoo/upgrade#1604
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>