Commit Graph
6230 Commits
Author SHA1 Message Date
Miquel Raïch a669992509 [FIX] project: use correct lang when creating personal stages
It's expected that the personal stage is in the lang of the user_id. This commit assures it happens.

closes odoo/odoo#97523

X-original-commit: 2ab1f055b77ab50b62245ab8e34de91500d0c423
Related: odoo/enterprise#30322
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-08-12 23:37:19 +02:00
Xavier ALT ccb987dada [FIX] rating: ensure rating_last_value computation is deterministic
Running tests for `project` module only fails with the following error:

```
2022-08-02 08:19:41,777 5669 ERROR testdb odoo.addons.project.tests.test_project_report: FAIL: TestProjectReport.test_avg_rating_measure
Traceback (most recent call last):
  File "/build/odoo/saas-15.3/addons/project/tests/test_project_report.py", line 22, in test_avg_rating_measure
    self.assertEqual(self.task_1.rating_last_value, 5.0)
AssertionError: 4.0 != 5.0
```

With the ORM flush mechanisms when multiple ratings are created at once
they all have the same `create_date` and/or `write_date`, this commit
ensure the order is deterministic.

closes odoo/odoo#97691

X-original-commit: 567d27cc600bdbb39d62e7aa75b37d48b33d27a5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-09 02:24:57 +02:00
Rohitkumar (roku) fada786edf [FIX] project: hide the milestone option from burger menu
Before this commit, milestone is still visible in project burger
menu even if we disable the milestone feature and due to that while
creating the milestone it was generating the traceback.

So in this commit, add groups on milestone option on project burger menu.

task-2918411

closes odoo/odoo#97629

X-original-commit: 1a7e2a298c2cbf076ce96dae85805f9dd77c7e0d
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 22:16:24 +02:00
Manisha Tulsiyani 038bfa2ca1 [IMP] project,sale_timesheet: generic improvement for the project
Purpose of the commit is to do the generic improvements for project.

So in this commit did the following changes:
 - the 'upsell opportunity' activity should be generated even
   if the service has already been invoiced
 - project.task hide the 'create' button if the project in the
   context is archived
 - project.task portal form view: only the ref of the invoice
   should be underlined on hover, not the empty space.

task-2857924

closes odoo/odoo#94776

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 10:50:50 +02:00
hiroh-odoo 543f36d9e4 [IMP] project: add ancestor_id field in task analysis report
This commit add a ancestor_id field in task analysis report.

task-2824000

closes odoo/odoo#91023

Related: odoo/enterprise#27166
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 10:50:33 +02:00
Rohitkumar (roku) a819d6a597 [IMP] sale_(project),hr_timesheet: improve generic UX for project
Purpose of this commit to improve generic usage of project app.

So in this commit done following changes:
 - when deleting a project, delete all of its tasks in the process instead of
   raising an error
 - make the list view editable bottom
 - add a 'view task' button to open the task form view
 - the 'download' and 'print' buttons should be centred
 - rename 'planned hours' into 'allocated hours' (or 'allocated days' if the
   timesheet encoding unit is in days)
 - when a project is linked to an SO manually, he should appear in the
   'projects' stat button of the SO; same goes for tasks
 - remove the 'profitability' setting
 - display the SOL and the quantity in red as well if the milestone hasn't been
   reached yet for update right side panel
 - add a project field for quickcreate in kanban view
 - 'fa-check-square-o x/y' in muted on the project kanban cards

task-2838372

closes odoo/odoo#92262

Related: odoo/enterprise#27758
Related: odoo/upgrade#3561
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-05 03:38:02 +02:00
Rohitkumar (roku) 2720bc2034 [IMP] sale_(project),hr_timesheet: generic UX improvement for project
Purpose of this commit to improve generic usage of project app.

So in this commit done following changes:
 - add the following filters for project.update search view
 - display 'due mm/dd/yyyy' in red if the deadline is in the
   past and the milestone hasn't been reached yet for milestone section
 - add an 'x Milestones' stat button that should open a list view of all of
   the Milestones that are linked to an SOL of this SO for sale.order form view
 - add an 'unread messages' filter with separated from other filter
 - rename 'create' into 'create project for project wizard
 - change to "Create projects to organise your tasks. Define a different workflow
   for each project." for project.project action helper

