Commit Graph
2333 Commits
Author SHA1 Message Date
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
FrancoisGe 42e5e247bf [FIX] web: m2o must only use the context of the field
From commit 2ecfed335d, clicking on the arrow of a m2o opens the
record in form view and passes it the context of the current view.
After this commit, only the context defined on the <field> is passed.

Problem:
An example of a problem, is the use of an incorrect active_id in the
second view that is passed through the first form view to the second.
Previously, the active_id of a form view was always the id of the record
and not that of the previous view. This behaviour is debatable, but it
leads to major changes. We therefore prefer to revert to the old behaviour
and no longer pass the entire context in order to avoid this problem.

How to reproduce:
- Go to a form view with a m2o
- Click on the arrow of the m2o

Before this commit:
    The view context contains all the context from the first form
    view and the second.

After this commit:
    The view context contains the context of the m2o field and the second view.

closes odoo/odoo#127538

Taskid: 3394945
X-original-commit: a9bec1fec3ff08461732ef2717457524339eb716
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-12 16:52:54 +02:00
Xavier ALT 4978894a1b [FIX] hr_timesheet: fix access error on 'all timesheets' list view
After odoo/odoo@ad40298a9, when a user having access to timesheet app
but not to accounting app tries to see his timesheet in list view, and
some lines have been invoiced manually, an access error is raised.

This commit ensure that user can compute `readonly_timesheet` even when
user has no accounting access.

opw-3415661

closes odoo/odoo#127996

X-original-commit: 8f224acaac2d3c67d06284726a75194c9dc20a28
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-10 23:43:41 +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
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 aab08eaa4e [FIX] hr_timesheet: fix uom of allocated time field in project task view
Issue:
1) Install the timesheet module.
2) Update the encoding method in the timesheet settings to use 'days' instead.
3) Navigate to the project task section and observe that the allocated days
field incorrectly displays the unit of measure as hours instead of days.

Cause:
The planned_hours field in the project task form view contains a float_time
widget that does not convert the UOM when switching to the Days encoding method.

Fix:
Using the timesheet_uom_no_toggle widget resolves the issue by changing the
updated value. To minimize the extra space generated by using the
timesheet_uom_no_toggle widget, the o_field_float_time class is employed.

task-3318851

closes odoo/odoo#126211

X-original-commit: 93d6f475d4cca35e4d4c41e9dedce3001d50f72d
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-26 13:20:43 +02:00
Yash Vaishnav 8e3c9b7656 [FIX] hr_timesheet: remove 'No records' from task_id when searching task
Steps to reproduce:
1) Install the timesheet application.
2) Open the grid view and select a project.
3) Search for a task that does not exist, for example, 'xyz'
4) Notice that both 'Create xyz' and 'No records' are displayed

Cause:
-The issue arises when using the timesheet grid view, as the default_project_id
is passed through the context. However, when a project is initially selected,
the props do not update, resulting in the 'canCreate' value being set to false.

Fix:
-This change will allow canCreate value to be set as true when the project
is selected.
-In the timesheet grid view 'no_create_edit=True' is passed, indicating that the
user should not create and edit new tasks. Modifying this value is not
appropriate as it goes against the functionality of preventing the user from
editing the tasks.

task-3318851

closes odoo/odoo#122485

Related: odoo/enterprise#41500
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-23 13:26:55 +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
Hamza (hisl) 5ce17f327a [FIX] hr_timesheet : update effective_hours for progress_hours computation
Steps to reproduce the issue:

Add a project and create a task with a timesheet in it
set the allocated hours to 00:03
add a line in the timesheet with hours spent 00:03
Current Behaviour:
The percentage calculated would be 96%, even though the time allocated and time spent are equal.

Desired Behaviour:
The percentage should be 100 as both values i.e. time spent and time allocated are equal.

This is happening because effective_hours value is being rounded off to 2 decimal places, and is not accurate enough to compute the progress_hours.

Here, I have used the same line, that is used to compute effective_hours, to compute the task_total_hours but without rounding off. This will make the calculate more precise and accurate.

OPW-3270858

closes odoo/odoo#125619

