Commit Graph
2242 Commits
Author SHA1 Message Date
Thomas Lefebvre (thle) 8029b467da [FIX] hr_timesheet: prevent user to see other employee's timesheets
Steps to reproduce:
- for a user, define Timesheets access rights to "User: own timesheets only";
- go to Reporting tab in Timesheets application with this user;
- go to pivot view "By Project" or "By Task".

Issue:
It is possible to see timesheets that do not belong to the user.

Solution:
Add rules which force de domain for the `timesheets.analysis.report` model.

opw-3088745

closes odoo/odoo#108553

X-original-commit: 07c9a3687511c2feaf9b6558da8c7f4d93470e64
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2022-12-23 07:44:44 +01:00
Barad Mahendra 37e9ae0d11 [FIX] hr_timesheet: fix the remaining hours border color
Currently, the remaning hours border is not displayed in the
project kanban view.

so in this commit, added the border class to display the
colored border on project kanban view.

task-3052597

closes odoo/odoo#108440

X-original-commit: 4f6bf04ded020475847212cbbebbfc3f77324799
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-21 19:34:55 +01:00
Julien Castiaux 5502313853 [FIX] web, *: multi-db /web/session/authenticate
*: base_setup, hr_timesheet, mail, partner_autocomplete, web_tour

Start odoo without -d and with a --dbfilter that allows multiple
databases. Via JSON-RPC access the /web/session/authenticate route
providing a non-filtered database and valid credentials. Traceback,
`request.env` is None.

Since httpocalypse the initialization of the ORM (cursor, registry,
environment) is greedy. It means that the connection to the database is
established very early during the request routing or skip altogether in
case no dbname was known at that time. This contrast with prepocalypse
where the various ORM thingies were lazily setup the first time they
were accessed.

This changement has an important implication regarding authentication.

In prepocalypse, thanks to the lazy approache, a cursor/registry/env
would be setup on the database you just login upon using the
`request.env` for the first time. This was very nice in this regard but
had other problems.

Since httpocalypse such operation is no more possible. Devs must
initialize and use their own cursor/registry/env in case they
authenticate on another database than the one `request.cr` is (maybe)
connected to.

The `/web/session/authenticate` controller is an example of such case.
It crates its own cr/registry/environment after authentication. The
problem the controller uses `ir.http.session_info` and that not all
overrides were updated to use `self.env` (=the env created in the web
controller) instead of `request.env` (=the missing env of the request).

closes odoo/odoo#108063

X-original-commit: 7b9bd9d37731fae724dc5d91da656dab70aa9ad4
Related: odoo/enterprise#35012
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-15 15:45:07 +01:00
Kartik Chavda 2bd71d2c9e [IMP] hr_timesheet: convert encoding unit in selection field
Before this commit, the encoding unit used in the timesheet app was a
`Many2one` field and the user can select the UoM to use. However, only
2 units of measure are supported on the Timesheets app, the `Days` and
the `Hours` records created in the data. Also, when the encoding is in
`Days`, the user cannot directly know he can just set 0, a half-day or
a day for a timesheet in the different views of the Timesheets App.

This commit replaces the many2one field by a Selection one containing
2 choices, one for `Days / Half-Days` and another one
`Hours / Minutes`, to explicitly restrict the choice to the UoMs
supported in the Timesheets app. Also, the label of the both choices
is more detailed to explicitly notice the user will can select a
half-day or day is the encoding unit is `Days / Half-Days` and can
edit the hours and minutes on a timesheet when the encoding method
selected is `Hours / Minutes`.

task-3067111

closes odoo/odoo#105905

Related: odoo/enterprise#34043
Related: odoo/upgrade#4040
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-15 13:40:33 +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
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
Kartik Chavda f483d9304f [IMP] hr_timesheet: improve the timesheet test case
In this commit, modify the test to avoid searching the contract if
hr_contract module is installed before this hr_timesheet module.

task-2893556

Part-of: odoo/odoo#96330
2022-11-30 20:03:12 +01:00
Kartik Chavda eb74950670 [IMP] hr_timesheet: use the approver word instead of manager in timesheet
In this commit, the approver word is used instead of a manager because someone
else approves the timesheet.

