Commit Graph
6422 Commits
Author SHA1 Message Date
Jorge Pinna Puissant a9d3cc036f [IMP] *: use the new setting tag on the form view.
*: hr_timesheet, point_of_sale, pos_epson_printer, project,
    sale_project, sale_timesheet

closes odoo/odoo#110432

Related: odoo/enterprise#36050
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-25 08:18:01 +01:00
Audric Onockx (auon) 77493f9665 [IMP] project: add company restrictions on projects and their company
Add a constraint preventing the user from switching the project from company
if the partner doesn't belong to that company, and vice versa.

task-3126301

closes odoo/odoo#109464

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-24 21:10:38 +01:00
Kartik Chavda 0b82e906c9 [IMP] project,hr_timesheet: improve layout of project simplified view
Before this commit project simplified view was not pretty because
of some alignment between different section/fields and width of
name field is not as expected.

This commit fix layout of project simplified view to make UX
better.

task-3102445

closes odoo/odoo#108151

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-24 19:11:49 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Audric Onockx (auon) 92c61718b9 [FIX] project: search is_favorite excluding similar fields
In a previous commit https://github.com/odoo/odoo/pull/98660,
we implemented `_search` method to search by `is_favorite`.
Unfortunately, this method looks for any order item starting with
'is_favorite' and so it could include 'is_favorite_gnagnagna'.

closes odoo/odoo#110745

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-24 08:09:45 +01:00
Hugo Carlier (Huca) 911a47f9aa [IMP] project, sale_timesheet: improve UX
- Display 'project title' label and add placeholder on the quickcreate
in project.project kanban view

- Project.task calendar view popover : The literal value of the status
is replaced by a colored dot representing it.

- project.task portal form view : The SOL field is displayed in the list
of timesheets entries if some of those entries have a different SOL as
the one set for the task. The SOL name is made clickable and redirect
to the sale order portal view if the user has access to it.

closes odoo/odoo#103434

Task: 3024151
Related: odoo/enterprise#32860
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-23 20:26:53 +01:00
Hugo Carlier (Huca) 07f6362268 [FIX] Project: Tour tips displayed in other apps
- Description: before this fix, some tips of the project tour poped up
in other apps when the tour was not finished. With this fix, those
particular tips are only displayed in the project app.

- Implementation: Some triggers used in the project tour are generic
class that are also used in other modules (in this case, classes
related to the chatter). When leaving the tour at those steps, the
tip in question will pops up every time this class appears in other
apps (i.e. often for classes related to the chatter). To fix this, the
parameter extra-trigger is used for tour steps related to a generic
class.

closes odoo/odoo#110716

Task: 3024151
X-original-commit: c8f86844a427e0f9665b6f9c5e9e182795fb809e
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-23 19:28:46 +01:00
Rohitkumar (roku) bf1c60847b [IMP] rating,project,sale_timesheet: improve the UX for project
Purpose of this commit to improve generic usage of project app.
So in this commit done the following changes:
 - Project tags should be vertically centered
 - Rename share readonly for project.project form view
 - add demo data while add tasks in a folded stage to the sub-tasks and blocked
   by notebooks
 - add demo data for archived tasks to the archived project
 - change the name of the 'rating page done' webpage to 'Thanks for your Feedback'
 - use the avatar widget for the employee

task-2976074

closes odoo/odoo#105904

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-23 16:01:18 +01:00
FrancoisGe 8d41ccf119 [REF] *: relative width of a field is no longer supported in list views
Since the conversion of the list view to owl, the relative field size
has not been reimplemented. We have decided not to support it anymore.
So we will remove all its uses.

The relative width consists in adding a width attribute with a
value. This value corresponds to the weight of the field, the higher
it is, the more space the field will take. This size is only used when
the list is empty.

Example of this:
<tree>
    <field ... width="2">
    <field ... width="1">
</tree>

The first field will take 2x more space than the first one when the list
is empty.

closes odoo/odoo#110382

Related: odoo/documentation#3375
Related: odoo/enterprise#36020
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-23 11:19:59 +01:00
Audric Onockx (auon) 4d081e38a2 [IMP] project: view improvements and project stage deletion wizard
\- https://nimb.ws/NMRdKb project.project list view:
display favorite projects first

\- https://nimb.ws/I8nTwK project.task list view:
partners should be displayed in the same order as in the form view

\- https://watch.screencastify.com/v/ebhfsyP7GtMKSbrVwHlq
project.project kanban view: raise the same error when deleting
a project stage as when deleting a task stage: https://nimb.ws/NQaU3W

