Commit Graph
6723 Commits
Author SHA1 Message Date
Victor Piryns (pivi) ebfcdc95d2 [FIX] project: disable recurrence for all tasks linked to a recurrence
Current behaviour:
If you disable the recurrence for 1 task in a suite of recurrence,
if you had other tasks belonging to the same recurrence suite, they
would still be with recurrence activated.

Expected behaviour:
It doesn't make sense for some of the tasks in a suite of tasks in a
recurrence to enabled and others disabled. If we disable the
recurrence on 1 such tasks, all tasks should linked to that
recurrence should be set as non-recurrent, regardless if the
edit-mode is set on "This task".

Steps to reproduce:
- For 14.0 -> saas-16.1:
  - Install Project, Studio
  - Turn on in Settings the "Recurrent Tasks"
  - Create a new project and a task in it
  - With studio, in debug mode, add a related field to the task form
    that relates to `next_recurrence_date`. Make sure it's not "read
    only"
  - On the task, turn on the recurrence, set the frequency to each
    day, set the `next_recurrence_date` as a day in the past
  - Run the Scheduled Action "Project : Create Recurring Tasks"
  - On one of the task, disable the recurrence
  - Go to the other task, see that their recurrence is still active,
    and the frequency changed to the defaults values of once a week.
- For saas-16.2 -> master:
  - Install Project
  - Turn on in Settings the "Recurrent Tasks"
  - Create a new project and a task in it
  - Activate the recurrence on the task, set a planned date in the past
  - Set the task as "Done", this should create an new instance of the
    recurrence.
  - Disable the recurrence option in one of the task, observe that
    is doesn't change for the other task, and the recurrence
    frequency is reset to default values.

Reason for the problem:
When disabling the recurrence on 1 task, with the edit-mode set as
"This task", the recurrence is being deleted, but we don't disable
the recurrence of the other tasks linked to that recurrence.

Fix:
When we are writing `False` on `recurring_task` on a task, we
explicitely write `False` on `recurring_task` on all tasks that belong
to the recurrence after the deletion of the recurrence itself.

Affected versions:
- 14.0
- 15.0
- saas-15.2
- 16.0
- saas-16.1
- saas-16.2
- saas-16.3
- master

opw-3265212

closes odoo/odoo#128703

X-original-commit: 0a83f4030b07aba25b054aa453d81c0e27b98cc8
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-17 16:45:59 +02:00
Vincent Larcin 4b819e83ad [FIX] project: make tests demo data independent
The test `test_search_project_root_id` fails when demo data are not installed.
This commit makes it demo data independent.

Task-3410352

closes odoo/odoo#128514

X-original-commit: cf63d549c8592400af6d96bd145169bd3ac636fe
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-17 09:20:53 +02:00
Victor Piryns (pivi) 26069c08e3 [FIX] project: show results with archived assignees on tasks
Current behaviour:
When searching in `All Tasks` for tasks whos user is archived, no
results are returned.

Expected behaviour:
You should be able to see tasks of users that are possibly archived.

Steps to reproduce:
- Install Project
- Archive the user and contact Marc Demo
- Go to Project > All tasks
- Search for assignees "demo".
- No results

Reason for the problem:
The `user_ids` definition in the task is:
```xml
<field name="user_ids"
       filter_domain="[('user_ids', 'ilike', self), ('user_ids.active', 'in', [True, False])]"/>
```
But there is no context of the `active_test=False` on the view. So
the ORM for the `filter_domain` generates a query which contains 2
relevant `EXISTS` clauses, and for the leaf `('user_ids', 'ilike',
self)`, the generated `WHERE` clause is
```sql
("res_users"."active" = TRUE) AND ("res_users__partner_id"."name"::TEXT ILIKE '%demo%'))
```
where we can see the presence of the `active_test`, because we don't
disable it in the *view*.

Fix:
Change the domain on the user to check on the field `name`, with this
domain, the ORM will not add an active test on this part. This
essentially does the same as 7a366abb40
but there was a regression in b77f60b155.

Affected versions:
- saas-16.1
- saas-16.2
- saas-16.3
- master

opw-3383564

closes odoo/odoo#128471