Technical:

Modified the field name and some strings.
-reminder_manager_allow -> reminder_approver_allow
-manager -> approver

task-2893556

Part-of: odoo/odoo#96330
2022-11-30 20:03:11 +01:00
Barad Mahendra ffdf10339f [FIX] hr_timesheet: fix the remaining hours label on project sharing
Before this commit, when remaining hours is negative then it the
label was displayed as muted instead of danger.

So in this commit, display the label danger when remaning hours
are negative.

task-3014420

closes odoo/odoo#106815

X-original-commit: c06aa5331eda0408453552a304170ee0bf027a4d
Related: odoo/enterprise#34504
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-30 15:06:14 +01:00
kais-odoo 4ef47a242a [FIX] hr_timesheet: fix the missing borders around the remaining hours widget
Before this commit, missing borders of remaining hours in project sharing
kanban view.

So in this commit, added border and respected color boder classes  like
'border-success','border-warning' and 'border-danger' on remaining hours.

task-3014420

X-original-commit: b73f3dd256d79cfb68432b73f13d5cf9e2d541ce
Part-of: odoo/odoo#106815
2022-11-30 15:06:13 +01:00
kais-odoo 4954fa7521 [FIX] hr_timesheet: remove the trash icon in project sharing view
Before this commit, there was a trash icon button in the project sharing view
to delete record.

In this commit, removed trash icon by adding 'delete=0' in  timesheet tree biew.

task-3014420x

X-original-commit: 396684f71c4ff7813bbdd3b44cc4ca1c16564a8f
Part-of: odoo/odoo#106815
2022-11-30 15:06:12 +01:00
Kartik Chavda 49977c1116 [FIX] hr_timesheet: fix searching on is_project_overtime field
Before this commit Projects in overtime filter does not return
project as expected after project has allocated hours to set
on then.

This commit fixes by taking allocated hours into account to
search for project that are in over time.

task-3000817

closes odoo/odoo#106657

X-original-commit: cbd091cb088fba44c14c27dbbc9e8ca098742da1
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-28 15:52:49 +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
Kartik Chavda a8cf155ddc [FIX] hr_timesheet,repair: fix field width issue
Before this commit field width was not as expected because
its label defined in container(Ex: div,span)

This commit fix field width issue by giving o_td_label class
to container of label to properly compute its width

task-3032518

closes odoo/odoo#106336

X-original-commit: 41b354f3edf7fc77162a59613ccafc0b9b9066a0
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-24 13:28:50 +01:00
Audric Onockx (auon) 4fe0ce8460 [FIX] hr_timesheet: uninstall project's 'timesheet' config
Steps :
Go to project > settings.
Check 'timesheet' config and save.
Uncheck it back and save.

Issue :
See errors in the logs, due to on delete restrict.

Cause :
Record 'hr_timesheet.internal_project_default_stage' from data
is deleted when hr_timesheet is uninstalled.
Yet some project task records still use it, so we can't delete it.

Fix :
Delete the corresponding ir.model.data to keep the stage,
but unlink it from the 'hr_timesheet.internal_project_default_stage' ref.

task-2998416

closes odoo/odoo#106354

X-original-commit: c9e49358111521c042dd793f80ff99895d0fd179
Related: odoo/enterprise#34317
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-23 19:59:59 +01:00
Rohitkumar (roku) 095efcd65c [IMP] project,sale,hr(_timesheet): improve the UX for project
Purpose of this commit to improve generic usage of project app.

So in this commit done following changes:
 - rename 'total hours' into 'total hours spent' (or 'total days spent' if the
   timesheet encoding  unit is in days) for project.task
 - timesheets (billed on timesheets) section > group the graph view by
   invoice > employee
 - add default action project update > profitability> timesheets
   (billed on timesheets) section > group the grid view by
   invoice > employee (display sections)
 - add default  the 'timesheet costs' measure in pivot view
 - display 'hours remaining' in red if the number is negative for project.task
   form view
 - display the 'week' scale by default in the grid view

task-2819458

closes odoo/odoo#90270

Related: odoo/enterprise#26795
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-23 15:13:50 +01:00
Audric Onockx (auon) c513b57c3e [IMP] hr_timesheet: populate
task-3030132