task-2864875

closes odoo/odoo#94936

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-04 18:35:23 +02:00
Kartik Chavda 873dd773c0 [IMP] project: set default analytic account and analytic tags in task
Currently, the project's analytic account and analytic tags are not set by
default in the task.

Technical-
- In this task, we have added a demo of analytic tags in the project.
- The default_get() method does not call when the demo data is loaded, so
  the analytic account and analytic tags are not set. So we called
  default_get() from _load_records_create().

task-2861376

closes odoo/odoo#94144

Related: odoo/enterprise#28656
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-04 18:35:11 +02:00
Kartik Chavda 02d485779f [IMP] *_: add the analytic tag on projects, tasks, and timesheets in demo data
*_ = project, hr_timesheet

Currently, the analytic tag is not added to the project, task, and timesheet.
In this commit, we have inserted analytic tags in some projects, tasks, and
timesheets. If an analytic tag is inserted in the project, it will be automatically
added to the task and timesheet.

task-2861376

Part-of: odoo/odoo#94144
2022-08-04 18:35:11 +02:00
stefanorigano (SRI) b89296c12b [REM] *: drop o_debounce_disabled class in favor of bootstrap defaults
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:15 +02:00
stefanorigano (SRI) 56064ff1e4 [REM] *: drop oe_clear class in favor of clearfix bootstrap default
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:14 +02:00
stefanorigano (SRI) bd2a1110a0 [REM] *: drop o_cursor_default & o_cursor_pointer classes
Drop custom cursor classes in favor of Bootstrap default ones.
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2918463

Part-of: odoo/odoo#97051
2022-08-04 13:54:12 +02:00
Audric Onockx (auon) 45f26fdd43 [IMP] web: dynamic placeholder for column creation
- Purpose

Improve the UX of the "column creation" mechanism in the kanban view
so that users better understand what it is they are creating.

- Specifications

In the kanban creation mechanism, use the name of field on the model
(e.g. when grouped by stage_id in project.tasks kanban, "Add a Column"
would become "Add a Stage" because the stage_id field's name is "Stage").

task-2755570

closes odoo/odoo#95550

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-03 20:47:56 +02:00
Adesh Jolhe (adjo) 540c740ae4 [IMP] sale_,hr_(project,timesheet): generic improvements for project
Purpose of this PR to improve generic usage of project app.

So in this commit did the following changes:
 - Changed recurrence conformation messgae
 - Changed Burger menu actions  in
   project.project kanban view
 - Added quick search Description in project.task search view
 - In product form view hide button based on condition
 - Added sample data in project_milestone_views
 - switch the state and the author fields from place and add author
   label underneath it's value
 - switch the date and the progress fields from place
 - Added table-stripes class
 - Changed label sprint summary to summary in project_update_default_description
 - In project.project form view and project.update right-side panel hide
   'collaborators' button on condition

task-2895388

closes odoo/odoo#95245

Related: odoo/enterprise#29089
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-03 20:47:50 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
dafl-odoo cc207bbe66 [REF] web,project: stacked line chart generalization
Add stacked option on line chart.
The option already existed in Project for burndown graph, so I exported
and adapted everything concerning stacked lines from Project to Web.

closes odoo/odoo#96833

Task-id: 2929576
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-01 14:44:00 +02:00
jlzhou a04c2f134e [FIX] project, web_editor: fix user_id missing bug in this.getSession()
auth_totp module added user_id in session_info, but it's not in the depends of project and web_editor module.

To avoid traceback after uninstalling auth_totp module:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0'),

we should use uid instead of user_id in js code.

closes odoo/odoo#96880

X-original-commit: 81b92a61907028f71b1337b11d0d60ee98bb5775
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-01 10:55:37 +02:00
Panagiotis Kyriakou 4b34897416 [IMP] project: add access info on project visibility settings
This commit introduces some information/instructions regarding the access
to the project/tasks depending on what the user has selected for the project visibility.
This should reduce confusion and thus increase productivity on the user side by
making the task of granting access rights more straightforward to the user.

closes odoo/odoo#95947

Task: 2917471
Related: odoo/enterprise#29455
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-07-22 18:53:52 +02:00
+2 bc0a0cead6 [IMP] web,*: enable owl list & form views
The new list and form views were merged recently [1], but they
weren't activated because they weren't 100% ready yet. This is now
the case. This commit adds those views to the view registry. As a
consequence, a lot of qunit tests and tours needed to be adapted,
mostly for selector changes.

We also add legacy list and form views to the view registry, with
keys 'legacy_list' and 'legacy_form'. This allows to force those
legacy views when necessary. For instance, we did it in views
using complex custom legacy x2many field widgets that haven't been
converted yet (we have a compatibility layer but it isn't complete
and doesn't support every advanced usecases).

[1] odoo/odoo#92475

Part-of: odoo/odoo#78221
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2022-07-22 16:21:45 +02:00
hieu 19549afdfc [FIX] project: fix access error when internal user access to project
form

Before this commit, when the internal user without any access rights to
the Project app and has a link to access to the form view of a "public"
project, an access error is occurred when that user when to access to
the
project form view. The reason is the `project.collaborator` is only
accessible to the user with an access right to the Project App and since
the number of collaborators displayed in a stat button is computed with
the access rights of the current user, the compute cannot be done for
the
internal user.

This commit executes the compute is superuser to prevent the user having
access error and to correctly access to the project form view as before.

Steps to reproduce the bug:
--------------------------
1) Create a Project P and add *Marc Demo* in the followers of that
project
   if the Privacy Visibility is "Invited internal users".
2) Remove the access rights to the Project app for *Marc Demo* user.
3) Copy the link to the form view of project P.
4) Log in as *Marc Demo*.
5) Paste the link copied in step 3 to access to the form view of project
P.

