As of this commit, only confirmed leaves will be considered when computing the
current leave or absence of an employee. Additionally, a bug in the is_absent
search implementation was fixed: before this commit, the same results were
returned for absent and non-absent searches.
opw-2877328
closesodoo/odoo#124968
X-original-commit: 28ccbbab07a0c25570ca9b940428b8e541d262d7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
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).
closesodoo/odoo#121629
Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
*_= project, sale_timesheet,
The purpose of this commit is to improve the UX of the project and timesheet app
So in this commit done following changes:
- In the timesheet time off form view changes the label from
timesheet to timesheets
- In the timesheet list view added a 'no_open' option on the SOL field to
make not be clickable
- In project form view removed the 'quick' create option from the
user_id field
- In project task form view added a 'no_open' option on the SOL field to
make not be clickable
- Color of the Gantt and calendar views in project app
My Tasks:
the color used should be according to the personal stage set on the task.
All tasks:
the color used should be according to the project set on the task.
When the user clicks on a project in the main view of Project app:
the color used should be according to the stage.
task-3125942
closesodoo/odoo#111688
Related: odoo/enterprise#36615
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
closesodoo/odoo#115265
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit when user create a global without calendar then
it'll not create any timesheets for any employee but global leave
without calendar is taken as leave global leave for all calendar
in that company's calendar and should create timesheet for all
calendars employee in company.
This commit create timesheets for all calendars employee in that
company if global leave does not have specific calendar set on it.
task-2969791
Part-of: odoo/odoo#100141
With this commit, we allow _timesheet_preprocess to accept a list of
dict of values instead of dict of values.
This represents an important gain in performance.
With 6 projects, 17 tasks/project, 10 timsheet vals/task = 1020 'vals':
Queries : reduced from 110 to 7.
Time : divided by ≃2.5.
task-3030942
closesodoo/odoo#103458
Related: odoo/enterprise#32967
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Purpose
=======
Add a new type on the working schedule, adding "Lunch" to Morning and Afternoon. It's mandatory,
because, if you don't do that, you can't assume the difference between a time that should be
recorded as extra hours and a time that should not be counted because it's lunch time.
A company is not another, so to be clear, they will define what are the imposed lunch time
where the employee is not paid during the week.
Specification
=============
Lunch between Morning and Afternoon
When a time period is under Lunch :
- There is no working entry generated for that period of time.
- If you work before the lunch time and after it, it's not considered as extra time.
- The employee is not paid for the Lunch time.
TaskID: 3102363
This is mostly a cleaning/refactoring change.
The current API for init hooks (pre, post, uninstall) is to pass
`cr, registry`.
But the first thing which was done by most
post init and uninstall hooks was to create an env using
the cr passed
e.g.
`env = api.Environment(cr, SUPERUSER_ID, {})`
and the `registry` argument was unused in all these hooks,
completely.
By changing the API of hooks to pass `env` instead
of `cr, registry`, we gain in average two lines in every
hooks:
- the line creating the env `env = api.Environment(cr, SUPERUSER_ID, {})`
- the line importing `api` and `SUPERUSER_ID`
Therefore removing ~250 lines of repeated code lines accross odoo/odoo and
odoo/enterprise.
In addition to these lines removed,
it also ease the API of init hooks for Odoo developers,
who are used to that `env` and not so much how to create an `env`
from a cursor.
Part-of: odoo/odoo#108254
Purpose of this PR to do generic improvement for timesheet apps.
So in this PR done following improvements:
- add information about project section on time off type form view so user can better
understand time off and timesheets relation.
- display 'view timesheets' as button instead of link in sale order portal view.
- add time off link to project settings's time off section so user can easily navigate to
understand link b/w time off and project apps.
- prevent user to create new timesheet for non active employee by adding context
depending on employee's active state.
task-2983879
closesodoo/odoo#106047
Related: odoo/enterprise#34171
Related: odoo/upgrade#4056
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
-steps to reproduce:
do a search in project.task on is_timeoff_task when no
timesheet_task_id is defined on any hr.leave_type.
This will trigger the _search_is_timeoff_task method
-before this commit:
crash when no leave_type with timesheet_task_id is found
-after this commit:
creation of an empty list as expected
opw-3086486
closesodoo/odoo#110091
X-original-commit: b98949b1cb85514ee5a56ff1a5860591c10b0994
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
_* = project_timesheet_holidays
Before this commit checking validation for creating and writing
on timesheet done in create and write method which makes
customization difficult for user.
So, in this commit check validation for creating and writing on
timesheet done in separate method _check_can_create and
_check_can_write respectively for timesheet.
task-2928942
closesodoo/odoo#100943
Related: odoo/enterprise#31689
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>
This commit make timesheet page of tasks related to time off types readonly
so user can not create,update or delete timesheets create by leaves
task-2888607
closesodoo/odoo#96359
Related: odoo/enterprise#29678
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
_* = project_timesheet_holidays
Currently, if the timesheet is associated with timeoff and it is deleted, a
user error occurs.
In this commit, RedirectWarning will appear instead of user error, so it can be
redirected to the timeoff linked to the timesheet.
task-2888607
Part-of: odoo/odoo#96359
In this commit before, timesheets are not generated for approved time off. So we
have entered the timesheet regarding the approved time off.
task-2960247
closesodoo/odoo#103071
Signed-off-by: Xavier Bol (xbo) <xbo@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>
Issue:
When creating time off timesheet from the timesheet app,the newly
created timesheet is connected to a leave request while it shouldn't
be linked to any leave request and in consequence you can only delete
this new timesheet by deleting the leave request.
Explanation:
To create the new timesheet timesheet_grid makes a copy of another
timesheet on the same line and that makes that the holiday_id (used
to link timesheet and leave request) is also copied.
Solution:
When copying a timesheet the holiday_id is not copied
opw-2951062
closesodoo/odoo#100211
X-original-commit: e1e6ba48bb43ebfe9644368287f9bdf2fd1d561c
Related: odoo/enterprise#31347
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps to reproduce
------------------
1) Install project_timesheet_holidays and mrp.
2) Go to Manufacturing > Settings and enable Work Orders.
3) Log in as a user with access rights to Manufacturing but no access rights to HR.
4) Create a Manufacturing Order with a Work Order.
5) Go to Operations > Work Order and start the Work Order.
5) Click on "Done", you should get an AccessRight error.
---
This commit fixes this error by calling sudo before creating the timesheet leaves for each employee.
Follow-up of https://github.com/odoo/odoo/pull/94414closesodoo/odoo#99174
X-original-commit: 13718d26bb98713f5a533c1a53c7fc2c2abfaac2
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Larcin Vincent (vila) <vila@odoo.com>
This revision is to make uniform the behavior of the `groups` attribute
on the Python model fields
and on the node in the view architecture.
In both cases, remove the node from the view completely.
Before this revision,
in a back-end view:
- In the Python model, if a field has the `groups` attribute set
and the user is not part of
the groups, the field is removed, completely, from the view.
- In the view architecture, if a node has the `groups` attribute set
and the user is not part of
the groups, the node is made invisible (not completely removed, just
made invisible).
in a front-end view:
- if a node has a "groups" or "t-groups" set and the user
is not part of the groups, the node is removed from the view.
So it's 2/3 cases removing nodes restricted to a group.
and 1/3 case making invisible nodes restricted to a group.
It's simpler to have a uniform behavior for the 3 cases,
simpler to understandard for developers.
In addition, this will help for the goal to cache back-end views.
It makes possible to convert views using the `groups_id` field
by moving the content of these views directly
in the view to which they add content which is suppose to be completely
removed when the user has not the according group.
By getting rid of the `groups_id` many2many field on `ir.ui.view`,
it makes possible to cache the view architecture without
requiring to use the groups in the cache key.
Currently, if we want to cache the view architecture,
it would be required to use the intersection of the user
groups with the `groups_id` groups of the view,
making it costly to compute the cache key,
therefore altering the performance point to cache the view
architectures.
closesodoo/odoo#95729
Related: odoo/enterprise#29592
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
This commit prevent user write on time off timesheets and create timesheet
on time off tasks and add test for this feature.
task-2826265
Part-of: odoo/odoo#90744
Steps to reproduce:
- Install Time off and timesheet modules
- Create a public holiday with no "working hours"
- Then edit it and add it with working hours used by some employees
Expected behavior:
Adding the working hours makes that the global time off meets the
requirements to create timesheets. Then the employee related to the
new "working hours" is going to have timesheets created for this
holiday.
Current behavior:
No timesheet is created.
Explanation:
The write function of the global time off only updated timesheets
when the dates where modified. We add the update in the calendar_id
modification case and with it the new conditions to create the
timesheets. (working hours = calendar_id)
opw-2879882
closesodoo/odoo#96226
X-original-commit: a255a743b5296570aab166a5e275a323a1792b60
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Before this commit, when the test is launched at the end of the working
date, the first global time off created will start at the end of the
next Monday and so no timesheet will be generated for this day.
This commit adds a `freeze_time` for this test to have the expected
behavior. That is, a timesheet should be generated per global time off
created.
closesodoo/odoo#95658
X-original-commit: 6a72c81b5b435fc79e139531a8b38d97ed04e994
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
Before this commit, when the employee is generated with the salary
configurator, the employee is archived since the employee will not
directly start in the company. Even if the employee is archived and the
timesheets are generated for this employee based on the global time offs
found in the future. The problem is the timesheets cannot be created
for archived employees and so a user error is raised.
This problem could also happen if the user creates an archived employee.
This commit fixes the issue by preventing the timesheets generation when
the employee created is archived. When this employee will be updated and
active field will be set to True, the timesheets generation will be
applied. In the inverse use case, when the user will archive an employee
and timesheets generated for the future global time offs will be removed.
opw-2887727
opw-2870739
closesodoo/odoo#95644
X-original-commit: 160afba28d88ddd9d84856cc90639586bc2ea7b6
Related: odoo/enterprise#29273
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Remove most values uselessly specified because giving the same value as
the default one (see _DEFAULT_MANIFEST in odoo/modules/module.py)
* auto_install is Falsy by default
* author is Odoo SA by default
* summary & description are empty strings by default
* application is False by default
* test, demo, depends and data are empty lists by default
This will reduce noise/inconsistencies between manifests specifications,
simplify analysis of manifests content, ...
closesodoo/odoo#90209
Related: odoo/enterprise#26807
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Before this commit, in time off form view, task field contains the private task.
So this commit fixes the issue by not displaying the private task in task field
of time off form view.
task-2733415
closesodoo/odoo#89674
X-original-commit: 76fcd0cfe5fc157f22825544e239f283831b49fd
Related: odoo/enterprise#26611
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Before this commit, when the user cancels his validated time off planned
in the future, the timesheets generated for this time off are not
deleted. The problem is since the timesheets are not removed we could
have duplicated timesheets if the user adds a new time off in the same days
for instance, because the newest timesheets are generated and thus we have
duplicated timesheets generated instead of having only timesheets generated
for the newest time off.
This commit removes the timesheets generated for the time off when this
time off is canceled (=archived). Also, It also prevent the user to
manually unarchive the time off since this operation is not really
managed and could introduced eventual problems.
Related PR: #76722
Part of task-2791386
closesodoo/odoo#89246
X-original-commit: a9e63ebe32079e2215acafcd4bca15b371ee9bc2
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
Co-authored-by: William Braeckman <wbr@odoo.com>
This commit modifies most of the usages of read_group and uses
_read_group instead. _read_group doesn't join automatically on the
many2one fields when no order_by is specified, making it more performant
when the "name" of the many2one is not relevant, which is the case for
most back-end cases
closesodoo/odoo#84908
Task-id: 2479334
Related: odoo/enterprise#24877
Signed-off-by: Raphael Collet <rco@odoo.com>
Purpose
=======
The existing timesheets linked to a time off are unlinked once the
time off is refused (which is the only action on the interface for
validated time off).
But nothing prevents to set in a python code a time off directly
in draft to validate it afterward.
In that case, the timesheet is duplicated and is impossible to unlink
as this is forbidden for timesheets linked to a time off.
Specification
=============
Make sure before creating timesheets linked to a time off that there
is not remaining linked timesheets.
On the other hand, modify the method to generate the timesheets in batch.
X-original-commit: 46a3394b960ba344d49a4e99ae5a6a7d7392dbf6
Part-of: odoo/odoo#84269
Before this commit, we search the leaves in the same interval of the
public leaves.
This commit searches all leaves containing the public leave in their
interval to get all leaves and not create a timesheet for this public
leave for an employee is already off.
task-2665899
closes#79034
X-original-commit: ca6c164075d83e6bace2451888f8a2365b769e1a
Part-of: odoo/odoo#79291
Description of the issue/feature this PR addresses:
A traceback appears when a time off is at the second approval stage and approved with several employees assigned to the time off.
https://www.awesomescreenshot.com/video/5408638
Current behavior before PR:
When validating a time off that is in the second approval stage with several employees assigned to, a traceback appears
Desired behavior after PR is merged:
No traceback appears when validating a time off that is in the second approval stage with several employees assigned to
task-2657656
closesodoo/odoo#77625
X-original-commit: aaa7c5bf10089eb8953f46cccb2e93aa3a20fa35
Signed-off-by: Kevin Baptiste <kba@odoo.com>
General fixes for usability
- Time off type configuration visual : https://tinyurl.com/yj2z6okp
- When you create an allocation, the end date should have a place holder "no limit". If there is no end date recorded, that value should be displayed on loading.
- In Overview, remove filter "people i manage"
- In Approvals / time off : change filters : https://i.imgur.com/uDNjZv8.png
- In Approvals / approvals : change filters like in point 5 (remove people I manage replace with my team)
- In Reporting / By Employee : filters : https://tinyurl.com/yg3u3rkf
- In Reporting / By Type : filters : https://tinyurl.com/yhbpgz5m
- Remove Allocations smartbutton from Employee App
- When you click on TimeOff Smartbutton from Employee App, you should be redirect to this screen : https://tinyurl.com/ygwxzx5b
- When an allocation is created, the validity is added to the name of the allocation like "Allocation X (validity Date --> Date) and hide the validity field in "My allocations".
- Users will have the information of the validity from the name of the allocation
task-2643692
closesodoo/odoo#77376
X-original-commit: 7f92c830d3607167bd76bc43d992fbf720a3ef29
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The purpose of this task is to improve the setting of the timesheet module.
In this commit, we improve the following:
- Rename the label, description and align the field with the name and
description of the feature
- Add an 'OK' button in the 'download our app' modal
- Render the frequency field properly in the employee/manager reminders
setting on mobile view
- In configure your services link: change the name of the action to "Services"
- Display the following options in the community, with the usual 'Enterprise'
tag: Round Timesheet, Employee/Manager reminder, Invoicing Policy
closesodoo/odoo#74967
Task-id: 2531338
Related: odoo/enterprise#20182
Related: odoo/upgrade#2771
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Purpose
=======
Time Off : New Dashboard, Accruals feature, Public holidays, New time off type configuration view.
- Review of Dashboard
- Accrual feature : Currently, when you create an allocation, it's possible to create an
Accrual, but there is no appraisal Plan. An Appraisal plan is use to define steps of accruals
for each employee.
In Belgium, we use accrual Allocation for European Leaves, or compensatory hours, it's a
simple use case. But in USA, it's possible to change the calculation mode each year.
Also, in USA, it's possible to deal your accrual plan when you arrive on the company. It's a
HR Officer task to create the right Accrual allocation for each new employee.
- Public Holidays :
Improvement of global time off feature located on Working hours calendar. Now, Time off
application have to manage Public Holidays.
- Review of Time Off type configuration
COM PR: https://github.com/odoo/odoo/pull/72511
ENT PR: https://github.com/odoo/enterprise/pull/19157
UPG PR: https://github.com/odoo/upgrade/pull/2791
TaskID:2475413
closesodoo/odoo#72511
Related: odoo/enterprise#19157
Related: odoo/upgrade#2791
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: William Braeckman <wbr@odoo.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
Generate timesheet entries for each employee when a global time off is created
if module_project_timesheet_holidays is true.
This only impacts the employees with the corresponding resource calendar
The entries are linked to the project and task set in the settings.
The number of hours timesheeted corresponds to the timeframe during which both the global time off
and the working hours of the employee overlap (same behavior as for regular time off).
If the global time off is modified or deleted, the timesheet entry is adapted accordingly.
Task-2352428
Closes#67021
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
Co-authored-by: jdoutreloux <jud@odoo.com>
off.
When validating a time off with a company-less time off type, if the
time off type is configured to create timesheet entries in a project, a
multi-company security rule could be triggered by accessing the project.
We now check that the company of the task is valid in the current
context (it would make no sense to have an employee work on a task from
another company anyway) before creating the timesheets.
Closesodoo/odoo#75308
Task ID: 2628148
closesodoo/odoo#75579
X-original-commit: 29662626f7d67480926fbb12986ca644d213151c
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Purpose of the commit is to improve the usability and onboarding
of the project app.
So in this commit, done the below changes:
- Rename column "Kanban state" in list view screens
- Hide column "analytic account" when not needed
- Do not show "Internal" project
PS: Moved leave_timesheet_project_id into hr_timesheet and rename
it as internal_project_id and we used it in the domain in the
kanban/action to the kanban in order not to have it in the result.
closesodoo/odoo#68857
Taskid: 2451722
Related: odoo/upgrade#2479
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>