\- https://nimb.ws/3h7WGu 'my tasks' kanban view:
hide the 'see examples' button

task-2957863

closes odoo/odoo#98660

Related: odoo/enterprise#30662
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-23 11:19:48 +01:00
Kartik Chavda 3ce5cbe064 [FIX] project: avoid resetting the kanban state in task
Steps:
- Install project app.
- Active Sub-tasks feature in config settings
- Create task with parent task
- Green the kanban state
- Modify the parent task

Issue:
  The kanban state changes when we change the parent task in the task.

Fix:
  We avoid the recomputing kanban state.

Why issue occurred:

  When we change the parent task _compute_project_id is called and sets the project.
  the _compute_kanban_state method depends on the project. So reset the kanban state.

task-3141855

closes odoo/odoo#110492

X-original-commit: 0393cffa71821ba32af8e9ba54225275647c4e70
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-20 20:58:40 +01:00
Géry Debongnie 3a5060c691 [REM] mail: remove remaining form renderer override
The mail code had to override both new and old form views to add the
chatter feature.  Since we converted (almost) all uses of the legacy
form view to the new owl views, the old override is no longer necessary.

This commit removes it, and also removes the 'legacy_form' entry in the
registry so all screens should fall back to the new form view, which is
stable.

closes odoo/odoo#110168

Related: odoo/enterprise#35924
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 13:25:43 +01:00
Aaron Bohy 942fcbfb3a [FIX] *: views: add component instance to rendering context
Owl last update fixes the leaking `this` in rendering context of
templates called with `t-call-context` [1]. Since [2], we use the
`t-call-context` directive to control the rendering context of
templates compiled from an arch (e.g. in form and kanban views).
We can now better control what people use in archs, where we don't
want them to access js implementation details, as `this` is no
longer available.

However, the component instance still needs to be accessible in
the compiled template. We thus add the `__comp__` key in the
rendering context. Since we do not want people to access it in
archs, we add a check in the view validation that this string
isn't used in dynamic attributes.

[1] https://github.com/odoo/owl/commit/df59ec49aefce2e0913fdc1792d42b9680fb28b6
[2] https://github.com/odoo/odoo/commit/4c5b867ff6b0b674cb83d1a1262ae354ebaa6d57

X-original-commit: 264f313012aa99449d1576ae1110252c13755142
Part-of: odoo/odoo#110196
2023-01-18 10:16:12 +01:00
Thibault Delavallée 9140ce06c3 [REF] mail: better define 'keep log' fields of composer
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Change 'auto_delete_message' into 'auto_delete_keep_log' that has the inverse
meaning. Indeed it is unclear what 'auto_delete_message' really does. It is
used when automatically removing emails sent through mass mailing, to know
if message created through inherits are kept or not. Purpose of keeping them
is to have a log on the document. Deleting the message therefore removes the
log.

In this commit we change the meaning to something positive, keeping logs being
clearer when choosing which option to activate. Functional usage of the field
itself does not change with this commit.

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:41 +01:00
Thibault Delavallée 1a1acabd7b [REF] mail: cleanup mono/multi record composer behavior
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Support a real res_ids field on mail.compose.message model. Instead of relying
on active_ids from context, store it once for all at composer level and use
it in code. Active_ids usage is still done at default_get level, using it to
populate the field.

Improve usage of domain, renamed to res_domain to match other document related
fields naming. Add support of a res_domain_user_id field allowing to set the
user from which the domain should be evaluated.

Composer now runs on a list of IDs. Mass mail mode and comment mode are now
distinct from running on a singleton or on more records. Rendered or raw
mode is not triggered by

  * mass mailing mode: always display raw mode, whatever the number of records;
  * comment mode: display rendered mode when having a single record (like the
    previous comment mode). Display raw mode when having either no records
    either at least two records.

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:39 +01:00
Thibault Delavallée 418761e344 [LINT] mail, various: use explicit subtype in message_post_{with_...}
RATIONALE

Purpose of this commit is to be explicit in subtype chosen when invoking the
message composer / calling message_post. As default value may not always be
clear, better be explicit in case the composer default value changes.

SPECIFICATIONS

Add explicit references to subtype when it is not obvious what will be the
final subtype, notably when using helpers (post_with_view or template which
uses the composer that is not crystal clear in its subtype management).

