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
closesodoo/odoo#108553
X-original-commit: 07c9a3687511c2feaf9b6558da8c7f4d93470e64
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
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
closesodoo/odoo#108440
X-original-commit: 4f6bf04ded020475847212cbbebbfc3f77324799
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
*: 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).
closesodoo/odoo#108063
X-original-commit: 7b9bd9d37731fae724dc5d91da656dab70aa9ad4
Related: odoo/enterprise#35012
Signed-off-by: Julien Castiaux <juc@odoo.com>
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
closesodoo/odoo#105905
Related: odoo/enterprise#34043
Related: odoo/upgrade#4040
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
- 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
closesodoo/odoo#104677
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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.
closesodoo/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>
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
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
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
closesodoo/odoo#106815
X-original-commit: c06aa5331eda0408453552a304170ee0bf027a4d
Related: odoo/enterprise#34504
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
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
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
closesodoo/odoo#106657
X-original-commit: cbd091cb088fba44c14c27dbbc9e8ca098742da1
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
- 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
closesodoo/odoo#104250
Related: odoo/enterprise#33309
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
closesodoo/odoo#106336
X-original-commit: 41b354f3edf7fc77162a59613ccafc0b9b9066a0
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
closesodoo/odoo#106354
X-original-commit: c9e49358111521c042dd793f80ff99895d0fd179
Related: odoo/enterprise#34317
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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
closesodoo/odoo#90270
Related: odoo/enterprise#26795
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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
closesodoo/odoo#98233
Related: odoo/enterprise#30481
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
closesodoo/odoo#105192
X-original-commit: 85ef44cd66474bf5dcda4d7478d566e462d1a550
Related: odoo/enterprise#33717
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
closesodoo/odoo#105141
X-original-commit: b0361fff58862c086c82baffe085b593a3688753
Related: odoo/enterprise#33697
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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
closesodoo/odoo#105013
X-original-commit: 61eb1a57fd195da1f0bc01886fa568e8e2eb2ee3
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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).
closesodoo/odoo#104901
X-original-commit: 5768a5f25b62ce9f07212adbf6584e0b874c64ea
Related: odoo/enterprise#33581
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
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
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
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
closesodoo/odoo#103033
Forward-port-of: odoo/odoo#101967
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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.
closesodoo/odoo#102174
X-original-commit: 836568dfd59886a6d52f15e0e2109709903b6803
Related: odoo/enterprise#32295
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
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
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
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
closesodoo/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>
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
closesodoo/odoo#102351
X-original-commit: 250809a201386cfb1d2ba52d3911bd765a2c910a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
closesodoo/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>
`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.
closesodoo/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>
Tests adaptations will come in a following PR, but the current focus is set on owl conversion.
task-2936932
closesodoo/odoo#101500
X-original-commit: 78e15be0b58c0c964f1df79e95f17fcf72480a5b
Related: odoo/enterprise#31970
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit removes an unused widget from the field, formatter
and parser registries.
X-original-commit: 6f88435e792fdefe17e0684308482b8c2821c361
Part-of: odoo/odoo#101661
Tests adaptations will come in a following PR, but the current focus is set on owl conversion.
task-2936932
closesodoo/odoo#101208
X-original-commit: 22c8e0ec8cd0ffc6a14302fc548bb5fffc5c4e11
Related: odoo/enterprise#31820
Signed-off-by: Xavier <xbo@odoo.com>
This commit add tests that ensures that the toggling is working as expected
when a factor is used.
task-2990758
closesodoo/odoo#100626
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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
closesodoo/odoo#93261
Related: odoo/enterprise#28225
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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.
closesodoo/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>
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