Actual Behavior:
---------------
An access error is occurred because the user without any access to the
Project app cannot access to the `project.collaborator` model.

Expected Behavior:
-----------------
The internal user without any access rights to the Project App should
access
to the form view of the project P.

closes odoo/odoo#96497

X-original-commit: c725c3fbb29eff49eff3794aff9d407175599e63
Signed-off-by: Xavier <xbo@odoo.com>
2022-07-21 12:29:47 +02:00
Laurent Stukkens (LTU)andYannick Tivisse ac7cd0e874 [IMP] project: improve burndown chart performance
Purpose of this commit
======================

The Burndown Chart report was very slow on big databases as it was not
possible for Postgresql to optimize the query as it was based on a view
that was using several generate series.

This commit aims to improve the performance by injecting the constraints
at a lower level than it was in the past, lowering the amount of data
processed in the higher level of the query.

/!\ Important note
------------------

Overwriting the `read_group_raw` is really not a good practice and should
be avoided in most case. If you fall on this implementation by grepping
the source code, please be advised that this is not the right way of doing
things.

Implementation details
----------------------

- The report is now run by generating the `SQL` that is executed by the
  `read_group_raw`. This allows inserting `SQL` constraints at a lower
  level and simnifically improves performance. As there is no other way
  to do it, the code is unfortunately a modified copy of the actual
  `read_group_raw`.
- The pivot view has been removed as it had no meaning and was creating
  confusing data.
- The `Group By` menu has been limited to `stage_id` and `date` as bringing
  more data trough the different `GROUP BY` statements up to the higher level
  is costly. Further more, additional `Group By` did not bring added value
  as the Chart was less readable.
- The JS code has been adapted in order to force a group by both `stage_id`
  and `date` so that the date displayed is always making sense.
- The sort ascending and descending options have been removed as creating
  confusing data.
- The compare with previous period has also been removed as the chart only
  really make sense when seen chronologically.
- A lot of tests have been added in order to ensure that changes that would
  be harmful for the report will trigger test fails.

task-2845729

Co-authored-by: Yannick Tivisse <yti@odoo.com>
2022-07-20 15:57:32 +02:00
Laurent Stukkens (LTU) 4faeff02c7 [IMP] project: prevent test_delete_project_with_task to be run several times
Prior to this commit, `test_delete_project_with_task` is part of `TestProjectCommon`
which is inherited in several tests. Because of that, `test_delete_project_with_task`
is run several times, which is not relevant.