In this commit we also add support of XMLID-based subtype when invoking the
composer. A ``default_subtype_xmlid`` context key is transformed into a
``default_subtype_id``, to be used notably in JS where we cannot easily
use a ``ref``-like statement. Post API now also supports 'subytpe_xmlid'
argument allowing to give the xml id and ease calling the methods.

Use ``_xmlid_to_res_id`` to get directly the ID of subtypes in order to
avoid useless queries from ``ref`` that does an exists.

Also remove useless values given to post API, notably author_id that is by
default the current users' partner.

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:33 +01:00
Xavier ALT 20f5e0f708 [FIX] project: do not set partner as assignee when task created by mailgateway
When a message is processed through the mail gateway, the partner should
never be set as the assignee of that task.

This commit allow to correctly let pass `{'default_user_ids': False}`
context from `message_new()` down to `create()`

closes odoo/odoo#110124

X-original-commit: 08e24d683bf19a77982a7ffba6c64b5fc6fdf85a
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-17 14:16:50 +01:00
Hugo Carlier (Huca) 20b8635737 [REF] resource, project: replace the function remove_domain_leaf
The function remove_domain_leaf is currently used for project burdown
chart. Due to an increasing need of such a function in multiple modules
for various functional cases, it has been decided to:
- Move this function in 'resource' that is imported in all the modules
where this function is needed.
- Implement extensive unit test to ensure that it address corner cases.
- Refactor the function to address the corner cases it was not
addressing until now.

The refactored function 'filter_domain_leaf' is used to transform a
given domain to a new domain using only the leaves that verify a given
check (more precisely, the leaves whose first element verify this check). To perform this transformation, the leaves that do not verify
this check are considered as undetermined. All the logical operators
dealing with undetermined leaves are ignored, which means:
- AND(leaf, ?) = leaf
- OR(leaf, ?) = leaf
- AND(? , ?) = ?
- OR(?, ?) = ?
- NOT(?) = ?
If the result of the operation is undetermined, it is returned as an
empty domain ([]).

closes odoo/odoo#105470

Related: odoo/enterprise#33657
Related: odoo/upgrade#4221
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-16 15:43:01 +01:00
Vincent Larcin b77f60b155 [REF] project,*: refactor projects/tasks views and reports
*=hr_timesheet,sale_project,sale_timesheet,spreadsheet_dashboard_hr_timesheet

The main goal of this PR is to minimize code duplication for the search and list views for tasks and projects.

Task search views
-----------------

The most important change was to merge the search views used in the task reports with the "normal" corresponding search view. The reporting search view should now be almost identical to the normal one in both project and fsm.

The `project.task`/`project.task.user` search views are now following this inheritance diagram:
```
    ┌─┐
  ┌─┤1├─┐
  │ └─┘ │
  │     │
 ┌▼┐   ┌▼┐
 │2│ ┌─┤3├─┐
 └─┘ │ └─┘ │
     │     │
    ┌▼┐   ┌▼┐
 ┌──┤4│   │7├──┐
 │  └┬┘   └┬┘  │
 │   │     │   │
┌▼┐ ┌▼┐   ┌▼┐ ┌▼┐
│5│ │6│   │8│ │9│
└─┘ └─┘   └─┘ └─┘
```
1. `view_task_search_form_base`: Base search view containing all the fields/filters common to project, project sharing and fsm
2. `project_sharing_project_task_view_search`: Search view for project sharing.
3. `view_task_search_form_project_fsm_base`: Base search view containing all the fields/filters common to project and fsm (not project sharing).
4. `view_task_search_form_project_base`: Base search view for project only, with fields/filter common to the normal search view and the one used in reporting.
5. `view_task_search_form`: Search view for project.
6. `view_task_project_user_search`: Search view for the project report.
7. `project_task_view_search_fsm_base`: Base search view for fsm only, with fields/filter common to the normal search view and the one used in reporting.
8. `project_task_view_search_fsm`: Search view for fsm.
9. `report_project_task_user_fsm_view_search`: Search view for the project report.

With this organization, we can easily add a field to both fsm and project at once, and even to project sharing at the same time. Since the goal is to keep the reproting search views identical to the normal ones, it'll also add the field to both of them.