closes odoo/odoo#103426

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-15 18:25:08 +01:00
Kartik Chavda b80c01de11 [IMP] hr_timesheet: add employee delete wizard for employee
Before this commit user can directly delete employees even though
employees have timesheets that make employee field in timesheet
black which is not right behavior because in timesheet employee
field is required.

This commit adds a delete wizard for employee delete action
if employees have any timesheet then user cannot delete that
employees without deleting timesheets instead user can archive
that employees.

task-2938632

closes odoo/odoo#98233

Related: odoo/enterprise#30481
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-14 12:03:54 +01:00
Adesh Jolhe (adjo) 11ea3fd06e [FIX] {sale_}project,hr_timesheet: translate various messages
Before this commit, some error messages and others messages are
not translated.

This commit uses the translation function to be able to translate
those messages.

task-3006627

closes odoo/odoo#105192

X-original-commit: 85ef44cd66474bf5dcda4d7478d566e462d1a550
Related: odoo/enterprise#33717
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-08 23:14:51 +01:00
Adesh Jolhe (adjo) 28154ce1e6 [IMP] hr_timesheet: align hours spent value with its label
In project sharing form view the "Remaining Hours" label is not aligned to
"Hours Spent" label due to extra span inside the form view.

so in this commit fixes this issue by hinding extra span by adding attrs.

taks-3034048

closes odoo/odoo#105141

X-original-commit: b0361fff58862c086c82baffe085b593a3688753
Related: odoo/enterprise#33697
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-07 13:50:24 +01:00
Mahamadasif Ansari c91462f7c6 [FIX] hr_timesheet: fix warning message box width
Steps:

- Install hr_timesheet
- Enable Analytic Accounting 
- Create a project and create a task
- Archive the Project's Analytic Accounting
- Open the task and go to the Timesheets page

Issue:

- Warning message box width is small.

Fix:

- Provide the proper format of the warning message.

task-3010437

closes odoo/odoo#105013

X-original-commit: 61eb1a57fd195da1f0bc01886fa568e8e2eb2ee3
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-04 15:57:52 +01:00
Laurent Stukkens (LTU) 623ecff069 [FIX] {hr,sale}_timesheet: prevent default project_id on non timesheets
Prior to this commit and since odoo/odoo#94144, a default project_id is
provided event for non timesheets.

This commit fixes this issue by setting a context key in the `account.analytic.line`
actions that are related to timesheets and by setting the default project_id only
when this key is set to `True`.

This commit also removes `encoding_uom_id` from 'default_get' as it is any
computed as the field is compute (not stored).

closes odoo/odoo#104901

X-original-commit: 5768a5f25b62ce9f07212adbf6584e0b874c64ea
Related: odoo/enterprise#33581
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-04 01:57:13 +01:00
Pratik Awasthi a95a848e06 [FIX] hr_timesheet: fix traceback on task search in portal view
Before this commit, when the portal user is in `/my/tasks` route
and he remove the groupby and search a certain task name and no
task is found with his search, a traceback is occurred saying `task`
is not found to be able to evaluate the following lines:
```xml
                <t t-set="timesheet_ids" t-value="task.sudo().timesheet_ids"/>
                <t t-set="is_uom_day" t-value="timesheet_ids._is_timesheet_encode_uom_day()"/>```
in the portal template.

This commit fixes the issue by changing the xpath to be sure the task
variable is defined before evaluating task.sudo().timesheet_ids.
Moreover, this commit checks if there is any task in tasks before
displaying tbody to avoid having any scrollbar for nothing.

task-2987387

X-original-commit: 9d0b770aebaf3c9c08352bf11fb9fdf2a36f1523
Part-of: odoo/odoo#104259
2022-10-28 00:50:40 +02:00
Pratik Awasthi 88c004171e [FIX] hr_timesheet: fix alignment issue in task timesheet
Before this commit, Task form view > timesheets notebook > the remaining hours
field is not correctly aligned due to extra span inside the view.

So in this commit, extra span will be only added if `allow_subtask` is enabled
and `subtask_effective_hours` is greater than 0.

task-3010685