X-original-commit: aa6aa636de0f9f0a43bb1f603ecebbcd26b94bbd
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-15 10:54:55 +02:00
Julien Carion (juca) 75481e2db0 [FIX] web: fix project calendar display name
This commit removes the displayName variable of the calendar controller
since it wasn't used anymore and the extension of the displayName is now
updated in the ProjectCalendarController instead. This fixes an issue in
project where the extension of the displayName in the project calendar
controller ( - Tasks by Deadline) would not be shown in the view.

opw-3410987

closes odoo/odoo#128461

X-original-commit: 120ab2513b487d0c117e5c67ed76e6d154d0243f
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-15 10:54:31 +02:00
Audric Onockx (auon) 69d6715491 [REF] project,hr_timesheet: reorganize project/src/js files
task-3300649

closes odoo/odoo#120668

Related: odoo/enterprise#40774
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-14 15:34:35 +02:00
Audric Onockx (auon) 09a90aa9ca [IMP] project,web: change groupby project label 'None' to 'Private'
Be consistent with the terminology used in all views,
'None' doesn't add value and makes the private task stage user-friendly.

Add filter "Private Tasks" to search private tasks easily.

task-3300649

Part-of: odoo/odoo#120668
2023-07-14 15:34:35 +02:00
Bastien (bvdn) db6b6880d6 [FIX] project: avoid traceback on View Task in project sharing + other small bugfix
This commit will fix the following bugs:
- prevents a traceback to appear when clicking on View Task button in sub-tasks tab
	when in project sharing
- adds a forgotten state display in the sub-tasks tab in project sharing
	(was missing)
- in the kanban card sub-tasks dropdown, only the sub-tasks without project should
	toggle from In Progress to Done (previously every subtask toggled)

Task-3280844

closes odoo/odoo#128385

X-original-commit: 928c8cc2ac83c5ac4a175848b1ac862e9b914daa
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-13 18:18:09 +02:00
Vincent Larcin caec298d21 [FIX] project: make tests demo data independent
The test `test_duplicate_project_duplicates_milestones_on_tasks` and the test class `TestSoLineMilestones`
fail when demo data are not installed.
This commit makes it demo data independent.

Task-3410352

closes odoo/odoo#128307

X-original-commit: 9193168d39a808d66e67ad8d5d704d72fdc5f3a0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-13 16:53:09 +02:00
Vincent Larcin 0b51310b5b [FIX] project: make tests demo data independent
The test `test_recurrent_tasks_fields` fails when demo data are not installed.
This commit makes it demo data independent.

Task-3410352

closes odoo/odoo#128296

X-original-commit: 985662758ad68dc2655bd12d883ae95b1e2f1220
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-13 16:53:04 +02:00
Prakash Prajapati a2cceb04f7 [IMP] project, *-: improve the project settings UI
-* = sale_timesheet, sale_project

Issue:
Currently, the fields and description are not appeared in the full width in the
project setting.

Technical description:
  Currently, the content does not appear in full row because col-lg-6 is given in the
  settings component. Other col-lg-6 is empty.So in this commit we have shown content in
  full row.

task-3183771

closes odoo/odoo#114405

Related: odoo/enterprise#37802
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-13 14:46:46 +02:00
Aman Patel 33413b0d32 [FIX] project: traceback on inviting collaborators
Steps:
- Open project.
- Configuration -> Projects.
- Click the collaborator's stat button.
- Invite Collaborators.

Issue:
- Traceback comes ''frozendict' object is not callable'

Cause:
- The _context object is being treated as a callable function instead of a
dictionary-like object.
Reference PR:  https://github.com/odoo/odoo/pull/119771

Fix:
- Adding .get() so that it ensures that the value of 'default_project_id' is
retrieved correctly from the _context object without treating it as a callable
function.

task-3422050

closes odoo/odoo#128246

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-13 07:18:46 +02:00
pash-odoo 93f365c000 [IMP] sale_timesheet,project: improved create project wizard
Before this commit when creating new project then in wizard form Billable is by
default checked and no placeholder is given for partner field in Billable.

This commit focuses on improvement in create project wizard by removing checked
by default from Billable so that user get simplified and less complex view of
tasks during the onboarding. Added a placeholder for partner field which help
user to understand the purpose of field and switched the position of Billable
and Timesheets. change test case according to new changes.

task-3377998

closes odoo/odoo#126010