Task list views
---------------
Similarly to the search views, the task list views were also refactored to minimize code duplication, following this inheritance diagram:
```
    ┌─┐
  ┌─┤1├─┐
  │ └─┘ │
  │     │
 ┌▼┐   ┌▼┐
 │2│ ┌─┤3├─┐
 └─┘ │ └─┘ │
     │     │
    ┌▼┐   ┌▼┐
    │4│   │5│
    └─┘   └─┘
```
1. `project_task_view_tree_main_base`: Base list view containing all the fields/filters common to project, project sharing and fsm.
2. `project_sharing_project_task_view_tree`: List view for project sharing.
3. `project_task_view_tree_base`: Base list view containing all the fields/filters common to project and fsm (not project sharing).
4. `view_task_tree2`: List view for project
5. `project_task_view_list_fsm`: List view for fsm.

Project views
-----------------
The search and list views for projects in fsm now inherit the ones from project, since our goal moving forward will be to keep those as similar as possible.

Other changes
-----------------
- Merged and removed many filters/fields from the task search views.
- Changed `total_hours_spent` and ` subtask_effective_hours` labels in `project.task` model to avoid changing them manually in many views.
- Renamed `state` into `kanban_state`, `hours_planned` into `planned_hours` and `hours_effective` into `effective_hours` in `report.project.task.user` to make it consistent with `project.task` (so we can keep the same views for both of those models).
- Moved the sale line filed in the "Settings" tab in the project form view (so that the `sale_line_employee_ids` field in "Invoicing" takes the full width).
---

Enterprise: https://github.com/odoo/enterprise/pull/34106
Upgrade: https://github.com/odoo/upgrade/pull/4216

Task-2746370

closes odoo/odoo#106015

Related: odoo/upgrade#4216
Related: odoo/enterprise#34106
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-13 16:27:17 +01:00
Kartik Chavda 743704c54e [IMP] project: group task list view by default
This commit adds default groupBy for task list view
to represent data properly menu vise.
- add default groupBy stage for tasks from project action.
- add default groupBy personal stage for `My Task` menu.
- add default groupBy project for `All Tasks` menu.

task-3084850

closes odoo/odoo#109281

Related: odoo/documentation#3311
Related: odoo/enterprise#35504
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-10 15:43:10 +01:00
Kartik Chavda 6b22e54f1a [IMP] {sale_,}project: hide customer and sol field for private task
Before this commit when user creates a private task user
still able to customer and sol field which no use for
private task.

This commit hide customer and sol field for private task
and reset customer field when user make non private task
to private task.

task-3084850

Part-of: odoo/odoo#109281
2023-01-10 15:43:10 +01:00
Hugo Carlier (Huca) 2e29170852 [IMP] {hr,sale}_timesheet,{sale_}project: modify task sharing form view
The form view of project.task in project sharing is modified to be
similar to the classical form view of tasks (in backend). A
priorititization is added to the views of project.task for project
sharing used in the following modules:
- project
- sale_project
- hr_timesheet
- sale_timesheet

task-3119935

closes odoo/odoo#109067

Related: odoo/enterprise#35421
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-09 16:38:57 +01:00
Victor Piryns (pivi) 2753236aaa [FIX] project: display inline image from email in task description
Current behaviour:
When sending an email with an inlined image to an alias of a project,
the image is broken in the task description.

Expected behaviour:
The image should be rendered correctly.

Steps to reproduce:
- Install Project
- In Settings add a custom email server and set a domain alias
- Create a new Project and in it's settings create an email alias
- Send an email with an *inlined* image. (not attachment)\
- Image is not rendered correctly in the newly created task.

Reason for the problem:
Email with an embedded/inlined images are multipart, one is containing
the base64 encoded image and has a `content-id`, another one is the
html body that has an `<img/>` which source is a `cid` that references
the `content-id` of the encoded image. When parsing the email when
creating the task, we only take into account the `html` part of the email,
which becomes the `message.body` which is used to fill in the description.
Therefor we have an `<img src="cid:..."/>` that references nothing.

Fix:
Use the already parsed and sanitized `message.body` from the message's thread,
which converts the `content-ids` into relative links to web images.
We fill with that the description's body.

Affected versions:
- saas-15.2
- saas-15.3
- 16.0
- master

opw-3062444

closes odoo/odoo#109354

X-original-commit: 3c805400045f2ccc8ad4228eb5718af0e22a8027
Related: odoo/enterprise#35543
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-01-09 09:07:12 +01:00
damr 5bddc1eac9 [FIX] project: fix traceback when opening a task in shared project
When a project is shared as editable and the url keeps the access token,
it causes a traceback when a task is open. This is due to owl trying to
evaluate a the access token value as a string.
This commit fix it by wrapping the value so the owl component can
evaluate it and get the access token value as a value and not as a
string.