X-original-commit: 94dd1d570410c9a994027b7030ee9204ca1ec3e9
Signed-off-by: Hamza Islam (hisl) <hisl@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-19 21:25:55 +02:00
Prakash Prajapati 1aeb814ae8 [FIX] project, hr_timesheet: move the action_project_timesheet in hr_timesheet module
When the hr_timesheet module is not installed and a customer uses the
  action_project_timesheets action through customization, a traceback will
  occur because he will not get the action of hr_timesheet.

closes odoo/odoo#125600

X-original-commit: cdeeb70ada8364c681c93961c2bd29f1069cebbf
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-19 21:25:50 +02:00
luve-odoo 184981b74a [IMP] project : Timesheet UI improvements
- Added the sum of the hours in the project.task tree view for the
"hours spent on sub-tasks" and "total hours" fields.
- Centered vertically the AA warning on the project form -> timesheet
notebook when the AA linked to the project is archived.

TaskId:3251653

closes odoo/odoo#120664

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-19 16:39:48 +02:00
Kartik Chavda d2e5e8b883 [FIX] hr_timesheet: fix visibility of My Timesheet menu for timesheet user
Steps:
- Install timesheet.
- Give user a `user: own timesheets` access.
- Open timesheet app.

Issue:
- `My Timesheet` menu is not visible and `Reporting` is visible
but timesheet user should be able to see `My Timesheet` menu not
`Reporting` menu.

Cause:
- Both `My Timesheet` menus are under that `Timesheets` menu which
has appover group set on it but one of then should be outside of
that menu and missing group on `Reporting` menu.

Fix:
- Move one of `My Timesheet` menu outside to display it for timesheet
user and add approver group on `Reporting` menu.

task-3369534

closes odoo/odoo#125303

X-original-commit: 065227b05a9666798b918fe26ae9c4828ba53a8f
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-16 12:18:55 +02:00
luve-odoo d387acffb7 [IMP] project : Customer Ratings improvements
- Removal of 'my team's ratings' and the 'my department's ratings'
filters in order to be more consistent with the project.task search view

- UI improvements in the project form ratting settings

TaskId-3251609

closes odoo/odoo#120633

Related: odoo/upgrade#4632
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-15 17:36:00 +02:00
Victor Piryns (pivi) c77373892b [FIX] hr, hr_timesheet: correct empl. access w/ no rights
Current behaviour:
In mobile view, if an user that doesn't have any rights over
"Employees", clicking on any of the Many2One `employee_id` (for ex:
when adding a timesheet on a task and clicking on the employee field),
for either the dropdown, or to the form view with the `external` button,
we get a stacktrace.

Expected behaviour:
We shouldn't be met with a stacktrace, if we don't have rights, we
should be redirected to the corresponding view for the `hr.employee.
public` model.

Steps to reproduce:
- Install Timesheets
- Set Marc Demo's Employee's right to `none/empty`, login as Marc
- In mobile view, go to Project > a task > open the timesheet sheet
- Click on Add or any of the present timesheets
- Click on employee field, either on it (redirect to the mobile
  kanban view of all employees) or to the right edge of it (redirect
  to the form view for the currently selected employee).
- Instead of being redirected, you are met with a stacktrace.

Reason for the problem:
Since the migration to Owl, there is an implicit consistency
expected between what is the requested model for said view, and the
model we get back from the server for said view. In general (for
example when in desktop view), usually we pass by an override of
`get_formview_action` which changes the model we are loading
front-end side depending on the access to the employee model. If
access, we load `hr.employee`, if no access, `hr.employee.public`.
But for mobile, we don't pass by an action, we just load a dialog,
and the `resModel` used for the dialog is based on the `relation` of
the `Many2OneField`, which is `hr.employee`. In that case when
`get_views` is being called, we receive a view with the model key
being `hr.employee.public`, which is inconsistent with what the
front-end requested (which is `hr.employee`) and we have a
stacktrace in owl.

Fix:
Override the `relation` property to the correct model in the
corresponding widget set on the template of the field, based on
available group. This relation is used to set the `resModel` when
opening the dialog.

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

opw-3269817

closes odoo/odoo#124961

X-original-commit: 05f1d58ee6143432ce85bc7629dbe76c74c2da33
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-06-14 10:55:00 +02:00
Bastien (bvdn) 1a44b84997 [IMP] project: improve various mark as done features
New features developed in this PR:

- Write Javascript tests for the project.task.state widget
  - Tests are in the project_task_state_selection.js
- rewrite Research & Development demo data
- Created a digest tip for task state selection (in Settings > technical > digest tips)
  - Tip: Use task state to keep track of the task progression