This commit moves the tests into a new class in order to prevent it to be run
several times.

task-2845729
2022-07-20 15:23:54 +02:00
Goffin Simon 24c05db8b8 [FIX] project: Deadline not reset when task is closed
Steps to reproduce the bug:

- Let's consider a project P with 2 stages S1 and S2 where S2 is a closing stage
- Create a task T in P and set T in S1 with a deadline in the past
- Pass T to S2

Bug:

T was still appearing when selecting the filter Late tasks

opw:2900663

closes odoo/odoo#96308

X-original-commit: a88611e634ca74478308c274e43ea0de0d4716b2
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-07-20 10:59:04 +02:00
MAHAMADASIF ANSARI 6807eea38c [FIX] various: display full name/title in form views
With commit[1], we added `o_text_overflow` classes at several places to avoid
long names going out of the boxes. However, for the name/title fields in the
form views, we should always show the full name.

So this commit replaces `o_text_overflow` class with `text-break` from
name/title fields in the form views to display full string in the read
only mode, but also keep them from going outside of the form view.

Below are the modules affected:
 - base
 - coupon
 - crm
 - event
 - mass_mailing
 - mass_mailing_sms
 - project
 - sales_team

commit[1] - a0ebb46

task-2889845

closes odoo/odoo#96132

X-original-commit: 4a74c7af6b54bd771f50d3885813f4aae442c9e7
Related: odoo/enterprise#29552
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-07-18 18:42:03 +02:00
abd-msyukyu-odoo 40dda26350 [FIX] core, web: handle read_group ranges for multiple granularities
There was an issue with the computed `read_group` `__range` when grouping on
the same date/datetime field on multiple granularities (i.e. month, week).
Since the range was stored with the field_name as a key, the last evaluated
range would override the previous ones.

Impacted Versions:

  - master
  (- exists since 15.0 but it does not impact the user directly so it has been
  decided to fix this only in master, since the API is modified)

Steps to reproduce:

  1. Open a list view and group by a date field with at least 2 granularities
  2. Open the chrome debugger (network) and check a web_read_group rpc preview
  3. Find the web_read_group for groups related to one of the largest
     granularities and check the `__range`

Current behavior:

  - `__range = {field_name: false}`

Expected behavior:

  - `__range = {field_name: {from: range_start, to: range_end}`

Explanation

Since the smaller granularities are evaluated last, and the condition to update
`__range` is related to the field_name and not the granularity, the range is
always overriden by the smaller granularities (even if their value is False)
when grouping on the same field with multiple granularities.

Furthermore, there is a conceptual problem with the current solution: it does
not allow to store multiple ranges when the read_group is not lazy and when
grouping on the same field with multiple granularities.

Therefore, the proposed solution is to use the full groupby keys in the
`__range` to allow storing multiple ranges depending on granularity. The keys
in `__range` would thus match the group value keys and allow more flexibility
if a domain must be forged from the group(s) range(s).

Task-2894519

closes odoo/odoo#95193

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-14 18:03:50 +02:00
Matthieu Stockbauer 3ae11c87e8 [IMP] mail, *: adapt bus service to wowl env.
*: bus, calendar, iap_mail, im_livechat, project, web.

In order to ease the PR introducing the websockets in Odoo, the bus service
has to be updated to be a wowl service. This PR takes care of it.

task-2053917

closes odoo/odoo#95824

Related: odoo/enterprise#29361
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-14 11:42:42 +02:00
Hardik Prajapati bdc4b4a21b [IMP] base,project: improve project and the uninstall wizard
This commit does the following changes:
 - Improve some project filter and views
 - Align the module kanban buttons
 - Sort the module in uninstallation wizard

task-2731708

closes odoo/odoo#83339

Related: odoo/enterprise#23783
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-07-12 10:37:02 +02:00
Xavier BOL (xbo) c227ff755a [IMP] project: update contextValue for components in right side panel
This commit directly add the `default_project_id` key in the
`ProjectRightSidePanelComponent` component to get it in all components
which extends on the that component.