X-original-commit: 6f697a0930bd780da772d2c69abe3e3c4428c5c5
Part-of: odoo/odoo#103978
2022-10-25 11:07:15 +02:00
Prakash Prajapati f87dda151f [FIX] hr_timesheet: changed the string of the fields according to the encoding unit
In this commit, we changed the following field string:

Initially Planned Days
Days Spent
Remaining Days

task-2978632

X-original-commit: 703d535dd867b43a8c2aba090cdfe1c0da4c2435
Part-of: odoo/odoo#103166
2022-10-15 15:01:21 +02:00
Kartik Chavda 28b58c9e90 [FIX] timesheet_grid: fix Time Rounding's fields width in setting
This commit fix Time Rounding's fields width.

task-2999323

closes odoo/odoo#103032

X-original-commit: 0c11794aecc37507c054f2c823dffef3139e1970
Related: odoo/enterprise#32685
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-10-11 20:25:20 +02:00
Odoo's Mergebot eebb329fc8 [FW][MERGE] hr_timesheet,web: add owl tests and fix bugs
This PR purpose is to ensure that tests are created on OWL Components that have been created in the context of the OWL migration PR odoo/odoo#100729.

This PR also addresses some bugs that have been discovered during tests writings.

task-3001470

closes odoo/odoo#103033

Forward-port-of: odoo/odoo#101967
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-10-11 18:55:40 +02:00
Damien Bouvy e647a2de09 [IMP] *: adapt to grid form views
The recent switch from tables to css grids for form views `group` nodes
has introduced several inconsistencies/issues with several views accross
modules - these will not be the last fixes.

closes odoo/odoo#102174

X-original-commit: 836568dfd59886a6d52f15e0e2109709903b6803
Related: odoo/enterprise#32295
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2022-10-11 13:15:12 +02:00
Laurent Stukkens (LTU) 56623a9712 [IMP] hr_timesheet: add tests for timesheet_uom_no_toggle widget
task-3001470

X-original-commit: 4004a760a577247ae9508b8cecfc4502faf98a58
2022-10-11 13:06:07 +02:00
Laurent Stukkens (LTU) b085183eba [IMP] hr_timesheet: add tests for timesheet_uom widget
task-3001470

X-original-commit: 5698eaa78f8db4e0c016674f46dc4747a03e259b
2022-10-11 13:06:07 +02:00
Laurent Stukkens (LTU) 63f95986a7 [FIX] hr_timesheet: ensure task_with_hours widget works as expected
Prior to this commit, altought the widget was working from the UI, tests
have detected that `activeActions` from the state was not updated when
props where updated.

task-3001470

X-original-commit: 0fb1ff059c40b2489e315fe630a3b39625c468ec
2022-10-11 13:06:06 +02:00
Laurent Stukkens (LTU) 9b483a6d89 [REF] hr_timesheet: rename tests
task-3001470

X-original-commit: d7881b85a66558ac31123e8ad30795342bbbf64a
2022-10-11 13:06:04 +02:00
Laurent Stukkens (LTU) bda7913d48 [MOV] hr_timesheet: move legacy tests into a separated folder
task-3001470

X-original-commit: e1a9678b8dadb78fa4fecc72edf9a0d462b1b101
2022-10-11 13:06:01 +02:00
Xavier BOL (xbo) 000e43840f [REF] project,hr_timesheet: review assets for project sharing
Before this commit, the assets used in project sharing takes almost all
assets in `web.assets_backend`, this way is not a good idea since only
the kanban view and list are used and the chatter is not the backend
one. So the assets could be filtered to minize the size of the bundle
for project sharing to also reduce the loading when the user goes to
project sharing feature.

This commit reviews the assets used in the project sharing to reduce
the size.

task-2947516

X-original-commit: 6805f5c9b5efa55aca711951d05bd51ea2fc8c0d
2022-10-10 17:03:07 +02:00
Romeo Fragomeli 170a98d458 [FIX] hr_timesheet: buttons aren't aligned correctly
Since the merge of Bootstrap 5, the `btn-block` class don't exist
anymore. So we use grid instead to align the buttons.

Steps to reproduce:
* Go to field service
* Create a field service task
* Click on worksheet
* Go back to the task
* Click on sign report
* The buttons are not correctly aligned => BUG