- Fix Sharingview (Readonly) icons for the project.task.state widget, previously only the color bubble were displayed in readonly sharing views, now all of the icons are displayed
- Display state in the Calendar view
  - Display the same widget as in the kanban/list views
- Remove is_closed References
- Adapt Kanban stages Exemples
  - Kanban exemples are available when creating a new stage in kanban view
- improve Progressbar colors (different color for approved/done, in_progress/waiting)

Task-3213526

closes odoo/odoo#117968

Related: odoo/enterprise#39714
Related: odoo/upgrade#4548
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-13 18:20:44 +02:00
Audric Onockx (auon) 6b3c5370a8 [IMP] hr_timesheet: allow timesheeting on sub-tasks with no project
Allow timesheeting on sub-tasks with no project_id set.
Instead, refer to the project_id set on its parent_id, and so on,
recursively.

task-3336215

X-original-commit: d794e41619a36a8c9ad1e77a816e57051207cdcf
Part-of: odoo/odoo#124563
2023-06-10 12:18:56 +02:00
Jurgen (jugj) 3326df49c6 [IMP] hr(_contract/_timesheet), l10n_be_hr_payroll: Improve the UX of the employee view
This PR adds several UX improvements :
- Timesheet smartbutton : Get weekly view instead of daily
- Attestation (N) : Fix displayed year
- Remove demo profile picture for Marc Demo to allow the new one
- Employee tree view : Allow more flexibility in terms of what you can show and hide on the tree view
task - 3299145

closes odoo/odoo#120659

Related: odoo/enterprise#40766
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-06 14:48:16 +02:00
Adesh Jolhe 57f95e1a17 [IMP] sale_(project,hr)_timesheet: bring generic improvements for project
The purpose of this PR is to improve the generic usage of the project app.

So in this PR done following changes:
 - switched Sales Orders button and planning, document button from their place in
   the project kanban card burger menu
 - In milestone form view added decoration-danger on quantity % if it is equal
   to 0 and there is an SOL set
 - On milestone creation the SOL of the project set default if it is of
   milestone type
 - In the product form view Uom is set as 'hours' if the service is either
   prepaid or invoiced based on timesheets.
- In project.milestone list view changed quantity_percentage label to
   to Quantity(%).
- Added product_uom_qty field in project.milestone list view .
 - In project.sharing improved remaining hours widget now only the frame is
   displayed in orange/red, not the background (as in the back-end)
 - project.update right-side panel added the ref of the SO in the nameget
   of the SOL
 - In project.update right-side panel added Confirmation when trying to delete
   a milestone
 - Reduced the size of project and task sharing wizard

task-2989828

closes odoo/odoo#106284

Related: odoo/upgrade#4198
Related: odoo/enterprise#34322
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-05 13:31:01 +02:00
Vincent Larcin 5b7d766fc3 [FIX] hr_timesheet: fix traceback on deleting tasks
Steps to reproduce
------------------

1. Install hr_timesheet.
2. Try deleting a task.

You will get a traceback.

Explanation
-----------

In https://github.com/odoo/odoo/pull/110737, the calls to `_read_group` were adapted to the new API,
but a slight mistake was introduced when adapting the code in `_unlink_except_contains_entries`.
This commit fixes it.

closes odoo/odoo#123597

X-original-commit: 83046fb1fd00ffde7568c35c76697ecf7f4db8fa
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-02 23:39:29 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Brieuc-brd fa60bac197 [IMP] *: app icons : add viewBox attribute
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.

This commit fixes this issue.

task-3326633
Part of task-3326263

X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
2023-05-22 13:54:08 +02:00
Kartik Chavda f71a9cc8dc [FIX] hr_timesheet: add formatters for uom timer widget
Before this commit timesheet uom timer not displaying proper
aggregated value because it was not added in formatters registry.

This commit add timesheet uom timer widget in formatter registry to
display right value when timesheets are encoding in days and views
are displaying aggregated value(e.g. total in list view).

task-3251672

closes odoo/odoo#121788

X-original-commit: ef20722b9d4513519ef78ab6e973edda4fa4d7fc
Related: odoo/enterprise#41252
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-05-22 12:48:36 +02:00
Kartik Chavda f8e30be57d [IMP] hr_timesheet: add default filter for project/task
Before this commit searching on project and task display all
records in search more dialog without distinction and because
of that sometimes it is difficult for user to find a proper
record.