task-3073965

closes odoo/odoo#109351

X-original-commit: 865a45bd170ad15a10b3a3572471f4bf6b5648e4
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-09 09:07:10 +01:00
Csaba Tóth 7265228f20 [FIX] project: translate error message in Project Sharing
Before this commit, when the user cannot write on a certain field
an error is occurred to notice the user, he cannot write on that field.
The problem is the `on` is never translated.

This commit fixes the issue to be sure the whole error message is
translated.

closes odoo/odoo#109288

X-original-commit: 5098c59cc6d1a853210f8c4f5340f0d4ee8dd883
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-06 13:31:01 +01:00
Bastien (bvdn) 8bac2f8136 [FIX] project: decrease task title width
This commit will reduce the width used by the task name in form view to 75% of the
space available, except when in mobile view where it'll take full width.
The title doesn't need to take the whole space but only about 3/4 of it in form view

Side note: this may need to change once the mark-as-done 2 task is merged
because a new wider widget will replace the kanban_state widget

closes odoo/odoo#109258

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-05 23:45:52 +01:00
Jorge Pinna Puissant 5b68871097 [IMP] * : kanban, unify dropdown definition in archs
This commit separate the templates, one for the card and another one for
the menu (the ellipsis dropdown).

The new template, called 'kanban-menu', will only contain the dropdown.
Note that, this behaviour is the same as the one used for the kanban
tooltips.

closes odoo/odoo#107589

Task-id: 3096776
Related: odoo/documentation#3284
Related: odoo/enterprise#34962
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-05 15:37:04 +01:00
luviandFlorent Dardenne 97cc94269d [REF] mail, *: convert Activity view to Owl
*: project, web

This commit converts the Activity view to the current framework shared by
other views. Instead of extending Kanban view/elements, the Activity view
has been implemented by its own.

The project customization of the view has also been converted, as legacy
files have been removed.

Some tests have been adapted since some classnames might differ from the old
implementation, resulting to failing tests. But the overall testing cases
have been conserved.

closes odoo/odoo#107916

Related: odoo/enterprise#35177
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Florent Dardenne <dafl@odoo.com>
2022-12-23 16:07:06 +01:00
luviandFlorent Dardenne 28927c2eeb [REF] web, crm: adapt Kanban progressbar to be a component
This commit moves some parts of the code used by the progress bar of kanban
to its own component. It is now clearer to distinguished its code from the
renderer code (see crm_kanban_renderer). Also, it allows to re-use this
component in other views without making a direct use of 'kanban' elements.

The KanbanAnimatedNumber component has simply be renamed to AnimatedNumber,
as this naming suggested the element was only used as a Kanban element. This
more generic name now indicates that the element can be imported and used in
other places.

Part-of: odoo/odoo#107916
Co-authored-by: Florent Dardenne <dafl@odoo.com>
2022-12-23 16:07:05 +01:00
fdardenne 5358930855 [IMP] web,project: kanban: quick create when grouped by many2many
This commit adds the ability to quick create records from the
kanban view when it is grouped by a many2many field.

This feature improve the user experience for multiple views, here are
some examples of new possible workflows:

- Project -> My tasks (this view is grouped by m2m) -> quick create
- Project -> Select a project -> group by Assignees -> quick create
- Multiples module -> group by tags -> quick create

The "My Tasks" view is grouped by the m2m `personal_stage_type_ids`
field which is a complicated computed field on which we cannot write. A
custom behaviour in their `ProjectTaskRecord` was necessary in order to
support this feature. Previously, they also implemented a custom
behaviour for this field to be able to move records between groups.

closes odoo/odoo#108150

Task-id: 2960497
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-23 15:08:15 +01:00
Rohitkumar (roku) 30f4b615d3 [FIX] project: stat button content align
Before this commit, the content of the stat button not aligned.

So this commit fixes by the stat button's content is aligned to the left and vertically centered.

task-3054386

closes odoo/odoo#108504

X-original-commit: e87284cebe64cc1f5bf31198ca221f14cffdc671
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-22 09:38:07 +01:00
Barad Mahendra 7702087180 [FIX] project: truncate the alias name in project kanban
Currently, when alias name is too long then it was going to
display in the new line and ui is broken in the project kanban card.

So in this commit, if alias_name is too long then truncate the
text and display the ellipsis for name in project kanban card.

task-3052597