closes odoo/odoo#102714

X-original-commit: af053ab9e21ef86e31c9a27b404658c864df1446
Related: odoo/enterprise#32540
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2022-10-10 14:04:49 +02:00
Prakash Prajapati 88887ce425 [IMP] hr_timesheet: prevent adding new timesheets to project sharing
task-2895909

closes odoo/odoo#102633

X-original-commit: 742a4444a88a65fce2d2cdd5be18ffc51b2d1961
Related: odoo/enterprise#32499
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-10-08 10:41:43 +02:00
Kevin Baptiste 63f8a7cc57 [FIX] hr(_timesheet): fix department kanban dropdown
The "Reporting" title was not properly displayed (stuck to the left of
the dropdown) and the Timesheets entry was not displayed as a proper
dropdown item.

task-3001445

closes odoo/odoo#102351

X-original-commit: 250809a201386cfb1d2ba52d3911bd765a2c910a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-06 17:00:07 +02:00
Martin Trigaux fde3f4d4b9 [I18N] *: export 16.0 source terms
closes odoo/odoo#102163

X-original-commit: 011d7aac5aacedb3ab373f247471ba69d67f50f3
Related: odoo/enterprise#32288
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-10-06 14:56:52 +02:00
Dhaval BaraiyaandMahendra Barad <mba@odoo.com>, Prakash Prajapati <ppr@odoo.com> 1e48724f8b [IMP] *.*: update the tooltips in various modules
The goal of this task is to review the copywriting of the tooltips
because some of them are not correct in English and others are not
valid anymore. This is also a good opportunity to make an inventory
of the tooltips we have and to add some that could be missing.

task-2860991

closes odoo/odoo#102179

X-original-commit: 5e4cf8f9f6a4372f45aa04a5965f8073bb4ea68a
Related: odoo/enterprise#32298
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Co-authored-by: Mahendra Barad <mba@odoo.com>, Prakash Prajapati <ppr@odoo.com>
2022-10-05 12:04:48 +02:00
Denis Ledoux 60dc29e0df [FIX] hr_timesheet: _get_view dependent on company.timesheet_encode_uom_id
`hr_timesheet`, and other timesheet related modules,
overrides `_get_view` to change some timesheet time field label
from "Hours" to "Days" according if the company uses hours as
timesheet encoding UOM or days.

Since odoo/odoo#99417, and the fact back-end views are cached,
keys on which the model views depends on for the cache must be added
through an override of the method `_get_view_cache_key`.

Without this revision, if a database has
one company using hours as timesheet encoding uom,
and a second company using days as timesheet encoding uom,
the label for one of the two company could be wrong according
to which user/company accessed first the view,
for which company the view has been put in the cache first.

These overrides of `_get_view` should be replaced by another mechanism,
for instance by a Javascript widget,
as this mechanism doesn't really make sense when browsing
multiple companies at a time
(selecting multiple companies in the companies dropdown menu).
When going from one record to another with the left/right arrows,
the company can depend from one record to another,
and therefore the label should change from one record to another
according to its company, which is not the case with the current
implementation.
It could also be achieved by setting two different labels,
with an invisible attrs based on a related field
of company.timesheet_encode_uom_id.

However, as we are close to release, and 16.0 is already frozen,
no unstable changes should be done,
hence I restore the behavior which was there
before odoo/odoo#99417.

closes odoo/odoo#101964

X-original-commit: b2a9868b4a0db5a091a1faae38b7d4de29dfd2f4
Related: odoo/enterprise#32198
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-10-03 18:19:50 +02:00
Laurent Stukkens (LTU) 6e81d6c278 [REF] hr_timesheet: convert timesheet_uom_no_toggle to owl
Tests adaptations will come in a following PR, but the current focus is set on owl conversion.

task-2936932

closes odoo/odoo#101500

X-original-commit: 78e15be0b58c0c964f1df79e95f17fcf72480a5b
Related: odoo/enterprise#31970
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-10-02 10:08:43 +02:00
Laurent Stukkens (LTU) be207ca132 [FIX] hr_timesheet: add a space between calendar icon and the date.
task-3000399

closes odoo/odoo#101674