This commit add default filter on search more dialog to
display user related record.

task-3251672

closes odoo/odoo#118911

Related: odoo/enterprise#39936
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-05-17 14:47:06 +02:00
Martin Trigaux 077bbd0b0b [I18N] *: export master source terms
closes odoo/odoo#121563

Related: odoo/enterprise#41140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-17 10:34:00 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
Kartik Chavda e4fe9c60a4 [FIX] hr_timesheet: fix company field issue in kanban view
Steps:
- Install timesheet app.
- Go to kanban view.
- Enable timer on kanban view.
- Click on task field.

Issue:
- Traceback.

Cause:
- Company field is used in timer but forgot to add in
kanban view.

Fix:
- Add company field kanban view.

task-3266724

closes odoo/odoo#120747

X-original-commit: 92b0881a3644d0128c3c505810a6b6f6fb648386
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-05-09 00:41:05 +02:00
Julien Mougenot 10dc896c1e [REF] *: Adapt views to Owl DateTimePicker
This commit follows the addition of the OWL date picker and intends to:

- update views calling daterange widgets to use the new syntax (and
remove the end date field from the view in most cases);

- change the remaining components extending the previous DatePicker and
DateTimePicker components.

Part of task 3121497

Part-of: odoo/odoo#112171
2023-05-05 13:52:22 +02:00
Hubert Van de Walle (huvw) a3a1043e22 [FIX] web: use the correct inputmode for fields
Steps to reproduce
==================

- Use an IOS device
- Open a view with a float field
- Try to edit it

The virtual keyboard displayed is missing a dot, so you can only input
integers

Cause of the issue
==================

For fields that should accept a float value, the inputmode attribute
should be decimal.
Also, specifically on IOS, even with the inputmode set to decimal, it
isn't possible to enter a negative value.

> decimal:
> Fractional numeric input keyboard containing the digits and decimal separator
> Devices may or may not show a minus key (-)

Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode

Solution
========

For IOS, remove the inputmode attribute so that the default keyboard
shows. For other devices, use the decimal/numeric value depending on
whether a float should be accepted.

opw-3269275

closes odoo/odoo#120129

X-original-commit: fb37550715034e7a1fbe751889cd8ea2bd6e4128
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-28 17:23:06 +02:00
Kartik Chavda 270c4732f4 [REF] {hr,sale}_timesheet: refactor timesheet form view
Before this commit timesheet community and enterprise form view
where different from each other because of that if we want to
change something in timesheet form we have to do change in both
view and sometimes it is hard to keep track of both view.

This commit use single form view in both community and enterprise
so it'll easier to change something in timesheet form view and
it'll remove some technical debt.

task-3255754

closes odoo/odoo#117748

Related: odoo/enterprise#39343
Related: odoo/upgrade#4520
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-28 16:04:22 +02:00
Vincent Larcin e7afea2434 [IMP] project,hr_timesheet: improve project and task search views
This commit brings a few improvements to the project.project and project.task
search views.

Task-3264820

closes odoo/odoo#118515

Related: odoo/enterprise#39766
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-25 21:10:39 +02:00
Xavier ALT badc8fb90d [FIX] hr_timesheet: fix KeyError a timesheet on task wo/ analytic set
To reproduce on runbot:
- go a to an existing task
- clear the "Analytic account" field
- add a timesheet line
- save

It then crash with the following error:

```
RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/data/build/odoo/odoo/http.py", line 1698, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/data/build/odoo/odoo/service/model.py", line 134, in retrying
    result = func()
  File "/data/build/odoo/odoo/http.py", line 1725, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/data/build/odoo/odoo/http.py", line 1922, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/data/build/odoo/addons/website/models/ir_http.py", line 234, in _dispatch
    response = super()._dispatch(endpoint)
  File "/data/build/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/data/build/odoo/odoo/http.py", line 715, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/data/build/odoo/addons/web/controllers/dataset.py", line 28, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/data/build/odoo/addons/web/controllers/dataset.py", line 24, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/data/build/odoo/odoo/api.py", line 461, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/data/build/odoo/odoo/api.py", line 448, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/data/build/enterprise/industry_fsm_stock/models/project_task.py", line 101, in write
    result = super().write(vals)
  File "/data/build/enterprise/helpdesk_fsm/models/project_task.py", line 45, in write
    res = super().write(vals)
  File "/data/build/odoo/addons/project_sms/models/project_task.py", line 25, in write
    res = super().write(vals)
  File "/data/build/enterprise/project_enterprise/models/project_task.py", line 288, in write
    res = super().write(vals)
  File "/data/build/odoo/addons/hr_timesheet/models/project.py", line 385, in write
    res = super(Task, self).write(values)
  File "/data/build/odoo/addons/project/models/project.py", line 2050, in write
    result = super().write(vals)
  File "/data/build/odoo/addons/mail/models/mail_activity_mixin.py", line 241, in write
    return super(MailActivityMixin, self).write(vals)
  File "/data/build/odoo/addons/rating/models/rating_mixin.py", line 101, in write
    result = super(RatingMixin, self).write(values)
  File "/data/build/odoo/addons/mail/models/mail_thread.py", line 311, in write
    result = super(MailThread, self).write(values)
  File "/data/build/odoo/odoo/models.py", line 3813, in write
    field.write(self, value)
  File "/data/build/odoo/odoo/fields.py", line 4168, in write
    self.write_batch([(records, value)])
  File "/data/build/odoo/odoo/fields.py", line 4189, in write_batch
    self.write_real(records_commands_list, create)
  File "/data/build/odoo/odoo/fields.py", line 4369, in write_real
    flush()
  File "/data/build/odoo/odoo/fields.py", line 4325, in flush
    comodel.create(to_create)
  File "<decorator-gen-368>", line 2, in create
  File "/data/build/odoo/odoo/api.py", line 410, in _model_create_multi
    return create(self, arg)
  File "/data/build/odoo/addons/hr_timesheet/models/hr_timesheet.py", line 142, in create
    vals_list = self._timesheet_preprocess(vals_list)
  File "/data/build/enterprise/helpdesk_timesheet/models/analytic.py", line 61, in _timesheet_preprocess
    return super(AccountAnalyticLine, self)._timesheet_preprocess(vals_list)
  File "/data/build/odoo/addons/hr_timesheet/models/hr_timesheet.py", line 331, in _timesheet_preprocess
    account = account_per_id[account_id]
KeyError: False

The above server error caused the following client error:
null
```

closes odoo/odoo#119597

X-original-commit: b86fa6a72cc5eaeb0245cf2092eefde09226aa12
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-25 14:07:35 +02:00
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Thomas Lefebvre (thle) dca0f52239 [FIX] hr_timesheet: display timesheets without task in portal
Issue:
When a project is shared with portal users,
only timesheets that are linked to tasks will be displayed.

Solution:
Change the domain that selects the timesheets to be displayed
to take into account timesheets that are not linked to a task,
but are in a project to which the portal user has access.

opw-3253632

closes odoo/odoo#118527

X-original-commit: 527033596afe5640533c568ea8c7367c40ff183a
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-04-14 08:33:49 +02:00
Prakash Prajapati 0ae7a90122 [IMP] hr_timesheet: reduce the width of the float_toggle widget in the timesheet
Currently the width of float_toggle widget is 100% so it appears in full size. In this
commit we have reduced it to 15%.

task-3251667

closes odoo/odoo#117317

Related: odoo/enterprise#39644
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-13 15:26:04 +02:00
Vincent Larcin 4e3f4f2dbc [REM] project,hr_timesheet: remove task report list view
In a previous task, the task reporting list view was removed from
the interface, but the view is still present in the code.

Since this view is no longer used, this commit removes it.

closes odoo/odoo#118328

Upgrade: https://github.com/odoo/upgrade/pull/4538
Related: odoo/upgrade#4538
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-13 05:07:28 +02:00
Kartik Chavda 14b5a466ea [IMP] project_timesheet_holidays: update info to make it more understandable
Before this commit generating timesheet for time off doesn't have
clearer info after the recent change.

This commit update info according to recent changes to have better
understanding to end user.

task-3186664

closes odoo/odoo#115265

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-12 22:47:57 +02:00
Rohitkumar (roku) d21b61cbf0 [IMP] hr_timesheet, _*: improve wording
_* = sale_timesheet, account

In this commit, we have replaced the cancel button string with discord instead
of cancel.

task-3216495

closes odoo/odoo#115693