task-2861207

Part-of: odoo/odoo#95721
2022-07-12 01:29:24 +02:00
Xavier BOL (xbo) 1806a4cddd [FIX] project: use the new route instead of the old one
Before this commit, the route used for the project sharing always used
the old one.

This commit changes the url to use the new one to avoid redirecting the
old route to the new one each time the user goes to the Project Sharing
feature.

closes odoo/odoo#95677

X-original-commit: 73e6438f1b294ac274dffccc9c4b97dbfc0e3e50
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-08 19:53:03 +02:00
Xavier BOL (xbo) e83d33b427 [FIX] project: redirect old routes with parameters
Before this commit, the redirection does not take into account the
parameters passed into the url.

This commit uses the full path instead of the path to get the url with
the GET parameters.

X-original-commit: 9570d284324ffef4d11575115f1f232e0191b895
Part-of: odoo/odoo#95677
2022-07-08 19:53:03 +02:00
Denis Ledoux 5ccc32fcf7 [IMP] tests: common.Form, can't write on invisible fields
In the web client, in a real use case, it's not possible
to write on fields which are invisible,
as it's not possible to write on fields which are readonly.

This is a first step in the goal to change the behavior
of the `groups=` attribute in the back-end views,
to remove them for the view instead of making them invisible.

This is mainly to reduce the diff of the revision that will introduce
the mentioned above behavior change.

As nodes with `groups=` will be removed from the view
when the user doesn't have the group, it's no longer possible
to set a value on a field having a `groups=` the user doesn't have
in the `Form` test class, as the field will no longer be at all in the
view.
However, these unit tests shouldn't have been able to set values
on invisible fields in the first place.
This revision therefore aims to correct the unit tests setting value
on fields which were invisible because the user executing the
test was not part of the required group(s) for these fields
to be visible in the view.

closes odoo/odoo#94337

Related: odoo/enterprise#28936
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-07-08 14:33:47 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 9b5c9484fe [REF] *: BS5: adapt changes in media query mixin
> Media query mixins parameters have changed for a more logical approach

> media-breakpoint-down() uses the breakpoint itself instead of the next
> breakpoint (e.g., media-breakpoint-down(lg) instead of
> media-breakpoint-down(md) targets viewports smaller than lg).
> Similarly, the second parameter in media-breakpoint-between() also
> uses the breakpoint itself instead of the next breakpoint (e.g.,
> media-between(sm, lg) instead of media-breakpoint-between(sm, md)
> targets viewports between sm and lg).

https://getbootstrap.com/docs/5.1/migration/#sass

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 903e72d0ac [REF] *: BS5: various
Refs:
https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:20 +02:00
Romeo Fragomeli 1644b9bc22 [REF] website, project: fix tour dropdown-menu click
Remove jQuery usage as Bootstrap 5 don't relay on jQuery anymore,
even if Bootstrap as a jQuery compatibility layer.

From [1]
> All the events for the dropdown are now triggered on the dropdown
> toggle button and then bubbled up to the parent element.

From [2]
> events triggered with jQuery do not go through the native layer, so
> if a handler has been bound natively, it won't be called.

Note:
[1] https://getbootstrap.com/docs/5.1/migration/#dropdowns
[2] https://github.com/odoo/odoo/commit/a535d7c6fb5a6abe083e7d665d7243f5061a4773

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:19 +02:00
Romeo Fragomeli 23c3a31a0d [REF] *: BS5: removal of .media class
https://getbootstrap.com/docs/5.1/migration/#grid-updates
https://getbootstrap.com/docs/5.1/utilities/flex/#media-object
https://github.com/twbs/bootstrap/pull/28265

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:19 +02:00
Romeo Fragomeli ac584e171d [REF] *: BS5: Migrate Badge
From [1]:
> Dropped all .badge-* color classes for background utilities
> (e.g., use .bg-primary instead of .badge-primary).

We now have to manage constrast for some badge. It's why we
add 'text-dark' at some point.

Note:
Due to the backport of 'text-bg-#{theme}', we can use this to
avoid to use 'text-dark'.