X-original-commit: 4d42ce44b6a1d00490a35ee5ebed6c23e8e30233
Related: odoo/enterprise#32052
Signed-off-by: Xavier <xbo@odoo.com>
2022-09-30 13:35:53 +02:00
Aaron Bohy 98a5c543c7 [REF] hr_timesheet: remove dead code
This commit removes an unused widget from the field, formatter
and parser registries.

X-original-commit: 6f88435e792fdefe17e0684308482b8c2821c361
Part-of: odoo/odoo#101661
2022-09-29 20:51:06 +02:00
Laurent Stukkens (LTU) 68998a428a [REF] hr_timesheet: convert kanban and list views to owl
Tests adaptations will come in a following PR, but the current focus is set on owl conversion.

task-2936932

closes odoo/odoo#101208

X-original-commit: 22c8e0ec8cd0ffc6a14302fc548bb5fffc5c4e11
Related: odoo/enterprise#31820
Signed-off-by: Xavier <xbo@odoo.com>
2022-09-26 23:46:12 +02:00
Martin Trigaux 5150d003fd [I18N] *: export 16.0 source terms
closes odoo/odoo#101053

X-original-commit: 7d4c9d9736cc2ff0ee91dc17ea0f952c9a3dc65a
Related: odoo/enterprise#31752
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-24 15:00:56 +02:00
Laurent Stukkens (LTU) 5a20b60234 [IMP] hr_timesheet: add tests on TimesheetFloatToggleField
This commit add tests that ensures that the toggling is working as expected
when a factor is used.

task-2990758

closes odoo/odoo#100626

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-21 02:26:05 +02:00
Vishal Padhiyar 812644b120 [IMP] *.*: update the tooltips in various modules
The goal of this task is to review the copywriting of the tooltips
because some of them are not correct in English and others are not
valid anymore. This is also a good opportunity to make an inventory
of the tooltips we have and to add some that could be missing.

task-2862283

closes odoo/odoo#93261

Related: odoo/enterprise#28225
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-20 16:29:13 +02:00
Martin Trigaux 1a8772769e [I18N] *: export 16.0 source terms
closes odoo/odoo#100573

Related: odoo/enterprise#31507
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-20 13:48:49 +02:00
gawa-odooandHabib 7e3403068f [REF] *: Analytic Apocalypse
The goal of this commit is to get rid of the analytic tags as they were confusing, serving tag purposes as well as distribution on analytic accounts.

Everywhere analytic tags were used as a distribution have been replaced with a new widget that will dispatch distribution on analytic accounts. If there was an analytic account field next to the tags, it has been included in the distribution.

Analytic tags that were used simply as information tags have been removed.

To fill the new widget, there are now 2 kind of rules that will help fill and prefill it.
The first are applicability: previous groups have been removed, and have by replaced by plans. Each account is required to have a plan. These plans define when they are available in the widget: a default applicability per plan and applicability lines that can specify rules following the context of the widget.

The second one are distribution models, that will replace previous default rules but follow the same principles. The accounts (and so the plans) that will be given by the distribution model can override the applicability rules from before.

closes odoo/odoo#98914

Related: odoo/upgrade#3885
Related: odoo/enterprise#30743
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: Habib (ayh) <ayh@odoo.com>
2022-09-20 12:36:01 +02:00
Adesh Jolhe (adjo) da868d28e2 [IMP] hr_timesheet,sale_(project): bring generic improvements for project
Purpose of this PR to improve generic usage of project app.

So, in this PR done following changes:
 - In project.project form view :
 - Divided settings into sections
 - In project.update.search.view :
   - Added author, description and status in quick search
 - Added ancestor task in group by and replaced parent task with ancestor task
   in search view
 - In project.task search View:
   - the filter for unread messages should be visible only if the current user
     managing his notifications in Odoo
   - Added  my private task filter
 - In project_task_view_graph
   - Added a default project > stages group.
 - In project.task form view:
  - If stage is_closed added decoration-muted
 - Replace/Add parent task with ancestor task' in group by and quick search
 - analytic-tags set on project should be automatically applied to it's tasks

task-2844212

Part-of: odoo/odoo#93676
2022-09-19 17:16:27 +02:00