Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0] [MIG] hr_timesheet_sheet: Migration 18.0 #723

Open
wants to merge 157 commits into
base: 18.0
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
33edf82
[11.0][MIG] hr_timesheet_sheet (#125)
MiquelRForgeFlow Jun 18, 2018
deb6bf7
Translated using Weblate (Japanese)
yostashiro Jun 19, 2018
d9bbabe
Translated using Weblate (Português (Brasil))
Jun 20, 2018
2161d54
[11.0][hr_timesheet_sheet]: allow to display more than 40 cells
JordiBForgeFlow Jul 26, 2018
e3fae83
hr_timesheet_sheet: add menu 'Timesheet Sheets to Approve'
JordiBForgeFlow Jul 30, 2018
85a34b2
hr_timesheet_sheet: pass selected project context to task creation
JordiBForgeFlow Aug 2, 2018
2f3df73
[11.0][IMP] hr_timesheet_sheet: ease extensions (#131)
astirpe Sep 11, 2018
d0ad37c
Fix task domain and default project_id
astirpe Sep 20, 2018
dff3a08
Bump version
astirpe Sep 20, 2018
f9dd767
[IMP] hr_timesheet_sheet ux
astirpe Sep 20, 2018
9fec78f
Code review
astirpe Sep 20, 2018
3273311
Update contributors list
astirpe Sep 20, 2018
fbb0184
[FIX] hr_timesheet_sheet: "Refuse" button name (#134)
astirpe Oct 1, 2018
48baa70
[11.0][IMP] hr_timesheet_sheet: merge hr_timesheet_sheet_week_start_d…
LoisRForgeFlow Oct 17, 2018
c687fe0
restrict selection of projects to those that have 'allow_timsheets' set
JordiBForgeFlow Nov 5, 2018
ad4a4ca
[MIG] hr_timesheet_sheet: Migration to 12.0
alexey-pelykh Nov 9, 2018
450204a
[FIX] hr_timesheet_sheet: Don't fail tests on Sunday
pedrobaeza Dec 9, 2018
2791a46
[IMP] hr_timesheet_sheet: more extendability & cleanup
alexey-pelykh Dec 11, 2018
240eae3
[FIX] Fix related fields in hr_timesheet_sheet
AdriaGForgeFlow Dec 18, 2018
db0f2ca
[FIX] hr_timesheet_sheet: who approves timesheets should be the manager
MiquelRForgeFlow Dec 17, 2018
08e558a
[FIX]hr_timesheet_sheet : fix singleton error in _compute_line_ids
bizzappdev Dec 27, 2018
4a0d5e2
[FIX] timesheet sheet lines inconsistency
astirpe Jan 17, 2019
832e836
[FIX] hr_timesheet_sheet: unlink only generated AAL
alexey-pelykh Feb 15, 2019
daf5e1b
[IMP] hr_timesheet_sheet: texts & formatting
alexey-pelykh Feb 15, 2019
1563bd4
[FIX] hr_timesheet_sheet: sheet_id when modifying the timesheet
astirpe Feb 26, 2019
a70c397
[IMP] hr_timesheet_sheet: protect specific list of fields
alexey-pelykh Feb 26, 2019
430dac4
[FIX] Avoid cleaning when set to draft
MiquelRForgeFlow Feb 28, 2019
7c1dbff
[IMP] Make a constant for the '/' name for empty lines
MiquelRForgeFlow Feb 27, 2019
81786ef
[FIX] Correctly handle partial amounts of timesheets
MiquelRForgeFlow Feb 18, 2019
366953a
[IMP] Rename method / parameters to a better descriptive name
MiquelRForgeFlow Feb 18, 2019
6063583
hr_timesheet_sheet: version bump
alexey-pelykh Mar 5, 2019
b8f2bea
[FIX] Wrong decorator
astirpe Mar 8, 2019
5b0070f
Translated using Weblate (Dutch)
Mar 23, 2019
8855fe4
[IMP] hr_timesheet_sheet: fix amount calculation issues + code simpli…
astirpe Mar 25, 2019
a05b8c3
[FIX] Add lines of other employees
astirpe Mar 28, 2019
0d8b6d8
[FIX] hr_timesheet_sheet: sheet name
alexey-pelykh Mar 26, 2019
cc905ca
[12.0][FIX] hr_timesheet_sheet: subscribe user when confirm (#227)
astirpe Apr 3, 2019
7988280
[FIX] Allow timesheet sheet when employee's company is not set
astirpe Mar 27, 2019
e136b31
[ADD] Constraint company_id in timesheet sheet line
astirpe Mar 25, 2019
0acaa60
[ADD] company_id in blacklist of timesheet sheet line
astirpe Mar 25, 2019
4329010
[REM] Obsolete constraint
astirpe Mar 25, 2019
6ce2749
[FIX] Consistency of company on projects and employees
astirpe Mar 28, 2019
520d047
[IMP] hr_timesheet_sheet: Clearer interface
tarteo Apr 25, 2019
d73356c
[FIX] hr_timesheet_sheet: tests
alexey-pelykh May 1, 2019
d9d0aa4
[FIX] hr_timesheet_sheet: consistency with v11
alexey-pelykh May 2, 2019
3fdd28b
[FIX]hr_timesheet_sheet : unit amount will display in formate hr:minute
bizzappdev Feb 18, 2019
b767d21
[FIX] Don't create analytic lines in onchange
MiquelRForgeFlow Apr 11, 2019
9a3662a
[FIX] Tests
MiquelRForgeFlow Apr 11, 2019
7efc9c3
[IMP] hr_timesheet_sheet: more hooks
alexey-pelykh Jul 1, 2019
c79ae03
Translated using Weblate (German)
marylla Jul 10, 2019
6d2dc57
Translated using Weblate (German)
marylla Jul 31, 2019
cb4c445
[FIX] Expected singleton
astirpe Jul 12, 2019
a77a840
[12.0][FIX] Do not remove lines when removing the timesheet sheet
astirpe Jul 30, 2019
9cddae5
Translated using Weblate (German)
marylla Aug 8, 2019
6a5eb73
Translated using Weblate (Portuguese (Brazil))
britoederr Oct 10, 2019
6da8490
[IMP] hr_timesheet_sheet: review policy
alexey-pelykh May 21, 2019
ca0c67a
[FIX] hr_timesheet_sheet: remove non-existent models
alexey-pelykh Nov 5, 2019
1539b3f
[IMP] hr_timesheet_sheet: error details
alexey-pelykh Nov 7, 2019
9c62522
[ADD] hr_timesheet_sheet: policies
alexey-pelykh Nov 12, 2019
19a0e35
Translated using Weblate (Spanish)
chienandalu Nov 26, 2019
e516b7b
Translated using Weblate (Italian)
primes2h Nov 29, 2019
347edc2
Translated using Weblate (German)
marylla Dec 9, 2019
d7c33e4
[IMP] hr_timesheet_sheet: allow employee to review own non-submitted …
alexey-pelykh Dec 4, 2019
9288c43
Translated using Weblate (German)
marylla Dec 10, 2019
9f65e96
[FIX] hr_timesheet_sheet_policy*: admin always reviewer
astirpe Dec 23, 2019
e404e36
[FIX] hr_timesheet_sheet: don't store possible_reviewer_ids
alexey-pelykh Dec 23, 2019
c2a0c53
[FIX] Clean/merge timesheets when in draft only
astirpe Jan 29, 2020
df3469b
[FIX] hr_timesheet_sheet: same week in different years is still same
alexey-pelykh Jan 31, 2020
ef67331
[FIX] hr_timesheet_sheet: use unique IDs in line generation
alexey-pelykh Dec 28, 2019
b85850f
Translated using Weblate (Spanish)
pedrobaeza Feb 6, 2020
f9374b9
[IMP] hr_timesheet_sheet: hooks
alexey-pelykh Feb 6, 2020
471f2bf
[IMP] hr_timesheet_sheet: add id to allow modules add options
alexey-pelykh Feb 11, 2020
9e224e7
hr_timesheet_sheet: fix FR translation that trigger a crash
alexis-via Feb 11, 2020
0dd43f6
[IMP] hr_timesheet_sheet: add kanban view
alexey-pelykh Feb 12, 2020
7da4e66
Translated using Weblate (Italian)
Feb 13, 2020
6ddd587
[IMP] hr_timesheet_sheet: _get_subscribers hook
alexey-pelykh Feb 14, 2020
ae449e4
[FIX] hr_timesheet_sheet: lost kanban mode
alexey-pelykh Feb 14, 2020
54b0c5e
Translated using Weblate (Dutch)
Apr 3, 2020
25f13b7
[FIX] hr_timesheet_sheet: drop fuzzy+python-format translations
alexey-pelykh Apr 3, 2020
b3d489c
[IMP] : black, isort
Mar 2, 2020
7d465f5
[MIG] hr_timesheet_sheet: Migration to 13.0
Mar 2, 2020
61332ee
[IMP] hr_timesheet_sheet: black, isort, prettier
MiquelRForgeFlow Apr 6, 2020
805f815
[MIG] hr_timesheet_sheet: Migration to 13.0 (complete)
MiquelRForgeFlow Apr 3, 2020
09735ad
[FIX] hr_timesheet_sheet: openupgrade
alexey-pelykh Apr 12, 2020
e0b1806
[FIX] failing tests, linting
May 22, 2020
0791c31
Translated using Weblate (French)
pedrobaeza Oct 14, 2020
816c8aa
[FIX] hr_timesheet_sheet WARNING DB odoo.osv.expression: The domain …
vishalaktiv Oct 20, 2020
abd6561
[UPD] Brainbean Apps => CorporateHub
alexey-pelykh Nov 8, 2020
99f6b85
[FIX] hr_timesheet_sheet: Add review policies for other groups
pedrobaeza Aug 18, 2020
4fed3b4
[FIX] Typo
ypapouin Dec 14, 2020
57d14df
Translated using Weblate (Dutch)
tarteo Feb 11, 2021
baac8f6
[IMP] hr_timesheet_sheet: black, isort, prettier
schhatbar-initos Mar 9, 2021
8484ed7
[14.0][MIG]hr_timesheet_sheet
schhatbar-initos Mar 9, 2021
6847e04
Added translation using Weblate (French (France))
Yvesldff Apr 10, 2021
c51b104
Translated using Weblate (French (France))
Yvesldff Apr 10, 2021
34d09e3
Translated using Weblate (French (France))
Yvesldff Apr 11, 2021
0a8e82d
Translated using Weblate (German)
OSevangelist May 5, 2021
a5f317d
Translated using Weblate (French)
Yvesldff May 14, 2021
037de31
[14.0] [FIX] hr_timesheet_sheet Week %s translation
innovara Jul 21, 2021
ace252d
[IMP] hr_timesheet_sheet: Screenshot added for quick understanding
tarbib Oct 11, 2021
56d1c33
Translated using Weblate (Swedish)
simonstromb Nov 15, 2021
878df30
Translated using Weblate (Swedish)
simonstromb Nov 16, 2021
12ffb9c
Translated using Weblate (Swedish)
simonstromb Nov 22, 2021
8b48b2c
Translated using Weblate (Swedish)
simonstromb Nov 23, 2021
6a00c30
Translated using Weblate (Swedish)
simonstromb Nov 30, 2021
40085c3
Translated using Weblate (Swedish)
simonstromb Nov 30, 2021
a9c0c5b
Translated using Weblate (Dutch)
bosd Feb 1, 2022
3787790
Translated using Weblate (Dutch)
bosd Feb 8, 2022
acd67d2
Do not merge invoiced timesheet lines
Oct 13, 2021
c2a4ce2
Do not try to remove invoiced lines
Jun 15, 2021
209847a
[FIX] hr_timesheet_sheet: Add sale_timesheet dependency (timesheet_in…
victoralmau Apr 12, 2022
78a86d1
[IMP] hr_timesheet_sheet: black, isort, prettier
CRogos Apr 22, 2022
452216d
[MIG] hr_timesheet_sheet: Migration to 15.0
CRogos Apr 22, 2022
bae40f8
Fix python-format translation issues.
Sep 19, 2022
cd196bb
Translated using Weblate (French)
vincent-hatakeyama Oct 5, 2022
8451d47
Translated using Weblate (Portuguese (Brazil))
douglascstd Oct 12, 2022
a45e376
Translated using Weblate (Italian)
mymage Dec 28, 2022
c8b3620
Translated using Weblate (Italian)
mymage Jan 9, 2023
d90de60
Translated using Weblate (Italian)
francesco-ooops Jan 10, 2023
36caf42
Translated using Weblate (Italian)
mymage Jan 26, 2023
bade1ae
[IMP] hr_timesheet_sheet: timesheet_sheet_ids on hr.employee
carmenbianca Jun 3, 2022
0ab8d3b
[MIG] hr_timesheet_sheet: Migration to 16.0
tarteo Mar 21, 2023
ac9709a
Fix for https://github.com/odoo/odoo/pull/120597
tarteo Jun 29, 2023
0f1b8dc
Translated using Weblate (Italian)
mymage Jul 8, 2023
d8192e1
Translated using Weblate (Italian)
mymage Jul 13, 2023
b393815
Translated using Weblate (Italian)
francesco-ooops Jul 28, 2023
c892cb4
Translated using Weblate (Italian)
mymage Aug 8, 2023
a5abd45
Translated using Weblate (Spanish)
Ivorra78 Aug 27, 2023
9163011
Translated using Weblate (Italian)
mymage Aug 22, 2023
c6ad122
Translated using Weblate (Italian)
mymage Sep 4, 2023
1b57e66
Translated using Weblate (Spanish)
Ivorra78 Sep 15, 2023
a4f4e0e
Translated using Weblate (Spanish)
Ivorra78 Sep 20, 2023
886a655
[FIX] hr_timesheet_sheet: `image_128` -> `avatar_128`
MiquelRForgeFlow Oct 10, 2023
ab09434
Translated using Weblate (Italian)
mymage Oct 10, 2023
b2ccbdb
Translated using Weblate (Italian)
mymage Oct 11, 2023
761caa1
Translated using Weblate (Italian)
francesco-ooops Oct 13, 2023
3aeb05b
Translated using Weblate (Portuguese (Brazil))
adrianojprado Oct 27, 2023
40a03a1
Translated using Weblate (French)
remi-filament Nov 6, 2023
492df25
Translated using Weblate (Catalan)
pere-aquarian Nov 18, 2023
41eb08c
Translated using Weblate (Italian)
mymage Nov 23, 2023
14d34d5
Translated using Weblate (Italian)
mymage Jan 22, 2024
a46fac2
Translated using Weblate (Swedish)
jakobkrabbe Feb 26, 2024
0479e8b
[16.0][FIX] hr_timesheet_sheet: permissions on access to menus
LauraCForgeFlow Mar 5, 2024
25adf8b
[16.0][FIX] hr_timesheet_sheet: update translations (Spanish)
LauraCForgeFlow Mar 5, 2024
cb42fd6
Translated using Weblate (Italian)
mymage Mar 14, 2024
1ead121
[FIX] hr_timesheet_sheet: Don't merge timesheets during onchange
hbrunn Mar 27, 2024
259e9ac
Translated using Weblate (Portuguese)
pedrocs-exo May 1, 2024
1717d1d
Translated using Weblate (Portuguese)
pedrocs-exo May 1, 2024
efb281b
Translated using Weblate (Portuguese (Brazil))
May 20, 2024
45084e5
[REF][16.0] hr_timesheet_sheet: separate class for setUpClass
bealdav Aug 19, 2024
8b3dc54
[FIX] hr_timesheet_sheet: deal with time off line
maisim Sep 10, 2024
ca3795f
[IMP] hr_timesheet_sheet: pre-commit auto fixes
Vijaiy-Selvaraj Oct 18, 2024
e21834c
[MIG] hr_timesheet_sheet: Migration to 17.0
Vijaiy-Selvaraj Oct 18, 2024
588fcba
[IMP] hr_timesheet_sheet: _check_can_write on account.analytic.line a…
Vijaiy-Selvaraj Oct 18, 2024
fe5dbed
[IMP] hr_timesheet_sheet: pre-commit auto fixes
Borruso Nov 26, 2024
c3e2d29
[MIG] hr_timesheet_sheet: Migration to 18.0
Borruso Nov 26, 2024
9fd914c
[DON'T MERGE] test-requirements.txt
Borruso Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions hr_timesheet_sheet/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
==================
HR Timesheet Sheet
==================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fe97bb62b31b55f4ba1245097af703d3e6dc16416ef31f15dc7364171677c9b1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ftimesheet-lightgray.png?logo=github
:target: https://github.com/OCA/timesheet/tree/18.0/hr_timesheet_sheet
:alt: OCA/timesheet
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/timesheet-18-0/timesheet-18-0-hr_timesheet_sheet
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/timesheet&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module supplies a new screen enabling you to manage your work
encoding (timesheet) by period. Timesheet entries are made by employees
each day. At the end of the defined period, employees submit their
validated sheet and the reviewer must then approve submitted entries.
Periods are defined in the company forms and you can set them to run
monthly, weekly or daily. By default, policy is configured to have HR
Officers as reviewers.

**Table of contents**

.. contents::
:local:

Installation
============

This module relies on:

- The OCA module '2D matrix for x2many fields', and can be downloaded
from Github:
https://github.com/OCA/web/tree/16.0/web_widget_x2many_2d_matrix

Configuration
=============

If you want other default ranges different from weekly, you need to go:

- In the menu Configuration -> Settings -> **Timesheet Options**, and
select in **Timesheet Sheet Range** the default range you want.
- When you have a weekly range you can also specify the **Week Start
Day**.

To change who reviews submitted sheets, go to *Configuration > Settings
> Timesheet Options* and configure **Timesheet Sheet Review Policy**
accordingly.

For adding more review policies, look at the
*hr_timesheet_sheet_policy_xxx* extra modules.

Usage
=====

If you modify the Details tab, automatically the Summary tab is updated.
But if you modify the Summary tab, you need to save in order to have the
Details tab updated.

In case you modify the unit amount of both tabs, the Details tab will
prevail. If you modify the Summary tab, and you need to do a change in
the Details tab, please save before.

Known issues / Roadmap
======================

- The timesheet grid is limited to display a max. of 1M cells, due to a
limitation of the tree view limit parameter not being able to
dynamically set a limit. Since default value of odoo, 40 records is
too small, we decided to set 1M, which should be good enough in the
majority of scenarios.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/timesheet/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/timesheet/issues/new?body=module:%20hr_timesheet_sheet%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ForgeFlow
* Onestein
* CorporateHub

Contributors
------------

- Miquel Raïch <miquel.raich@forgeflow.com>
- Andrea Stirpe <a.stirpe@onestein.nl>
- Lois Rilo <lois.rilo@forgeflow.com>
- `CorporateHub <https://corporatehub.eu/>`__

- Alexey Pelykh <alexey.pelykh@corphub.eu>

- Dennis Sluijk <d.sluijk@onestein.nl>
- Sunanda Chhatbar <sunanda.chhatbar@initos.com>
- `Sodexis <https://www.sodexis.com>`__

- SodexisTeam <dev@sodexis.com>
- Sowrirajan <sowrirajan@sodexis.com>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/timesheet <https://github.com/OCA/timesheet/tree/18.0/hr_timesheet_sheet>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions hr_timesheet_sheet/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
from . import report
29 changes: 29 additions & 0 deletions hr_timesheet_sheet/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2018 ForgeFlow (https://www.forgeflow.com)
# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com)
# Copyright 2018-2019 Onestein (<https://www.onestein.eu>)
# Copyright 2020 CorporateHub (https://corporatehub.eu)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "HR Timesheet Sheet",
"version": "18.0.1.0.0",
"category": "Human Resources",
"sequence": 80,
"summary": "Timesheet Sheets, Activities",
"license": "AGPL-3",
"author": "ForgeFlow, Onestein, CorporateHub, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/timesheet",
"installable": True,
"auto_install": False,
"depends": ["hr_timesheet", "sale_timesheet", "web_widget_x2many_2d_matrix"],
"data": [
"data/hr_timesheet_sheet_data.xml",
"security/ir.model.access.csv",
"security/hr_timesheet_sheet_security.xml",
"views/hr_timesheet_sheet_views.xml",
"views/hr_department_views.xml",
"views/hr_employee_views.xml",
"views/account_analytic_line_views.xml",
"views/res_config_settings_views.xml",
],
}
19 changes: 19 additions & 0 deletions hr_timesheet_sheet/data/hr_timesheet_sheet_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>
<!-- Timesheet sheet related subtypes for messaging / Chatter -->
<record id="mt_timesheet_confirmed" model="mail.message.subtype">
<field name="name">Waiting Review</field>
<field name="res_model">hr_timesheet.sheet</field>
<field name="default" eval="True" />
<field name="description">Waiting review</field>
</record>
<record id="mt_timesheet_approved" model="mail.message.subtype">
<field name="name">Approved</field>
<field name="res_model">hr_timesheet.sheet</field>
<field name="default" eval="True" />
<field name="description">Approved</field>
</record>
</odoo>
1,149 changes: 1,149 additions & 0 deletions hr_timesheet_sheet/i18n/af.po

Large diffs are not rendered by default.

1,125 changes: 1,125 additions & 0 deletions hr_timesheet_sheet/i18n/am.po

Large diffs are not rendered by default.

1,232 changes: 1,232 additions & 0 deletions hr_timesheet_sheet/i18n/ar.po

Large diffs are not rendered by default.

1,175 changes: 1,175 additions & 0 deletions hr_timesheet_sheet/i18n/bg.po

Large diffs are not rendered by default.

1,170 changes: 1,170 additions & 0 deletions hr_timesheet_sheet/i18n/bs.po

Large diffs are not rendered by default.

1,323 changes: 1,323 additions & 0 deletions hr_timesheet_sheet/i18n/ca.po

Large diffs are not rendered by default.

1,199 changes: 1,199 additions & 0 deletions hr_timesheet_sheet/i18n/cs.po

Large diffs are not rendered by default.

1,243 changes: 1,243 additions & 0 deletions hr_timesheet_sheet/i18n/da.po

Large diffs are not rendered by default.

1,393 changes: 1,393 additions & 0 deletions hr_timesheet_sheet/i18n/de.po

Large diffs are not rendered by default.

1,180 changes: 1,180 additions & 0 deletions hr_timesheet_sheet/i18n/el.po

Large diffs are not rendered by default.

1,094 changes: 1,094 additions & 0 deletions hr_timesheet_sheet/i18n/en_AU.po

Large diffs are not rendered by default.

1,177 changes: 1,177 additions & 0 deletions hr_timesheet_sheet/i18n/en_GB.po

Large diffs are not rendered by default.

1,435 changes: 1,435 additions & 0 deletions hr_timesheet_sheet/i18n/es.po

Large diffs are not rendered by default.

1,206 changes: 1,206 additions & 0 deletions hr_timesheet_sheet/i18n/es_AR.po

Large diffs are not rendered by default.

1,111 changes: 1,111 additions & 0 deletions hr_timesheet_sheet/i18n/es_BO.po

Large diffs are not rendered by default.

1,123 changes: 1,123 additions & 0 deletions hr_timesheet_sheet/i18n/es_CL.po

Large diffs are not rendered by default.

1,192 changes: 1,192 additions & 0 deletions hr_timesheet_sheet/i18n/es_CR.po

Large diffs are not rendered by default.

1,281 changes: 1,281 additions & 0 deletions hr_timesheet_sheet/i18n/es_EC.po

Large diffs are not rendered by default.

1,173 changes: 1,173 additions & 0 deletions hr_timesheet_sheet/i18n/es_PE.po

Large diffs are not rendered by default.

1,143 changes: 1,143 additions & 0 deletions hr_timesheet_sheet/i18n/es_PY.po

Large diffs are not rendered by default.

1,177 changes: 1,177 additions & 0 deletions hr_timesheet_sheet/i18n/es_VE.po

Large diffs are not rendered by default.

1,190 changes: 1,190 additions & 0 deletions hr_timesheet_sheet/i18n/et.po

Large diffs are not rendered by default.

1,167 changes: 1,167 additions & 0 deletions hr_timesheet_sheet/i18n/eu.po

Large diffs are not rendered by default.

1,170 changes: 1,170 additions & 0 deletions hr_timesheet_sheet/i18n/fa.po

Large diffs are not rendered by default.

1,343 changes: 1,343 additions & 0 deletions hr_timesheet_sheet/i18n/fi.po

Large diffs are not rendered by default.

1,094 changes: 1,094 additions & 0 deletions hr_timesheet_sheet/i18n/fo.po

Large diffs are not rendered by default.

1,363 changes: 1,363 additions & 0 deletions hr_timesheet_sheet/i18n/fr.po

Large diffs are not rendered by default.

1,107 changes: 1,107 additions & 0 deletions hr_timesheet_sheet/i18n/fr_BE.po

Large diffs are not rendered by default.

1,112 changes: 1,112 additions & 0 deletions hr_timesheet_sheet/i18n/fr_CA.po

Large diffs are not rendered by default.

1,150 changes: 1,150 additions & 0 deletions hr_timesheet_sheet/i18n/fr_FR.po

Large diffs are not rendered by default.

1,143 changes: 1,143 additions & 0 deletions hr_timesheet_sheet/i18n/gl.po

Large diffs are not rendered by default.

1,140 changes: 1,140 additions & 0 deletions hr_timesheet_sheet/i18n/gu.po

Large diffs are not rendered by default.

1,140 changes: 1,140 additions & 0 deletions hr_timesheet_sheet/i18n/he.po

Large diffs are not rendered by default.

1,114 changes: 1,114 additions & 0 deletions hr_timesheet_sheet/i18n/hi.po

Large diffs are not rendered by default.

1,329 changes: 1,329 additions & 0 deletions hr_timesheet_sheet/i18n/hr.po

Large diffs are not rendered by default.

1,080 changes: 1,080 additions & 0 deletions hr_timesheet_sheet/i18n/hr_timesheet_sheet.pot

Large diffs are not rendered by default.

1,354 changes: 1,354 additions & 0 deletions hr_timesheet_sheet/i18n/hu.po

Large diffs are not rendered by default.

1,089 changes: 1,089 additions & 0 deletions hr_timesheet_sheet/i18n/hy.po

Large diffs are not rendered by default.

1,246 changes: 1,246 additions & 0 deletions hr_timesheet_sheet/i18n/id.po

Large diffs are not rendered by default.

1,089 changes: 1,089 additions & 0 deletions hr_timesheet_sheet/i18n/is.po

Large diffs are not rendered by default.

1,419 changes: 1,419 additions & 0 deletions hr_timesheet_sheet/i18n/it.po

Large diffs are not rendered by default.

1,330 changes: 1,330 additions & 0 deletions hr_timesheet_sheet/i18n/ja.po

Large diffs are not rendered by default.

1,156 changes: 1,156 additions & 0 deletions hr_timesheet_sheet/i18n/ka.po

Large diffs are not rendered by default.

1,210 changes: 1,210 additions & 0 deletions hr_timesheet_sheet/i18n/kab.po

Large diffs are not rendered by default.

1,126 changes: 1,126 additions & 0 deletions hr_timesheet_sheet/i18n/km.po

Large diffs are not rendered by default.

1,240 changes: 1,240 additions & 0 deletions hr_timesheet_sheet/i18n/ko.po

Large diffs are not rendered by default.

1,132 changes: 1,132 additions & 0 deletions hr_timesheet_sheet/i18n/lo.po

Large diffs are not rendered by default.

1,278 changes: 1,278 additions & 0 deletions hr_timesheet_sheet/i18n/lt.po

Large diffs are not rendered by default.

1,226 changes: 1,226 additions & 0 deletions hr_timesheet_sheet/i18n/lv.po

Large diffs are not rendered by default.

1,231 changes: 1,231 additions & 0 deletions hr_timesheet_sheet/i18n/mk.po

Large diffs are not rendered by default.

1,340 changes: 1,340 additions & 0 deletions hr_timesheet_sheet/i18n/mn.po

Large diffs are not rendered by default.

1,087 changes: 1,087 additions & 0 deletions hr_timesheet_sheet/i18n/mt.po

Large diffs are not rendered by default.

1,128 changes: 1,128 additions & 0 deletions hr_timesheet_sheet/i18n/my.po

Large diffs are not rendered by default.

1,175 changes: 1,175 additions & 0 deletions hr_timesheet_sheet/i18n/nb.po

Large diffs are not rendered by default.

1,097 changes: 1,097 additions & 0 deletions hr_timesheet_sheet/i18n/ne.po

Large diffs are not rendered by default.

1,393 changes: 1,393 additions & 0 deletions hr_timesheet_sheet/i18n/nl.po

Large diffs are not rendered by default.

1,124 changes: 1,124 additions & 0 deletions hr_timesheet_sheet/i18n/nl_BE.po

Large diffs are not rendered by default.

1,265 changes: 1,265 additions & 0 deletions hr_timesheet_sheet/i18n/pl.po

Large diffs are not rendered by default.

1,228 changes: 1,228 additions & 0 deletions hr_timesheet_sheet/i18n/pt.po

Large diffs are not rendered by default.

1,385 changes: 1,385 additions & 0 deletions hr_timesheet_sheet/i18n/pt_BR.po

Large diffs are not rendered by default.

1,242 changes: 1,242 additions & 0 deletions hr_timesheet_sheet/i18n/ro.po

Large diffs are not rendered by default.

1,351 changes: 1,351 additions & 0 deletions hr_timesheet_sheet/i18n/ru.po

Large diffs are not rendered by default.

1,319 changes: 1,319 additions & 0 deletions hr_timesheet_sheet/i18n/sk.po

Large diffs are not rendered by default.

1,238 changes: 1,238 additions & 0 deletions hr_timesheet_sheet/i18n/sl.po

Large diffs are not rendered by default.

1,115 changes: 1,115 additions & 0 deletions hr_timesheet_sheet/i18n/sq.po

Large diffs are not rendered by default.

1,116 changes: 1,116 additions & 0 deletions hr_timesheet_sheet/i18n/sr.po

Large diffs are not rendered by default.

1,159 changes: 1,159 additions & 0 deletions hr_timesheet_sheet/i18n/sr@latin.po

Large diffs are not rendered by default.

1,263 changes: 1,263 additions & 0 deletions hr_timesheet_sheet/i18n/sv.po

Large diffs are not rendered by default.

1,198 changes: 1,198 additions & 0 deletions hr_timesheet_sheet/i18n/th.po

Large diffs are not rendered by default.

1,353 changes: 1,353 additions & 0 deletions hr_timesheet_sheet/i18n/tr.po

Large diffs are not rendered by default.

1,343 changes: 1,343 additions & 0 deletions hr_timesheet_sheet/i18n/uk.po

Large diffs are not rendered by default.

1,175 changes: 1,175 additions & 0 deletions hr_timesheet_sheet/i18n/vi.po

Large diffs are not rendered by default.

1,298 changes: 1,298 additions & 0 deletions hr_timesheet_sheet/i18n/zh_CN.po

Large diffs are not rendered by default.

1,323 changes: 1,323 additions & 0 deletions hr_timesheet_sheet/i18n/zh_TW.po

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions hr_timesheet_sheet/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import res_company
from . import res_config
from . import account_analytic_account
from . import account_analytic_line
from . import hr_timesheet_sheet
from . import hr_department
from . import hr_employee
28 changes: 28 additions & 0 deletions hr_timesheet_sheet/models/account_analytic_account.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2019 Onestein (<https://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models
from odoo.exceptions import ValidationError


class AccountAnalyticAccount(models.Model):
_inherit = "account.analytic.account"

@api.constrains("company_id")
def _check_timesheet_sheet_company_id(self):
for rec in self.sudo():
sheets = rec.line_ids.mapped("sheet_id").filtered(
lambda s, rec=rec: s.company_id and s.company_id != rec.company_id
)
if sheets:
raise ValidationError(
rec.env._(
"You cannot change the company, as this "
"%(rec_name)s (%(rec_display_name)s) is assigned "
"to %(current_name)s (%(current_display_name)s).",
rec_name=rec._name,
rec_display_name=rec.display_name,
current_name=sheets[0]._name,
current_display_name=sheets[0].display_name,
)
)
165 changes: 165 additions & 0 deletions hr_timesheet_sheet/models/account_analytic_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Copyright 2018 ForgeFlow, S.L.
# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models
from odoo.exceptions import UserError, ValidationError


class AccountAnalyticLine(models.Model):
_inherit = "account.analytic.line"

sheet_id = fields.Many2one(comodel_name="hr_timesheet.sheet", string="Sheet")
sheet_state = fields.Selection(string="Sheet State", related="sheet_id.state")

def _get_sheet_domain(self):
"""Hook for extensions"""
self.ensure_one()
return [
("date_end", ">=", self.date),
("date_start", "<=", self.date),
("employee_id", "=", self.employee_id.id),
("company_id", "in", [self.company_id.id, False]),
("state", "in", ["new", "draft"]),
]

def _determine_sheet(self):
"""Hook for extensions"""
self.ensure_one()
return self.env["hr_timesheet.sheet"].search(self._get_sheet_domain(), limit=1)

def _compute_sheet(self):
"""Links the timesheet line to the corresponding sheet"""
for timesheet in self.filtered("project_id"):
sheet = timesheet._determine_sheet()
if timesheet.sheet_id != sheet:
timesheet.sheet_id = sheet

@api.constrains("company_id", "sheet_id")
def _check_company_id_sheet_id(self):
for aal in self.sudo():
if (
aal.company_id
and aal.sheet_id.company_id
and aal.company_id != aal.sheet_id.company_id
):
raise ValidationError(
aal.env._(
"You cannot create a timesheet of a different company "
"than the one of the timesheet sheet:"
"\n - %(sheet_name)s of %(sheet_company)s"
"\n - %(name)s of %(company)s",
sheet_name=aal.sheet_id.complete_name,
sheet_company=aal.sheet_id.company_id.name,
name=aal.name,
company=aal.company_id.name,
)
)

@api.model_create_multi
def create(self, values):
if not self.env.context.get("sheet_create") and "sheet_id" in values:
del values["sheet_id"]
res = super().create(values)
res._compute_sheet()
return res

@api.model
def _sheet_create(self, values):
return self.with_context(sheet_create=True).create(values)

def write(self, values):
self._check_state_on_write(values)
res = super().write(values)
if self._timesheet_should_compute_sheet(values):
self._compute_sheet()
return res

def unlink(self):
self._check_state()
return super().unlink()

def _check_state_on_write(self, values):
"""Hook for extensions"""
if self._timesheet_should_check_write(values):
self._check_state()

@api.model
def _timesheet_should_check_write(self, values):
"""Hook for extensions"""
return bool(set(self._get_timesheet_protected_fields()) & set(values.keys()))

@api.model
def _timesheet_should_compute_sheet(self, values):
"""Hook for extensions"""
return any(f in self._get_sheet_affecting_fields() for f in values)

@api.model
def _get_timesheet_protected_fields(self):
"""Hook for extensions"""
return [
"name",
"date",
"unit_amount",
"user_id",
"employee_id",
"department_id",
"company_id",
"task_id",
"project_id",
"sheet_id",
]

@api.model
def _get_sheet_affecting_fields(self):
"""Hook for extensions"""
return ["date", "employee_id", "project_id", "company_id"]

def _check_state(self):
if self.env.context.get("skip_check_state"):
return
for line in self.exists().filtered("sheet_id"):
if line.sheet_id.state not in ["new", "draft"]:
raise UserError(
line.env._(
"You cannot modify an entry in a confirmed timesheet sheet"
": %(names)s",
names=line.sheet_id.complete_name,
)
)

def merge_timesheets(self):
unit_amount = sum(t.unit_amount for t in self)
amount = sum(t.amount for t in self)
self[0].write({"unit_amount": unit_amount, "amount": amount})
self[1:].unlink()
return self[0]

def _check_can_write(self, values):
is_installed = (
self.env["ir.module.module"]
.sudo()
.search(
[
("name", "=", "project_timesheet_holidays"),
("state", "=", "installed"),
]
)
)
if is_installed:
if not self.env.su:
if (
hasattr(self, "holiday_id")
and self.holiday_id
and values.get("sheet_id", False)
): # Dont raise error during create
return True
if hasattr(self, "holiday_id") and self.holiday_id and self.sheet_id:
raise UserError(
self.env._(
"""You cannot modify timesheets that are linked to \
time off requests.
Please use the Time Off application to modify your time off requests instead."""
)
)
return super()._check_can_write(values)
56 changes: 56 additions & 0 deletions hr_timesheet_sheet/models/hr_department.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2018 ForgeFlow, S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models
from odoo.exceptions import ValidationError


class HrDepartment(models.Model):
_inherit = "hr.department"

timesheet_sheet_to_approve_count = fields.Integer(
compute="_compute_timesheet_to_approve", string="Timesheet Sheets to Approve"
)

def _compute_timesheet_to_approve(self):
timesheet_data = self.env["hr_timesheet.sheet"].read_group(
[("department_id", "in", self.ids), ("state", "=", "confirm")],
["department_id"],
["department_id"],
)
result = {
data["department_id"][0]: data["department_id_count"]
for data in timesheet_data
}
for department in self:
department.timesheet_sheet_to_approve_count = result.get(department.id, 0)

@api.constrains("company_id")
def _check_company_id(self):
for rec in self.sudo().filtered("company_id"):
for field in [
rec.env["hr_timesheet.sheet"].search(
[
("department_id", "=", rec.id),
("company_id", "!=", rec.company_id.id),
("company_id", "!=", False),
],
limit=1,
)
]:
if (
rec.company_id
and field.company_id
and rec.company_id != field.company_id
):
raise ValidationError(
rec.env._(
"You cannot change the company, as this"
" %(rec_name)s (%(rec_display_name)s) is assigned"
" to %(current_name)s (%(current_display_name)s).",
rec_name=rec._name,
rec_display_name=rec.display_name,
current_name=field._name,
current_display_name=field.display_name,
)
)
56 changes: 56 additions & 0 deletions hr_timesheet_sheet/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2018 ForgeFlow, S.L.
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models
from odoo.exceptions import ValidationError


class HrEmployee(models.Model):
_inherit = "hr.employee"

timesheet_sheet_ids = fields.One2many(
comodel_name="hr_timesheet.sheet",
inverse_name="employee_id",
string="Timesheet Sheets",
)
timesheet_sheet_count = fields.Integer(
compute="_compute_timesheet_sheet_count", string="Timesheet Sheets Count"
)

def _compute_timesheet_sheet_count(self):
Sheet = self.env["hr_timesheet.sheet"]
for employee in self:
employee.timesheet_sheet_count = Sheet.search_count(
[("employee_id", "=", employee.id)]
)

@api.constrains("company_id")
def _check_company_id(self):
for rec in self.sudo().filtered("company_id"):
for field in [
rec.env["hr_timesheet.sheet"].search(
[
("employee_id", "=", rec.id),
("company_id", "!=", rec.company_id.id),
("company_id", "!=", False),
],
limit=1,
)
]:
if (
rec.company_id
and field.company_id
and rec.company_id != field.company_id
):
raise ValidationError(
rec.env._(
"You cannot change the company, as this"
" %(rec_name)s (%(rec_display_name)s) is assigned"
" to %(current_name)s (%(current_display_name)s).",
rec_name=rec._name,
rec_display_name=rec.display_name,
current_name=field._name,
current_display_name=field.display_name,
)
)
907 changes: 907 additions & 0 deletions hr_timesheet_sheet/models/hr_timesheet_sheet.py

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions hr_timesheet_sheet/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2018 ForgeFlow, S.L.
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models

_WEEKDAYS = [
("0", "Monday"),
("1", "Tuesday"),
("2", "Wednesday"),
("3", "Thursday"),
("4", "Friday"),
("5", "Saturday"),
("6", "Sunday"),
]


class ResCompany(models.Model):
_inherit = "res.company"

sheet_range = fields.Selection(
[("MONTHLY", "Month"), ("WEEKLY", "Week"), ("DAILY", "Day")],
string="Timesheet Sheet Range",
default="WEEKLY",
help="The range of your Timesheet Sheet.",
)

timesheet_week_start = fields.Selection(
selection=_WEEKDAYS, string="Week start day", default="0"
)

timesheet_sheet_review_policy = fields.Selection(
selection=[
("hr", "By HR Officers"),
("hr_manager", "By HR Managers"),
("timesheet_manager", "By Timesheets Managers"),
],
default="hr",
help="How Timesheet Sheets review is performed.",
)
27 changes: 27 additions & 0 deletions hr_timesheet_sheet/models/res_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2018 ForgeFlow, S.L.
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfig(models.TransientModel):
_inherit = "res.config.settings"

sheet_range = fields.Selection(
related="company_id.sheet_range",
string="Timesheet Sheet Range",
help="The range of your Timesheet Sheet.",
readonly=False,
)

timesheet_week_start = fields.Selection(
related="company_id.timesheet_week_start",
string="Week Start Day",
help="Starting day for Timesheet Sheets.",
readonly=False,
)

timesheet_sheet_review_policy = fields.Selection(
related="company_id.timesheet_sheet_review_policy", readonly=False
)
3 changes: 3 additions & 0 deletions hr_timesheet_sheet/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
13 changes: 13 additions & 0 deletions hr_timesheet_sheet/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
If you want other default ranges different from weekly, you need to go:

- In the menu Configuration -\> Settings -\> **Timesheet Options**, and
select in **Timesheet Sheet Range** the default range you want.
- When you have a weekly range you can also specify the **Week Start
Day**.

To change who reviews submitted sheets, go to *Configuration \> Settings
\> Timesheet Options* and configure **Timesheet Sheet Review Policy**
accordingly.

For adding more review policies, look at the
*hr_timesheet_sheet_policy_xxx* extra modules.
10 changes: 10 additions & 0 deletions hr_timesheet_sheet/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- Miquel Raïch \<<miquel.raich@forgeflow.com>\>
- Andrea Stirpe \<<a.stirpe@onestein.nl>\>
- Lois Rilo \<<lois.rilo@forgeflow.com>\>
- [CorporateHub](https://corporatehub.eu/)
- Alexey Pelykh \<<alexey.pelykh@corphub.eu>\>
- Dennis Sluijk \<<d.sluijk@onestein.nl>\>
- Sunanda Chhatbar \<<sunanda.chhatbar@initos.com>\>
- [Sodexis](https://www.sodexis.com)
- SodexisTeam \<<dev@sodexis.com>\>
- Sowrirajan \<<sowrirajan@sodexis.com>\>
7 changes: 7 additions & 0 deletions hr_timesheet_sheet/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This module supplies a new screen enabling you to manage your work
encoding (timesheet) by period. Timesheet entries are made by employees
each day. At the end of the defined period, employees submit their
validated sheet and the reviewer must then approve submitted entries.
Periods are defined in the company forms and you can set them to run
monthly, weekly or daily. By default, policy is configured to have HR
Officers as reviewers.
5 changes: 5 additions & 0 deletions hr_timesheet_sheet/readme/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This module relies on:

- The OCA module '2D matrix for x2many fields', and can be downloaded
from Github:
<https://github.com/OCA/web/tree/16.0/web_widget_x2many_2d_matrix>
5 changes: 5 additions & 0 deletions hr_timesheet_sheet/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- The timesheet grid is limited to display a max. of 1M cells, due to a
limitation of the tree view limit parameter not being able to
dynamically set a limit. Since default value of odoo, 40 records is
too small, we decided to set 1M, which should be good enough in the
majority of scenarios.
7 changes: 7 additions & 0 deletions hr_timesheet_sheet/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
If you modify the Details tab, automatically the Summary tab is updated.
But if you modify the Summary tab, you need to save in order to have the
Details tab updated.

In case you modify the unit amount of both tabs, the Details tab will
prevail. If you modify the Summary tab, and you need to do a change in
the Details tab, please save before.
3 changes: 3 additions & 0 deletions hr_timesheet_sheet/report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import timesheets_analysis_report
22 changes: 22 additions & 0 deletions hr_timesheet_sheet/report/timesheets_analysis_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2018 ForgeFlow, S.L.
# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class TimesheetsAnalysisReport(models.Model):
_inherit = "timesheets.analysis.report"

sheet_id = fields.Many2one(
comodel_name="hr_timesheet.sheet", string="Sheet", readonly=True
)

@api.model
def _select(self):
return (
super()._select()
+ """,
A.sheet_id AS sheet_id
"""
)
18 changes: 18 additions & 0 deletions hr_timesheet_sheet/security/hr_timesheet_sheet_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<record model="ir.rule" id="timesheet_sheet_comp_rule">
<field name="name">Timesheet sheet multi-company</field>
<field
name="model_id"
search="[('model','=','hr_timesheet.sheet')]"
model="ir.model"
/>
<field name="global" eval="True" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
</record>
</odoo>
4 changes: 4 additions & 0 deletions hr_timesheet_sheet/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hr_timesheet_sheet_user,hr_timesheet.sheet,model_hr_timesheet_sheet,base.group_user,1,1,1,1
access_hr_timesheet_sheet_line,hr_timesheet.sheet.line,model_hr_timesheet_sheet_line,hr_timesheet.group_hr_timesheet_user,1,1,1,1
access_hr_timesheet_sheet_new_analytic_line,hr_timesheet.sheet.new.analyticline,model_hr_timesheet_sheet_new_analytic_line,hr_timesheet.group_hr_timesheet_user,1,1,1,1
Binary file added hr_timesheet_sheet/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
491 changes: 491 additions & 0 deletions hr_timesheet_sheet/static/description/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions hr_timesheet_sheet/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import test_hr_timesheet_sheet
1,106 changes: 1,106 additions & 0 deletions hr_timesheet_sheet/tests/test_hr_timesheet_sheet.py

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions hr_timesheet_sheet/views/account_analytic_line_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2018 ForgeFlow, S.L.
Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com)
Copyright 2018-2019 Onestein (<https://www.onestein.eu>)
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="hr_timesheet_line_form" model="ir.ui.view">
<field name="name">account.analytic.line.form</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form" />
<field name="arch" type="xml">
<field name="date" position="after">
<field name="sheet_id" invisible="not sheet_id" />
</field>
</field>
</record>
<record id="hr_timesheet_line_search" model="ir.ui.view">
<field name="name">account.analytic.line.search</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search" />
<field name="arch" type="xml">
<field name="date" position="before">
<field name="sheet_id" />
</field>
<filter name="mine" position="before">
<filter
name="unsubmitted"
string="Not Submitted"
domain="['|',('sheet_id','=',False),('sheet_id.state','=','draft')]"
/>
<separator />
</filter>
</field>
</record>
<record id="act_hr_timesheet_line_to_submit" model="ir.actions.act_window">
<field name="name">Timesheets to Submit</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.line</field>
<field name="view_id" eval="False" />
<field name="context">
{
'search_default_groupby_employee': 1,
'search_default_groupby_project': 1,
'search_default_groupby_date': 1,
}
</field>
<field
name="domain"
>[('project_id.active','=',True),'|',('sheet_id','=',False),('sheet_id.state','=','draft')]</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Timesheets to submit.
</p>
<p>
Employees must record timesheets every day and confirm at the end
of the reporting period. Once the timesheet sheet is confirmed, it should be
validated by a reviewer.
</p>
<p>
Timesheets can also be invoiced to customers, depending on the
configuration of each project's related contract.
</p>
</field>
</record>
<record id="act_hr_timesheet_line_to_submit_my" model="ir.actions.act_window">
<field name="name">My Timesheets to Submit</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.analytic.line</field>
<field name="view_id" eval="False" />
<field name="context">
{
'search_default_groupby_project': 1,
'search_default_groupby_date': 1,
}
</field>
<field
name="domain"
>[('user_id', '=', uid),('project_id.active','=',True),'|',('sheet_id','=',False),('sheet_id.state','=','draft')]</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
My timesheets to submit.
</p>
<p>
You must record timesheets every day and confirm at the end
of the reporting period. Once the timesheet sheet is confirmed, it should be
validated by a reviewer.
</p>
</field>
</record>
<menuitem
action="act_hr_timesheet_line_to_submit"
id="menu_act_hr_timesheet_line_to_submit"
parent="hr_timesheet.menu_hr_time_tracking"
groups="hr_timesheet.group_timesheet_manager"
sequence="6"
/>
<menuitem
action="act_hr_timesheet_line_to_submit_my"
id="menu_act_hr_timesheet_line_to_submit_my"
parent="hr_timesheet_sheet.menu_hr_my_timesheets"
sequence="5"
/>
</odoo>
52 changes: 52 additions & 0 deletions hr_timesheet_sheet/views/hr_department_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!--
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<record id="hr_timesheet_action_from_department" model="ir.actions.act_window">
<field name="name">Timesheets to Review</field>
<field name="res_model">hr_timesheet.sheet</field>
<field name="view_mode">list,form</field>
<field name="context">{
'search_default_department_id': [active_id],
'default_department_id': active_id,
'search_default_to_review': 1}
</field>
</record>
<!--Hr Department Inherit Kanban view-->
<record id="hr_department_view_kanban" model="ir.ui.view">
<field name="name">hr.department.kanban.inherit</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.hr_department_view_kanban" />
<field name="arch" type="xml">
<xpath expr="//templates" position="before">
<field
name="timesheet_sheet_to_approve_count"
groups="hr_timesheet.group_hr_timesheet_user"
/>
</xpath>
<xpath expr="//div[@name='kanban_primary_right']" position="inside">
<button
name="%(hr_timesheet_sheet.hr_timesheet_action_from_department)d"
type="action"
class="btn btn-secondary"
t-if="record.timesheet_sheet_to_approve_count.raw_value > 0"
groups="hr_timesheet.group_hr_timesheet_user"
>
<field name="timesheet_sheet_to_approve_count" /> Timesheets
</button>
</xpath>
<xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside">
<div role="menuitem" groups="hr_timesheet.group_hr_timesheet_user">
<a
class="dropdown-item"
name="%(hr_timesheet_sheet.hr_timesheet_action_from_department)d"
type="action"
>
<field name="timesheet_sheet_to_approve_count" /> Timesheets
</a>
</div>
</xpath>
</field>
</record>
</odoo>
38 changes: 38 additions & 0 deletions hr_timesheet_sheet/views/hr_employee_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2018 ForgeFlow, S.L.
Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com)
Copyright 2018-2019 Onestein (<https://www.onestein.eu>)
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="act_hr_employee_2_hr_timesheet" model="ir.actions.act_window">
<field name="res_model">hr_timesheet.sheet</field>
<field name="name">Timesheet Sheets</field>
<field name="view_mode">list,form</field>
<field
name="context"
>{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
</record>
<record id="hr_timesheet_sheet_employee_extd_form" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.employee.extd_form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form" />
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button
name="%(hr_timesheet_sheet.act_hr_employee_2_hr_timesheet)d"
type="action"
class="oe_stat_button"
icon="fa-clock-o"
>
<field
name="timesheet_sheet_count"
widget="statinfo"
string="Timesheets"
/>
</button>
</div>
</field>
</record>
</odoo>
518 changes: 518 additions & 0 deletions hr_timesheet_sheet/views/hr_timesheet_sheet_views.xml

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions hr_timesheet_sheet/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--
Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com)
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.hr.timesheet</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="55" />
<field name="inherit_id" ref="hr_timesheet.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//block[@name='timesheet_control']" position="after">
<block title="Timesheet Options">
<setting
help="Choose which timesheet sheet ranges should be used by default"
company_specific="1"
>
<field name="sheet_range" required="1" />
</setting>
<setting
help="Choose the week start day."
invisible="sheet_range != 'WEEKLY'"
company_specific="1"
>
<field
name="timesheet_week_start"
required="sheet_range == 'WEEKLY'"
/>
</setting>
<setting
help="Choose timesheet sheets review policy."
company_specific="1"
>
<field
name="timesheet_sheet_review_policy"
widget="radio"
required="1"
/>
</setting>
</block>
</xpath>
</field>
</record>
</odoo>
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
odoo-addon-web_widget_x2many_2d_matrix @ git+https://github.com/OCA/web.git@refs/pull/3003/head#subdirectory=web_widget_x2many_2d_matrix