Ref:
[1] https://getbootstrap.com/docs/5.1/migration/#badges

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:18 +02:00
Raphael ColletandVincent Schippefilt eb67feb590 [FIX] *: cache consistency
In module mail, invalidating 'message_ids' on a mail thread also
invalidates its inverse field 'res_id' on messages.  If you haven't
flushed it before, your cache will be inconsistent, as shown by the test
/mail:TestMailgateway.test_message_process_bounce_records_channel.

In module purchase_stock, add depends on report.stock.quantity.  This
ensures that when the model is queried after changes in other models,
the data on which the SQL view depends is flushed to the database before
querying that model's table.

closes odoo/odoo#66938

Related: odoo/enterprise#16722
Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2022-07-05 11:35:01 +02:00
Vincent Larcin 70b58228b9 [FIX] project: hide the "Recurrent" option in the form view
Since https://github.com/odoo/odoo/pull/85176, following a conflict resolution in a forward-bot,
the domain used to show the "Recurrent" option in the form view
of tasks is wrong, and the option is shown for all unarchived tasks,
regardless of whether the setting is enabled.

This commit fixes this domain.

closes odoo/odoo#95015

X-original-commit: f26d864da52a3543d9f9733b2833a3210d5449f6
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Larcin Vincent (vila) <vila@odoo.com>
2022-07-01 16:36:11 +02:00
Géry Debongnie fde1ca963c [IMP] web, project: introduce and use renderToMarkup
Part-of: odoo/odoo#92475
2022-06-30 09:29:50 +02:00
Aaron Bohy 4f984568e1 [REF] *: adapt code to new kanban view
This commit makes various adapations in addons with respect to
the introduction of the owl kanban view. Mainly, some selectors
in scss and in tests needed to be adapted. Moreover, in some tests
that we haven't adapted yet, we must ensure that legacy form and
list views are still used (useLegacyViews).

It also contains some adaptations in kanban templates, e.g. the
replacement of moment by luxon, the removal of underscore...

Part-of: odoo/odoo#92475
2022-06-30 09:29:45 +02:00
Sébastien Theys 9de429e747 [IMP] mail, project: move chatter container setup code in init
Setup was conditionally done in render lifecycle methods, but it could be moved
to init instead, allowing to simplify the code and remove unnecessary methods
and overrides.

Part of task-2871070

closes odoo/odoo#94307

Related: odoo/enterprise#28893
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-27 15:11:13 +02:00
Goffin Simon d420adc877 [FIX] project: Creating a stage from a sub task
Steps to reproduce the bug:

- Let's consider a project P with a task T
- P has has two stages S1 and S2
- From T, create a new sub task ST1 with a new stage S3
- From T, create an other new sub task ST2 and try to select S3 as stage

Bug:

ST3 was not displayed in the available stages

Fix:

The stage ST3 is available for every task or sub task

opw:2873640

closes odoo/odoo#94487

X-original-commit: 5254407f5a593f37a1f21d43a725504c8dc0ab6d
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-24 09:26:04 +02:00
Victor Feyens fba6ea5a47 [IMP] *: do not force admins to be app admins
For bugfix purposes, app administration groups have been given to
(implied by) the "Settings" group because without those rights,
opening/saving the settings crashed.

1) Do not load hidden view content

This commit uses the conditional inheritance of views
(depending on user groups) to avoid loading unnecessary view
& record content client-side.

This improves performance for admins without the specific application
admin rights, but also fixes the main bugfix problem,
caused by the webclient querying name_get for the records in relational
fields content.

Example:

sale_management adds a res.config.settings field to specify
the default sale.order.template for the current company.

If a 'Settings' user without 'sale.group_sale_manager' opens the
settings, he won't see this setting, but if a default template is
specified for the current company, the webclient will still request
the name_get of this template to the server, because the field
was present in the view, only hidden with a groups attribute.

With this commit change in sale, the field won't be in the view unless
you have the Sale manager group, avoiding the error/traceback/bug.

2) Remove implied application administration groups

Do not force the specific application groups on all 'Settings' user,
they globally do not need those rights, and if they need it, they
can add it to their account themselves.

3) Add a test to make sure settings user are able to manage settings.