X-original-commit: fb111d1f828a4e7580afe758e5c6dbfc9d16a51d
Part-of: odoo/odoo#108440
2022-12-21 19:34:55 +01:00
Barad Mahendra 8131f917fb [FIX] project: hide the translation alert on sharing view
Currently, the translation banner is displayed inside the project
sharing view.

So in this commit hide the translation alert on sharing view of
the task.

task-3052597

X-original-commit: b39a5e4a1f074a53bf0bd0831b73564f52757d6e
Part-of: odoo/odoo#108440
2022-12-21 19:34:55 +01:00
Bastien (bvdn) 92375f487b [IMP] project: improve recurrence notebook and project sharing
Description of the features in this PR:

add the date deadline to the order of tasks (sort priority)
add the day of the week (only the first 3 letters) for the recurrence message in recurrent tasks
display the name of the project in the action instead of 'Project Sharing'

By changing the sorting order of the Project.Task model
some indexations in the tests didn't point to the right tasks
Now each task that has a deadline will be placed in front of other tasks (except for the high priority task)

Task-3034635

closes odoo/odoo#105701

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-21 17:41:39 +01:00
Aaron Bohy aa616d2880 [FIX] web,mail,project: ViewCompiler: warn if wrong usage
Kanban and form archs aren't owl templates. Kanban archs define
a (historically) qweb template ("kanban-box") which is html + some
directives (e.g. t-esc, t-foreach...) and extra tags (field, widget).
Form view archs are html + some extra tags (e.g. group, notebook,
field, widget...).

With the conversion of those views to owl, a door was left open:
one *could* use owl directives (for instance, t-on-click) in archs.
However, we don't want people to do that, as it would tie the archs
in database with js implementation details, which will then limit
the evolution of the js framework.

This commit adds warning when such forbidden directives are detected.
In master, we'll raise errors.

Part-of: odoo/odoo#108221
2022-12-19 16:49:02 +01:00
Hugo Carlier (Huca) 9bd19eec50 [FIX] project: deal with corner case in domain_remove_leaf
The method domain_remove_leaf is used to remove leaves from a domain
corresponding to given fields. The particular case ['|', leaf_to_remove,
leaf_to_remove] is replaced by [true_leaf] however the check of the
second element of this subdomain was incorrectly done. This fix
addresses this issue.

Fixes https://github.com/odoo/odoo/pull/93225

closes odoo/odoo#108188

X-original-commit: 44578077b16b540a0270ea7257f902a2e917f79c
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-19 09:28:21 +01:00
damr 9c5d7adf3d [IMP] project: add default personnal stage to user
Currently, when a db is loaded without demo data, or that a user has no
task assigned and no personnal stage, the view 'My tasks' is empty. The
purpose of this commit is to assign default personnal stage to a user in
these case to ease the understanding of new user of what the view can be
used for.

This commit :
- add default personnal stage to user the first time he clicks on the
'My tasks' menu if the user has no personnal stage and no task are assigned
to him.

task-3047496

closes odoo/odoo#105940

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-15 13:40:40 +01:00
MerlinGuillaume ed2a9c3a78 [FIX] project: recurring dates of monthly repeated task until date
Computing the recurrences of a task repeating every X months until a
certain date generates too much dates

Steps to reproduce:
1. Install Project
2. Go to Settings > Project > Tasks Management and enable Recurring
   Tasks
3. Open any project in the Project app and create a new task then edit
   it
4. Enable the Recurrent field of the task
5. In the Recurrence tab, edit:
   - Repeat Every: 6 Months
   - Until: End Date: one year from now
6. The recurrence message says there are 11 tasks but there should only
   be 2

Solution:
Generate the recurrences until the `repeat_until` date is reached if the
`repeat_type` is 'until', otherwise generate as much recurrences as the
count
Also relax the constraint on the `repeat_day` and `repeat_until` to not
raise an error if `repeat_until` is the last day of the month

Problem:
The recurrence of a task with `repeat_unit` month and `repeat_interval`
different than 1 with a `repeat_type` until creates too much tasks,
exceeding the `repeat_until`

opw-3076593

closes odoo/odoo#107910

X-original-commit: 236b383fd9d1ad6a5d39d8c4232b49864ec19b37
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-12-14 07:49:06 +01:00
Bastien (bvdn) 65893b50fa [IMP] project: change stage_display string in 'My/All Tasks' list view
Small fixup for already merged PR: 103318
stage_display column should have 'Stage' as a header, not 'Stage Display'
added the stage_display field to 'All Tasks' list view

Task-3024152