Related: odoo/enterprise#43037
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-12 18:43:06 +02:00
arpr-odoo 6bc74c4b9f [IMP] project: remove edit button from kanban card
This commit focuses on enhancing the Kanban card
functionality by removing a redundant button. Previously,
users were already able to access the form view by
clicking directly on the Kanban card itself. However, the
presence of the redundant button caused potential
confusion and cluttered the interface. With this update,
we have improved the user experience by eliminating the
unnecessary button, allowing users to seamlessly access
the form view with a simple click on the card. This change
simplifies the workflow, removes redundant elements, and
contributes to a cleaner and more visually appealing user
interface. The aim is to optimize usability and improve
the overall aesthetic of the application.

closes odoo/odoo#125364

Task: 3369698
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-12 18:43:03 +02:00
Gurupreet Singh 9fdc834207 [FIX] project: fix search view issue in website for milestone in tasks
Before this commit if we go to website and choose tasks and if we search
anything it shows no tasks available and if we select milestone it shows table.

Steps:
- Go to website and select tasks and search anything in search bar.
- Showing  no tasks available
- choose milestone from drop-down and search anything it will show table labels.

Fix:
- Added condition for checking if milestone is passing empty record set  and
 added another condition to handle it

task-3183771

closes odoo/odoo#128204

X-original-commit: bcbfa314fb54039536b07446aa9c925378e68ab0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-12 09:15:03 +02:00
Alexandre Kühn 5e917281b2 [FIX] project: no big chatter in project portal task
Before this commit, the portal chatter of a project task
on an XXL screen was huge, making form view to shrink
extremely.

This happens because chatter is in `flex-grow: 1`, and assumes
form view also has a specific width to adapt chatter accordingly.
However, in portal chatter, the form view defines a width of 1px
... Therefore giving the room of chatter to take the whole width.

Apparently this rule was defined as a workaround for list view,
which has no chatter. Somehow this rule is affecting form view
in portal, but not in backend.

This commit fixes the issue by removing the `flex-grow: 1` rule
on chatter, so that it always has a fixed size of `530px`.
This is not necessarily the best fix, but at least the most
important content, the form view, is more visible.

closes odoo/odoo#128191

X-original-commit: 15a8200a83ad00760fed0e5c46140c8539ccd8f3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-12 09:15:00 +02:00
Victor Piryns (pivi) 0b72568bc3 [FIX] project: add index on project.task state
Adds missing index on `project.task` `state`, this field is used in
a lot of searches as a search criteria like "open tasks".

task-3416393

closes odoo/odoo#127841

X-original-commit: 147446d86d7d33a83f83a8699c930fcdd3dbb99b
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-07-10 08:56:30 +02:00
Thomas Lefebvre (thle) 2e06b0e1ce [FIX] project: correct default context
Issue:
------
When we want to add a newly-created user
who does not yet have "personal stages" to an fsm task,
it triggers a User Error.

Cause:
------
There's a mistake in the `project_id` field,
which is missing the 's'.
Therefore, when creating the personal stage,
the ORM does not find the value in the context
and inserts the command to set the default project.
As a result, when checking constraints,
we will trigger an error for the
`_check_personal_stage_not_linked_to_projects` method.

opw-3390169

closes odoo/odoo#127694

X-original-commit: 05722c9710f74a073833235de9bbe4743485174a
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-07-07 13:23:36 +02:00
Thomas Lefebvre (thle) c5e6ed536b [FIX] project: add default description with quick create
Steps to reproduce:
-------------------
- to be in debug mode;
- add a description in an existing task;
- go to Set Defaults in the debug mode;
- add a default description;
- add project id as a condition;
- go to the kanban view of the project;
- create a task;

Issue:
------
Default description is not present.

Cause:
------
The description must be added as a parameter
to the onchange in order to be set to the default value.
The fields passed as parameters are the view's active fields.
Active fields are found during  parsing
of the `quick_create_task_form` view arch.
Unfortunately, the latter does not contain the `description` field.

Solution:
---------
Add `description` field to be detected as an active field
of the quick create view.

opw-3381088

closes odoo/odoo#127571