Related: odoo/enterprise#38341
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-11 14:11:49 +02:00
Victor Piryns (pivi) e48e517072 [FIX] hr_timesheet: timesheet uom fallback when AAL's company is False
Current behaviour:
When creating a timesheet, if in the vals passed the AAL doesn't
have a company (possible since it's not required), then the `uom`
of the timesheet is False, which doesn't make sense.

Expected behaviour:
The timesheet `uom` should fallback on the uom of the company
of the project.

Steps to reproduce:
- Install hr_timesheet, Accounting
- Activate the AAL in the settings
- Create a project with an AAL
- Remove the company on the AAL of the project
- In that project create a task and log some timesheet.
- `uom` field should be empty

Reason for the problem:
When setting the `product_uom_id` in the vals when creating/writing
a timesheet, we just take the `project_time_mode_id` on the company
linked to the AAL. The problem is that the company on an AAL is not
a required field, so it can be `False`, leading the setting the val
for `product_uom_id` to `False`.

Fix:
In case the AAL has no company, we get the `uom` from the company
linked to the project.

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

opw-3245671

closes odoo/odoo#117834

X-original-commit: 4cce77bd0288eeb3326ba57e91ef11d436f8a0ce
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-04-06 07:42:52 +02:00
Audric Onockx (auon) 00b6a18225 [FIX] project,hr_timesheet: fix performance issue in task kanban
It takes a too long to load project task kanban view.
And ~85% of this time is spent in `ProjectTask._get_all_subtasks`,
which is a recursive method returning the children of the children,
while any, of the task, for each task, just to display their count.

We replaced this recursive method with a SQL request,
which is way faster. Also, it can be called in batch.
It will return a dict {id: subtask_ids}.

task-3246085

closes odoo/odoo#117624

X-original-commit: 3b55936fed9ebdcfb8190437ad66c3e42c26b01c
Related: odoo/enterprise#39295
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-04 18:07:14 +02:00
Vincent Larcin a116225e18 [IMP] hr_timesheet,project: take away Marc Demo's admin rights
Since 16.0, the demo user Marc Demo has gained admin access to all the apps.
To facilitate testing access rights, this commit restores his access rights
as they were before for the Services apps.

Enterprise: https://github.com/odoo/enterprise/pull/38055

Task-3229247

closes odoo/odoo#115026

Related: odoo/enterprise#38055
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-04 13:34:54 +02:00
Adesh JolheandManisha Tulsiyani 23cf931808 [IMP] hr_,sale_(timesheet, project),purchase: generic improvements for the project
Purpose of the commit is to do the generic improvements for project.

So in this commit did the following changes:
 - adding a label 'last update' to the stat button in project form view.
 - indicate 'my project' in the tab instead of 'project sharing view in portal' in project sharing.
 - set the first non-folded stage of the project as default on newly created tasks.
 - remove user confirming the SO as the default project manager.
 - hide fields service_tracking, service_upsell_threshold if sale_ok is false.
 - set purchase_method to purchase by default if product is of service type.
 - remove the : next to the totals labels and decrease the font-size for values of 'total hours'
   and 'remaining hours' in timesheets notebook in project task form view.

task-2897867

closes odoo/odoo#96548

Related: odoo/enterprise#29774
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Co-authored-by: Manisha Tulsiyani <matu@odoo.com>
2023-04-04 11:01:59 +02:00
c5dd03ffee [FIX] project: review UX and UI in Project app
This commit reviews the UX and UI in Project app and improves the usability of the
new features recently added (subtasks list in kanban card, state field replacing
kanban_state field, etc).

The following changes are made in this commit:

- swap of user_id icon in the kanban box and the removal of the allow_unassign field and setting
- change the ordering of the fields in the subtask list
- make small layout changes in the project.task and project.project kanban cards
- remove the "lock-icon private" sub-title of private tasks, replace it with a
  little lock icon on the bottom right icons of the kanban card.
- remove the break tag in the project.task kanban card that was unecessary
  given the new display and margin style settings
- lock icon is bigger
- kanban icons are better aligned
- state is as big as avatar
- remove the 'remaining hours on SO' field
- deadline field will be optional and hidden by default in project.task list view
- remove the rating field
- add stage field as optional in project.task list views
- priority and state fields will no longer be optional
- stage_id will be copied when duplicating a task, except when the task is
  generated through the recurrence
- remove the tooltip of the tag_ids field
- When duplicating a task having sub-tasks, '(copy)' is no longer
  added to the name of the sub-tasks of this task.
- project.task kanban view:
  * (+ x tasks) mention next to the name is removed
  * The caret is replaced with 'fa-check-square-o x/y'
    which will represent the number of sub-tasks closed
    compared to the total number of sub-tasks
  * Only open subtasks are displayed
  * When changing the state of a sub-task to a closing one,
    the sub-task is muted and removed from the list on the view reload
  * The name of the parent task on the kanban card of sub-tasks is
    displayed except when viewing the sub-tasks of a particular task
    through the sub-tasks stat button
  * project.project kanban view: the fa-check-square-o icon of
    milestones is replaced with fa-flag-o
  * project.task kanban card: the fa-play and fa-pause icons
    are moved on the right of the remaining hours widge.
  * Allow users to edit the stage_id in batch from the list view of tasks
    if all of the selected tasks are part of the same project.
  * the state will have the same size as the avatar
  * change the opacity of the tasks that are closed
  * state is at the right of subtask list
  * the striked should be replaced by the opacity on the kanban card

Enterprise PR: odoo/enterprise#38132

Task-3229873

closes odoo/odoo#116628

X-original-commit: 09b5d5843096d27b5a4ab0f603ad44bdb2e74723
Related: odoo/upgrade#4478
Related: odoo/enterprise#38771
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Co-authored-by: Panagiotis Kyriakou <paky@odoo.com>
Co-authored-by: Bastien (bvdn) <bvdn@odoo.com>
2023-04-03 17:07:21 +02:00
Kartik Chavda cb12ab2f1c [IMP] {hr,sale}_timesheet{,_attendance}: improve generic UX
Purpose of this commit is to do generic UX.

So, in this commit done following points:
 - improve search on invoice for portal commit when invoice is in
   draft then search on id of invoice instead of name.
 - display unit_amount field in muted when value of unit_amount
   is equal to 0.
 - rename timesheet attendance report.

task-2969791

closes odoo/odoo#100141

Related: odoo/upgrade#3897
Related: odoo/enterprise#31304
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-03 17:07:07 +02:00
Audric Onockx (auon) f403a3f179 [IMP] hr_timesheet: allow progress over max
Allow tasks' progress to go beyond go beyond 100%.
In tasks' list views, display the progress bar in red
if the progress > 100%.

task-2909337

closes odoo/odoo#96104

Related: odoo/enterprise#29565
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-03 12:56:46 +02:00
Prakash Prajapati c2fafa05de [IMP] hr_timesheet: use name_get to add employee's company
Currently, if both companies have employees with the same name, it is not known which
company the selected employee belongs to.

After this commit:
    - The name of the company will only be appended by the name_get when more than
      one company is present in the database.

Example
- Administrator - My Company
- Administrator - Tiny ERP

task-3101249

closes odoo/odoo#107938

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-03 10:41:31 +02:00
Kartik Chavda ad40298a9a [IMP] {hr,sale}_timesheet: improve generic UX
Purpose of the commit is to improve the UX of the timesheet.

So in this commit did the following changes:
- SOL field display by default in timesheet list view
- If the timesheet is invoiced, it will appear in read-only mode

task-2918757

closes odoo/odoo#97203

Related: odoo/enterprise#30000
Related: odoo/upgrade#3729
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-03 10:41:23 +02:00
Kartik Chavda f7ed7052fb [IMP] {sale_,}project: hide customer for non-billble project/task
Before this commit user able to see and add customers on non fsm and
non billable tasks/projects which is not provide any significance as
user don't need customer for normal tasks/projects.

So, in this commit hide customer field and also move partner phone
and city to field service app as it was only usefull for FSM project
and task.

task-3141350

closes odoo/odoo#111335

Related: odoo/upgrade#4274
Related: odoo/enterprise#36459
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-31 19:10:48 +02:00
Kartik Chavda 96ca3680d9 [IMP] hr_timesheet: change allocated hours field label
Before this commit allocated hours field label on task has
to change allocated days when user change encoding unit.

This commit change label to allocated time that work for
both encodinging unit and we don't have to change label
depending upon encoding unit.

task-3141350

Part-of: odoo/odoo#111335
2023-03-31 19:10:47 +02:00