-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by robinkeunen
- Loading branch information
Showing
12 changed files
with
601 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
========================== | ||
My Current Timesheet Sheet | ||
========================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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-coopiteasy%2Fcie--timesheet-lightgray.png?logo=github | ||
:target: https://github.com/coopiteasy/cie-timesheet/tree/12.0/hr_timesheet_sheet_current | ||
:alt: coopiteasy/cie-timesheet | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
Allow to access the current timesheet sheet directly from the menu. | ||
|
||
A new menu is added to the Timesheet module, pointing directly to the user's current timesheet sheet. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/cie-timesheet/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/coopiteasy/cie-timesheet/issues/new?body=module:%20hr_timesheet_sheet_current%0Aversion:%2012.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 | ||
~~~~~~~ | ||
|
||
* Coop IT Easy SC | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Coop IT Easy SC <https://coopiteasy.be>`_: | ||
|
||
* victor champonnois | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is part of the `coopiteasy/cie-timesheet <https://github.com/coopiteasy/cie-timesheet/tree/12.0/hr_timesheet_sheet_current>`_ project on GitHub. | ||
|
||
You are welcome to contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2021 Victor Champonnois | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "My Current Timesheet Sheet", | ||
"summary": """ | ||
Allow to access the current timesheet sheet directly from the menu""", | ||
"version": "16.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Coop IT Easy SC", | ||
"website": "https://github.com/coopiteasy/cie-timesheet", | ||
"depends": [ | ||
"hr_timesheet_sheet", | ||
], | ||
"data": ["views/hr_timesheet_sheet.xml"], | ||
"demo": [], | ||
} |
32 changes: 32 additions & 0 deletions
32
hr_timesheet_sheet_current/i18n/hr_timesheet_sheet_current.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * hr_timesheet_sheet_current | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: hr_timesheet_sheet_current | ||
#: model:ir.actions.server,name:hr_timesheet_sheet_current.action_hr_timesheet_current_open | ||
#: model:ir.ui.menu,name:hr_timesheet_sheet_current.menu_act_hr_timesheet_sheet_form_my_current | ||
msgid "My Current Timesheet Sheet" | ||
msgstr "" | ||
|
||
#. module: hr_timesheet_sheet_current | ||
#: code:addons/hr_timesheet_sheet_current/models/hr_timesheet_sheet.py:26 | ||
#, python-format | ||
msgid "Open Timesheet" | ||
msgstr "" | ||
|
||
#. module: hr_timesheet_sheet_current | ||
#: model:ir.model,name:hr_timesheet_sheet_current.model_hr_timesheet_sheet | ||
msgid "Timesheet Sheet" | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import hr_timesheet_sheet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import datetime | ||
|
||
from odoo import api, models | ||
from odoo.tools.translate import _ | ||
|
||
|
||
class Sheet(models.Model): | ||
_inherit = "hr_timesheet.sheet" | ||
|
||
@api.model | ||
def get_current_timesheet(self): | ||
ts = self.env["hr_timesheet.sheet"] | ||
today_date = datetime.date.today() | ||
ids = ts.search( | ||
[ | ||
("user_id", "=", self.env.uid), | ||
("state", "in", ("draft", "new")), | ||
("date_start", "<=", today_date), | ||
("date_end", ">=", today_date), | ||
] | ||
) | ||
view_type = "form,tree" | ||
|
||
context = self.env.context | ||
action = { | ||
"name": _("Open Timesheet"), | ||
"view_type": "form", | ||
"view_mode": view_type, | ||
"res_model": "hr_timesheet.sheet", | ||
"view_id": False, | ||
"type": "ir.actions.act_window", | ||
"context": context, | ||
"domain": "[('user_id', '=', uid)]", | ||
"res_id": ids.id, | ||
} | ||
return action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* `Coop IT Easy SC <https://coopiteasy.be>`_: | ||
|
||
* victor champonnois |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Allow to access the current timesheet sheet directly from the menu. | ||
|
||
A new menu is added to the Timesheet module, pointing directly to the user's current timesheet sheet. |
Oops, something went wrong.