X-original-commit: 0c391e045743128f6d5050204ccd5e18794ca793
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-07-06 19:46:26 +02:00
Elisabeth Dickinson 7f205c23d7 [FIX] project, mrp, website_slides: improve status buttons layout
Related to commit 45b9e04.
This commit fixes the overflowing status buttons in the MRP module's
Workcenter view. It also adapts the font-size of one of the status
buttons texts in website_slides by wrapping it inside the usual
structure: .o_stat_info > .o_stat_text`.
The same fixes were done for project, stock and sale_timesheet

task-3326558
part of task-3326263

closes odoo/odoo#127555

X-original-commit: odoo/odoo@f0b3806
Related: odoo/enterprise#43726
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-06 17:52:25 +02:00
Sanjay-Sharma 4f6a92e684 [IMP] web_editor: add emoji picker in web editor
Purpose:

This commit adds Emoji_picker functionality to the web_editor,
allowing users to conveniently add emojis to their text and
improving the overall user experience.

Specifications:

Now we can insert emoji in web_editor using `/emoji`.

Task id: 3253958

closes odoo/odoo#125137

Related: odoo/enterprise#42772
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2023-07-05 11:37:06 +02:00
dise 51f8d2a7e8 [FIX] project: fix traceback when opening customer rating view
If a project had a single rating associated to its tasks, opening the
customer rating view would create a traceback. This happened because
both the mail.thread model and the rating.parent.mixin model have a
rating_ids field, and project inherits from both of them (mail.thread
on its own doesn't have it, but the rating mixin adds it).
In the action_view_all_rating method, we try to access the first element of the
rating_ids recordset, if the rating_count field is equal to 1. But since
the rating_ids field belonged to the mail.thread mixin, and not to
the rating.parent.mixin, there could be occurences where rating_count was equal
to 1 while the recordset was actually empty ; accessing the first element of the
recordset would then create a traceback.

To fix this, the rating.parent.mixin model was put before the
mail.thread model in the _inherit list, this way the rating_ids field
from rating.parent.mixin has the priority. A test was also added to check
if the rating_ids is working correctly.

task-3360029

closes odoo/odoo#127243

X-original-commit: 1039c80a8ff5e219e9c2679505015288c8d8dd35
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-04 16:41:08 +02:00
Hugo Carlier (Huca) 9c338783af [FIX] project: avoid invalid subtask when customer is required (FSM)
Steps
=====
- Install module industry_fsm
- Create a task from the kanban view
- In the form view, add a title but no customer
- Open the subtasks tab of the notebook
- Add a subtask and add a title to it
- Save the created parent task
- A pop-up indicate that the customer is missing
- Add a customer and save the task

Issue
=====
A pop-up indicate that the subtasks field is invalid and there is no way
to save the current task with its subtask.

Cause
=====
the module industry_fsm introduces a required=True for the field
"partner_id" when edited from a view in the app Field Service. When a
parent task is created without a "partner_id" id set, it can not be
saved, but subtasks can still be created from it. Those child tasks
should have the "partner_id" set to the same value as the one of their
parent. As it is not set in the parent task, its value will be False for
the child task, and changing it in the parent task (by adding a
customer) will not update the child task. As this field is required when
a task is edited from the app Field Service, the task can not be saved.

Fix
===
A dependency to "parent_id.partner_id" is added to the method
"_compute_partner_id" of model project.task allowing to updating it if
needed when a "partner_id" is set on the parent task.

task-3343423

closes odoo/odoo#127088

X-original-commit: 7f8da6a4148c86b61d994bf692725378f8dafc52
Related: odoo/enterprise#43515
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-04 00:51:56 +02:00
prye-odoo 7694f012cd [FIX] *: handle unlink/create access for reporting views
*: account,event_sale,fleet,hr_attendance,hr_contract,hr_timesheet,
im_livechat,point_of_sale,project

When the user tries to delete a record(s) from the reporting views,  this
traceback will be generated.

Steps to produce (Example only):

- Settings > Technical > Actions > Window Actions
- Search for the Work Entries Analysis. Open it and add a 'tree' as view_mode
in that action.
- Payroll > Reporting > Work Entries Analysis menu and select the tree view.
- Select one or more records and try to delete these records.

Error: A traceback appears: "cannot delete from view "hr_work_entry_report"

Handled the unlink access by using their model access of the reporting models.
similarly, this issue resolves in other reporting models.

Sentry-3975590063

closes odoo/odoo#125697

X-original-commit: 209d8c76ce9bb1d6cc7084d55b5623e939af8fbc
Related: odoo/enterprise#42825
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2023-07-03 21:55:48 +02:00
Yash Vaishnav ead6c03405 [IMP] project: task cannot be assigned as its own parent task
Before this commit In the task's form view, the parent field shows the other
task but also shows the current task.

In this commit, the domain is applied, ensuring that the id is not the same
as the current id. As a result, the parent field of the task does not
include itself

task-3330841

closes odoo/odoo#122286

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-03 11:02:34 +02:00
Xavier Bol (xbo) 59cf3c9e7c [FIX] {sale_}project: make project billable if one of its tasks has partner
Before this commit, when the user installs `sale_project` and some
of his projects has no partner set but a partner is set on some
tasks of those projects then the user will no longer see the partner
field in those tasks because the project is not billable.

This commit checks if one of the tasks has a partner set to make the
project linked billable if it is not yet the case.

closes odoo/odoo#126880

X-original-commit: b0cb255577a7a0c49c2c764dbad715d3842b9508
Related: odoo/enterprise#43384
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-30 01:33:07 +02:00
Hugo Carlier (Huca) 6875d23647 [REF] resource: improve filter_domain_leaf performances
In some methods, like group expand methods, it is not uncommon to
transform a domain designed for model A to search records from another
model B. In general this transformation requires two operations:
- Rename some fields in the domain
- Remove leaves from the domain that relate to fields not existing in
  model B
The current function filter_domain_leaf allows to realize this second
operation. It currently relies on a recursive implementation with a
complexity of order O(n²).

This commit introduces a re-writing of the function filter_domain_leaf
that:
1. Changes the recursion based implementation to an explicit stack
   implementation
2. Introduces a field mapping dictionary as argument

The explicit stack implementation allows to avoid stack overflow when
working with long domains. The complexity order is also improved to O(n)
instead of O(n²) which leads to performance gain. For a domain length of
~100 elements, the gain (timewise) is reaching 50%. It is >95% for
domain length over 10 000 elements.

The field mapping dictionary allows to avoid pre-filtering of domains
when using filter_domain_leaf. In cases where it is used, the domain
then just has to be browsed once in the filter_domain_leaf function.

task-3299357

closes odoo/odoo#120834

Related: odoo/enterprise#40847
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-29 22:38:49 +02:00
Benoit Socias b6b4db5fb5 [FIX] *: adapt front-end HTML field sanitization
*: account, event_booth, gamification, hr, project,
   website_event_track, website_hr_recruitment, website_slides

HTML fields that appear in the front-end can be modified using the
website editor. Some of them are sanitized in a way that breaks the
behavior of snippets that can be dropped within them.

This commit adapts the sanitization of those HTML fields so that the
snippets behave as expected.

opw-3267589

closes odoo/odoo#126708

X-original-commit: 7fd28afaf3e45cafbef80b69aa45c58b31fb3de6
Related: odoo/enterprise#43311
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-06-29 11:59:46 +02:00
paso-odoo d8481fee6a [FIX] project: local variable task referenced in write
When a user creates the task without a name field and directly clicks on the
'Mark as Done' button, will give UnboundLocalError like the local variable
'task' referenced before assignment.

Steps to produce:
- Install the 'Field Service' module.
- Field Service > My Tasks > Open any task.
- Make the name field unrequired (Studio or Edit form View)
- Create a new task > Set the Customer field and leave the Name field as blank.
- Before saving the task click on the 'Mark as Done' button > Discard Changes.
- Error will be produced.

Fixing the indentation for `task.date_last_stage_update = now` will solve this
issue. We have used the task variable in for loop.

Sentry-4276832131

closes odoo/odoo#126752

X-original-commit: c3649a32c98d7093610a4367b1e72c1b4b0085b7
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-29 00:18:45 +02:00
Rémy Voet (ryv) c5cb357d90 [IMP] *: add dependencies to display_name field
The previous commit introduced an optimization to reduce the number of
queries and fields fetched when we call `name_search`. But it works much
better when the dependencies of `display_name` contain field names used
in the calculation (on the same record/model).

Then, to improve the performance and the cache coherency, add `depends`
and `depends_context` depending on the custom `_compute_display_name`.
Add only the first level of dependencies (never traverse relational
field) because only these have a positive impact on the previous
optimization and the cost is very low (see `modified`).
About `depends_context`, we don't include `lang` because (when `_` is
used by example) it is unlikely to get the same display_name in the same
request with two different lang.

closes odoo/odoo#122085

Related: odoo/documentation#4639
Related: odoo/enterprise#42599
Related: odoo/upgrade#4780
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-06-28 17:41:19 +02:00
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
Rationale
=========

Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).

To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)

Changes
=======

- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).

Part-of: odoo/odoo#122085
2023-06-28 17:41:19 +02:00
Yashkumar Vaishnav 9b26dc6018 [FIX] project,hr_timesheet: fix kanban view structure issue in project task
before this commit, The Kanban view for project tasks includes a subtask button,
a remaining hour timer, an activity button, and assignees in its lower section.
However, when the task has subtasks and timesheet entries, these buttons appear
in the Kanban view, causing the view to lose its structure somewhat.

This commit includes reducing the right margin of the activity button and
remaining hours to provide enough space for other elements in the kanban view.
Additionally, the Lock Icon for private tasks has been given a left margin to
separate it from the activity button

task-3289941

closes odoo/odoo#126446

X-original-commit: eff472e39642bb29e5d4615fcfe1255c00ffc5ef
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-26 22:15:51 +02:00
Yash Vaishnav 8ae716b7d7 [FIX] project: fix task count issue in project sharing
Issue:
In the portal view of the project AGR project has 11 Tasks on the list view
but when you click on it, inside there are 12 tasks, not 11

Cause:
The Kanban view of the project includes a button for task
count, which displays the total number of open tasks in the project.
It seems that the task count button displays the correct count because the form
view of the task includes a default filter for 'Open Tasks'.
The form view of the project-sharing feature does not have the default filter of
'Open Tasks'. As a result, the count displayed by the task count button in the
kanban view is different from the count displayed in the list and Kanban views.

Fix:
In this commit, a default filter is passed through the context to ensure that
the task count displayed by the task count button is the same as that displayed
in the list and Kanban views.

task-3289941

X-original-commit: 96304e9b237c06a5d0b459d304df3afbf7607f04
Part-of: odoo/odoo#126446
2023-06-26 22:15:51 +02:00
Bastien (bvdn) 324d3cafe0 [REM] project: remove last unused is_closed field reference
closes odoo/odoo#126422

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-26 22:15:37 +02:00
Thomas Lefebvre (thle) 2dd3cf2c49 [FIX] industry_fsm, project: add a default project
Steps to reproduce:
-------------------
- create a stage without selecting a project.

Issue:
------
The new stage is inaccessible.

Cause:
------
When the project is not defined, the following ORM command is used:
`[6, False, []]` for the `project_ids` field.

Solution:
---------
When we create a project stage (project task type),
it is essential that we link it to a project.
Add the possibility to override `_get_default_project_ids`.
Set default project as first fsm project if not project in
the context.

opw-3322992

closes odoo/odoo#126338

X-original-commit: 69c09684e37accdaf1248f31a7c97f0c20434b76
Related: odoo/enterprise#43134
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-06-26 21:10:15 +02:00
Yash Vaishnav 917d71b9b4 [IMP] project,sale_timesheet: fix task created message notification date
Issue: In the project task's chatter message, the demo data was used to
create messages such as comments and stage changes, which included a specified
date but 'Task Created' message has current date instead of its creation date.

Cause: The notification for 'Task created' includes the current date because
it was not generated by demo data. This has led to a conflict with the dates of
other messages that were generated using the demo.

Fix: The 'write' method is called on all 'Task Created' messages,
resetting their data to the 'create_date' of the tasks.

task-3289941

closes odoo/odoo#120636

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-26 20:00:42 +02:00
pash-odoo f72037948c [FIX] project: fix overlapping issue of archive ribbon and state button in task
Before this commit if we archive project's task then 'archive' ribbon and state
button were getting overlapped.
steps:
-> go to the project and open any project and then open any task
-> click on archive and see that archive ribbon and state button get overlapped

Fix:
-> checked condition if record is archived or not
-> if record is archived then first apply the justify content start of div which
   contains state button and then changed width of state for different screen
   sizes.
-> if record is not archive then leave the state button as it is.

task-3374980

closes odoo/odoo#126208

X-original-commit: 8400dc4bbc40b157736972fedd28d48907396611
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-26 13:20:40 +02:00
Yash Vaishnav b75ef2e965 [FIX] project: fix groupby and sortby issue in portal view of the project
Before this commit,
When you use the 'group by' feature in the portal view of a project, selecting
any value will group the items by stages.

However, when you choose to 'sort by' any option other than 'Title' or 'Newest',
and then navigate back to the project table using the breadcrumb, it may result
in a traceback. The reason why this error occurs is that the query string
remains in the URL even when you switch back to the 'Project' view using the
breadcrumb.

In this commit, keep_query is keeping query in URL so removing it solve
the issue. By default, the 'Stage' is used as the groupby for each project.

task-3318851

Part-of: odoo/odoo#122485
2023-06-23 13:26:55 +02:00
Vincent Larcin 674567fb73 [IMP] project: change order of tasks
This commit increases the priority of the sequence in the ordering of tasks
so that reordering by drag & dropping is more useful.

Task-3371921

closes odoo/odoo#125073

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-23 10:27:40 +02:00
Panagiotis Kyriakou 92442878b7 [FIX] project: fix different subtask button problems
Context: the subtask button should not be clickable
when all the subtasks are in a closed stage.

The change in this commit fix a problem of the subtask
button, where it would not be clickable even when it
should have been (it had open subtasks).

Also it fixes a tooltip "e" that appeared on hover when
the button was not clickable.

Task-3283488

closes odoo/odoo#126090

X-original-commit: 831d48f1ef301d6f64d53a247515a41cc250f678
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-22 22:22:26 +02:00
Hugo Carlier (Huca) 1e57df85ad [FIX] project: avoid warning when selecting tags of a task
Currently, when selecting tags for a task with no project (private
task) on mobile, a warning is displayed. On top of that, the amount
available tags is way more limited than in classical view and the
selection of some exesting tags is impossible.

Steps
=====
1. Warning when selecting tags
- Install module project
- In mobile view, go to the view "Tasks -> My Tasks"
- Open or create a private task (task with no project)
- Click on the tags field

A warning is displayed (on the server logs) stating:
"The domain term '('project_ids', 'in', False)' should use the '=' or
'!=' operator."

2. Limited tag choice
- Install module project
- In mobile view, go to the view "Tasks -> My Tasks"
- Open or create a private task (task with no project)
- Click on the tags field
- The tags that are only related to project(s) are not displayed in this
  view
- Try to create a tag with the same name than an existing tag that does
  not appear.
- A traceback is displayed because this tag already exists.

Cause
=====
As noted from the test of expression.py, M2M fields in the domain should
be compared to list of elements. It is not the case here. When a
project_id exits in the context, nothing happens, but there exists a
check in the ORM to ensure that '=' or '!=' operator is used if the
second element of the domain leaf is a boolean. In this case, there is
not project_id set in the context for private task, resulting in
the previous warning (False used instead of project_id).

Fix
===
We use the improved implementation of _name_search to get the ordered
list of id of records project.tags to display. This list has the
advantage to not be restricted to the current project, while still
presenting the tags of the current project at the top of the list. The
mobile view uses the method search_read to get the list of project.tags
record values, therefore we call the _name_search in this method and use
an optimized sorting function to sort the resulting records accordingly.

task-3302370

closes odoo/odoo#126091

X-original-commit: a03a93aa8cf5567f79dd66ced5911721b82a3802
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-22 21:07:39 +02:00
Bastien (bvdn) a32a7d2957 [FIX] project: avoid traceback on stat button click
- steps to reproduce bug:
  In project.task sharing form view, When clicking on any of the stat buttons (subtasks or parent task)
  when you arrive on the actual task formview a MissingError saying 'missing record' appears
- Issue:
  The record loads accordingly but the Missing Error shouldn't appear

- Cause:
  It is coming from the project_sharing_form_compiler which gave the projectSharingId props to the ChatterContainer element
  but the projectSharingId is equal to the "props.record.context.active_id" of the action, and in the context of the
  chatter we want the active_id to be equal to the project_id, which was the case when we are coming from the KanbanView and
  sub-list views but when coming from the task stat button the active_id is equal to the task_id and the env can't find
  the document 'project.project' with the id of the task. (in portal.py _document_check_access())
- Fix:
  We simply change the projectSharingId to take the "props.record.contect.active_id_chatter" the give an
  active_id_chatter= active_id in the Project Sharing task_action which will always equal the Id of the project

Task-3284755

closes odoo/odoo#126092

X-original-commit: 22c0825b70bbe8234dee57060bdd5640001f74d7
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-22 19:37:23 +02:00
Yash Vaishnav 4a26a1272c [FIX] project: traceback when clicking the discard button while creating a task.
Before this commit, When you click-on the discard button while creating the task
it gives traceback.

This error occurs due to the absence of the chatter when creating a new task.
As a result, 'inputRef.el' becomes null and attempts to access its value and
fail because it does not exist.

This commit will only change the value of the chatter if it exists.

task-3268923

closes odoo/odoo#126004

X-original-commit: 28c9cdbed72a9feaca72fcf24b059211939a345e
Related: odoo/enterprise#42967
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-22 09:50:46 +02:00
Raouf 7fe8dc7720 [IMP] project: improve create task shortcuts
Before this commit:
In 16.2, we have implemented a nice tool to set various fields at the creation of a task from
the Kanban quick create using shortcuts.
This implementation is simple (only a few lines of code), but is not very flexible.
Indeed, shortcuts need to be in a specific order and at a specific place for them to work.
As a consequence, it is very easy for the user to fail in the creation of their tasks using shortcuts.
This task aims at making this feature more robust and complex so that it works in more cases.

In this commit:
It should be possible for the #tag, 23h, @demo, ! shortcuts to be put in whatever order, as long as they are at the end of the name

task-3349154

closes odoo/odoo#124155

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-22 09:50:29 +02:00
Dhrumil Shah a3a05a5a89 [IMP] project: set project as analytic plan in the project config setting
In this commit we change following points:
  - changed string of analytic_plan_id field in res setting.
  - project set as default in the analytic plan of the project setting

task-3251642

closes odoo/odoo#120522

Related: odoo/enterprise#40702
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-20 19:09:03 +02:00
Pierre Masereel 732827a6b1 [FIX] project: stat button display
The stat button that displays the "Blocking Tasks", is not correctly
displayed since the changes made on the statinfo widget.

So we adapt it to make it more beautifull

closes odoo/odoo#125759

X-original-commit: dde96cff4cd71aa85526ca8a88bb52b6fd8b1cf7
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2023-06-20 18:01:53 +02:00
Yash Vaishnav 5b997c5bad [FIX] project: remove one dialog box when deleting stages of project
Steps to reproduce:
1) Install the project.
2) Enable 'project stages' through the settings.
3) Try to delete an empty stage
4) Notice that two confirmation dialog boxes appear.

Cause:
The project module contains a dialog box for deleting project stages, resulting
in two confirmation prompts when attempting to delete a project task.

Fix:
The 'deleteGroup' function in the kanban_header file is responsible for deleting
the stages in the project. the 'deleteGroup' function in the KanbanHeader class
is extended and overridden with another confirmation box.

task-3293029

closes odoo/odoo#122018

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-20 15:58:01 +02:00
Rohitkumar (roku) f2406749c2 [IMP] project: improve the project milestone
Purpose of the commit is to do the generic improvements for project.

So in this commit did the following changes:
  - display 'tasks' stat button even if there are no records because of  user create
  task immediately.
  - the milestone should not be displayed in red if the task has been completed/cancelled

task:3251634

closes odoo/odoo#119194

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-20 15:57:58 +02:00
Yash Vaishnav ccbb749cfb [IMP] project: display the deadline in red if the date has passed
In this commit, The date deadline field turns red when the date has passed and
the task has not been closed.

task-2947578

closes odoo/odoo#119771

Related: odoo/enterprise#40341
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-19 23:16:45 +02:00
Prakash Prajapati cbc2bf6a3a [IMP] project: add invite collaborator button to collaborator list view
This commit includes the addition of an 'Invite Collaborator' button to the
project collaborator list view. When clicked, this button opens the same wizard
as the 'Share Editable' button found on the project.project form view. By using
this wizard, project collaborators can be added to the responsible project.

task-2947578

Part-of: odoo/odoo#119771
2023-06-19 23:16:45 +02:00
Yash Vaishnav 9df284792c [IMP] project: improve the rating template
In this commit, I have updated the rating request email template by making
grammatical changes and including company information such as phone number,
email, and website and also added a 'Best regards'.

task-2947578

Part-of: odoo/odoo#119771
2023-06-19 23:16:44 +02:00