closes odoo/odoo#107407

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-08 18:00:18 +01:00
FrancoisGe 96e158a8b8 [REF] web: simplify customizations of static menu actions
There are several customizations of the list and form view that consist
in modifying the behavior of a static menu action (archive, unarchive,
export, delete, duplicate). We have seen that this one is very complex.
So we decided to simplify it.

Solution:
Add the getStaticActionMenuItems API point. This allows us to easily
modify the behaviour of static actions.

We also took advantage of this commit to simplify the ActionMenu api.
We have removed the other actions because it was not clear enough.
They are directly added in the action category.

closes odoo/odoo#107086

Taskid: 3089039
Related: odoo/enterprise#34598
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-06 17:11:53 +01:00
Thomas Lefebvre (thle) b755975372 [FIX] project: calculate recurring tasks with interval
Steps to reproduce:
    - activate "Recurring Tasks" option inside Project settings;
    - go to "Field Service" app;
    - create a task;
    - check recurrence box;
    - make the following configuration in the recurrence tab:
       * Repeat Every 6 Months
       * Repeat On Date of the Month 1
       * Until End Date [your choice]

Issue:
    The dates calculated for the recurrence are not correct.

Cause:
    When we select an interval other than 1 for a frequency in months, we do not divide the number of months between the start and end date.
    And therefore the loop that calculates the recurrence dates goes too far into the dates.

Solution:
    Divide the number of months between the start date and the end date by the interval.

opw-3078084

closes odoo/odoo#107320

X-original-commit: 5d44d7d595dab866695945e5a6d2091ddd9df342
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2022-12-06 15:32:58 +01:00
niyasraphy 9a976a8c9a [FIX] various: uniquify the the !
Just change double the by single. This fixes various typos in error and
code comments.

closes odoo/odoo#107266

X-original-commit: 09dfedfc19c2bc34c2bb394dcc4bc609c5ac0107
Related: odoo/enterprise#34681
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 10:52:50 +01:00
Kartik Chavda f1257c8e1b [FIX] project: fix width of chatter in fontend
This commit make chatter width same as form sheet in project
sharing form view.

task-3018123

X-original-commit: https://github.com/odoo/odoo/commit/bb27fde366c41123057a6080e949e384b981d84c
Part-of: odoo/odoo#106956
2022-12-06 10:52:17 +01:00
Hugo Carlier (Huca) 52c53a0210 [IMP] hr_timesheet, project: Modify timesheet info display in project.task form view
- project.task form view:
    - move the tag_ids field below the user_ids one
    - move the 'allocated hours' field above the 'deadline' one
        - remove the 'progress' field and indicate (x%) next to
        'allocated hours' instead
        - the final output should look something like
    - 10:00 (incl. 05:00 on Subtasks) (50%)
    - the timesheets o2m takes the whole width of the notebook

task-3046210

closes odoo/odoo#104677

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-02 19:49:57 +01:00
Hugo Carlier (Huca) dd4168e3d8 [IMP] project: make task description editable for portal users
A portal user who has access to a project can edit tasks description.

task-3046210

Part-of: odoo/odoo#104677
2022-12-02 19:49:56 +01:00
Jorge Pinna PuissantandMichael Mattiello (mcm) c7c2959449 [IMP] web, *: simplification and standardization of the settings arch
The aim of this commit is to simplify and standardize the settings archs.

To do this, a small DSL exclusively for the settings was created. This
new DSL introduces 3 tags: `app`, `block` and `setting`.

The `app` tag is used to declare the application on the settings view.
It creates an entry with its logo on the sidebar of the view. It also
acts as delimiter when searching.

```xml
    <app string="CRM" name="crm">
    ...
    </app>
```

- `string` : The "display" name of the application.
- `name` : The technical name of the application (the name of the module).
- `logo` *optional* : The relative path to the logo. If not set, the
        logo is created using the `name` parameter :
        `/{name}/static/description/icon.png`.

The `block` tag is used to declare a group of settings. This group can
have a title and a description/help.

```xml
    <block title="Title of group Bar">
    ...
    </block>
```

- `title` *optional* : The title of the block of settings (the old h2),
        you can perform research on its text.
- `help` *optional* : The description/help of the block of settings
        (the old h3), you can perform research on its text.