4) Enforce 'settings' -> 'access rights' -> 'internal user' groups

As the previous test highlighted some 'false positives' because
it considered a settings user unable to read `crm.team`
and `stock.warehouse` records, we also took the opportunity to enforce
the fact that 'Settings' & 'Access rights' users must be internal users.

It makes no sense for a portal/public user to have access to the
settings, and didn't work anyway.

Part-of: odoo/odoo#91909
2022-06-23 23:48:29 +02:00
Hardik Prajapati c5fa2e7e29 [IMP] project: improve user experience
This commit brings some user experience improvement:
- Add a line break between the content of the email and the
  'this customer survey has been sent...' indication in mail template
- Move the project_ids field out of the debug mode

task-2792027

closes odoo/odoo#92048

Related: odoo/upgrade#3579
Related: odoo/enterprise#27655
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-21 16:51:54 +02:00
Vincent Larcin 55d8da526d [IMP] project: adjust portal visibility followers behavior
Currently, portal followers of a project and its tasks are removed when
the project visibility is changed to something else than portal.
=> We want to keep the behavior, but only when changing the visibility
from portal to something else.

When the project visibility is changed to portal, we currently add
its customer to its followers.
=> In that case, we also want to add the customer of the tasks to the
followers of the corresponding task.

When the customer of a project in portal visibility is changed, the
new customer is added to the followers of the project.
=> We want to remove this behavior.

When a project is created with a customer and the portal visibility,
the customer is added to the followers of the project.
=> We want to remove this behavior to avoid mistakenly showing a project
that is not ready yet to the customer.

This commit implements those changes, and also adds a warning when
changing the visibility of the project if that change will automatically
add/remove followers to the project and its tasks.

Related: https://github.com/odoo/enterprise/pull/25800

Task-2812551

closes odoo/odoo#87747

Related: odoo/enterprise#25800
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-21 13:22:32 +02:00
Barad Mahendra b5f8f2133b [IMP] project: unarchive tasks when unarchiving stages
Currently, all of the tasks contained in a stage are archived
when the stage is archived. However, the tasks remained archived
when the stage is unarchived.

So in this commit, If the user unarchives a stage, ask the user to
unarchive the tasks it contains in the process.

task-2835624

closes odoo/odoo#94008

Related: odoo/enterprise#28301
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-21 12:20:53 +02:00
Adesh Jolhe (adjo) 8f192a9b57 [IMP] project(_sms),hr_timesheet: generic improvements for project
Purpose of this PR to improve generic UI of project app.

So, in this PR done following changes:
  - Added group by assigned to under reporting -> customer ratings
  - In quick search, changed "rated rated" operator to "assigned to" under
    project.project search view
  - Removed rating_status field from project > configuration > settings > customer
    ratings
  - Switched the 'timesheets' and 'planning' features from place from
    project > configuration > settings
  - In project.task  extra info notebook:
     - Added the 'parent task' field above the 'analytic account' field
     - Added the 'company' field above the 'sequence' field
  - Added send mail and sms action in project.project and project.task
    list view.

task-2806292

closes odoo/odoo#88446

Related: odoo/upgrade#3459
Related: odoo/enterprise#26207
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-20 12:16:04 +02:00
Fabio Barbero dc66b7aec3 [IMP] mail, various: use overridden method in message_notify
Purpose
=======

In message_notify, when called on a recordset, call model methods instead of
base one defined on MailThread. This allows to use internal methods overrides.

Also perform some linting on calls to ``message_notify`` in order to better
spot calls, parameters, ...

Task-2852908

closes odoo/odoo#92868

Related: odoo/enterprise#28038
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-18 10:23:03 +02:00
Vincent Larcin 8d6960a706 [FIX] project: fix project privacy_visibility tooltip
The project privacy_visibility tooltip doesn't reflect the actual behavior
for the "Invited portal users and all internal users" selection.

This commit rephrases the tooltip of that field in order to correctly match its behavior.
It also slightly changes the name of the options to match the new tooltip.

Task-2871771

closes odoo/odoo#93911

X-original-commit: 9ef7030e3346eda267bc27b47a8a168acdc4a7b9
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-17 14:14:52 +02:00