The `setting` tag is used to declare the setting itself. The first field
in the setting is used as the main field (optional). This field is
placed on the left panel (if it's a boolean field) or on the top of the
right panel (otherwise). The field is also used to create the setting
label if a `string` is not defined. The `setting` tag can also contain
more elements (e.g. html), all of these elements are rendered in the
right panel.

```xml
    <setting string="this is bar">
        <field name="bar"/>
        ...More elements
    </setting>
```

- `type` *optional* : By default, a setting is visually separated on two
        panels (left and right), and is used to edit a given field. By
        defining `type='header'`, a special kind of setting is rendered
        instead. This setting is used to modify the scope of the other
        settings. For example, on the website application, this setting
        is used to indicate to which website the other settings apply.
        The header setting is visually represented as a yellow banner on
        the top of the screen.
- `string` *optional* : The text used as label of the setting. If it's
        not defined, the first field is used as label.
- `title` *optional* : The text used as tooltip.
- `help` *optional* : The help/description of the setting. This text is
        displayed just below the setting label (with classname
        `text-muted`).
- `company_dependent` *optional* : If this attribute is set to "1" an
        icon is displayed next to the setting label to explicit that
        this setting is company-specific.
- `documentation` *optional* :  If this attribute is set, an icon is
        added next to the setting label, this icon is a link to the
        documentation. Note that you can use relative or absolute path.
        The relative path is relative to
        `https://www.odoo.com/documentation/server_version`, so it's not
        necessary to hard-code the server version on the arch anymore.

closes odoo/odoo#106425

Task-id: 3081367
Related: odoo/enterprise#34337
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: "Michael Mattiello (mcm)" <mcm@odoo.com>
2022-12-02 14:40:25 +01:00
Aaron Bohy 4c5b867ff6 [IMP] web,*: control form and kanban rendering context
Before this commit, the rendering context of kanban and form views
was the instance of the KanbanRecord and FormRenderer, respectively.
As a consequence, a lot of implementation details (e.g. "props",
"__owl__", any Class method...) were available. This wasn't what
we want.

The door being left open, people went through, and in 16.0, several
kanban and form archs contain(ed) such use of undesired "features".

With this commit, we restrict the rendering context of those two
views. In kanban views, it contains what has been historically
available (e.g. "record", "widget", "kanban_color"...). In form
views, nothing is available since the only dynamic part in those
archs is the attrs, which aren't evaluated by the rendering engine.

To do that, we use `t-call-context` owl directive. When using this
directive, the rendering context is the given one, + `this`. So the
component instance is still available, but through the `this`
keyword. We can thus use it in our compilers, to make them work as
before. Note that `this` can never be used in an arch directly.

Task 3085357

closes odoo/odoo#106045

Related: odoo/enterprise#34493
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-12-02 11:37:48 +01:00
kais-odoo 42a371fc9d [FIX] project: fix the missing progress bar in project sharing view
Before this commit, the progress bar was missing since the progress bar CSS
wasn't loaded to the project sharing webclient.

So in this commit, the progress bar CSS path has been added to the manifest file
for the project web client.

task-3014420

X-original-commit: 84caa0bb2f8a3095c4b98b35ab72f85fd456943a
Part-of: odoo/odoo#106815
2022-11-30 15:06:13 +01:00
Hugo Carlier (Huca) fb13d7c99e [IMP] project, hr_timesheet: improve UX
- Description:
    - project: Apply default filters when selecting a 'blocked by'
    task in task form (project.task form view > blocked by notebook >
    add a line > apply a default filter on the current project and on
    open tasks)
    - project, hr_timesheet: uniformize remaining hours display in
    kanban view for tasks and projects (project.project kanban view:
    add a frame around remaining hours. The color of the frame follows
    the same rules as the one used in project.task kanban view)

task-3034806

closes odoo/odoo#104250

Related: odoo/enterprise#33309
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-28 14:50:50 +01:00
Rohitkumar (roku) f7f3d9610b [IMP] sale_(project): improve the UX for project app
Purpose of this commit to improve generic usage of project app.

So in this commit done the following changes:
 - switch the id and the priority fields from place for task list view
 - add a 'view sales order' button that should open the form view of the SO
   linked to the SOL set on the milestone for milestone list view
 - add a 'sales order' stat button that should open the form view of the SO
   linked to the SOL set on the milestone for milestone form view
 - add a 'done' option; represent it in purple in status field
 - if there is only 1 assignee, display its name on the card instead of
   1 assignee for project sharing kanban view
 - add an 'all tasks' menu on the right of the 'my tasks' one

task-2917086

closes odoo/odoo#97669

Related: odoo/upgrade#3893
Related: odoo/enterprise#30195
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-25 17:55:56 +01:00