Skip to content

Commit 825083e

Browse files
committed
[18.0][ADD] hr_timesheet_cost_account
1 parent 3b0c53a commit 825083e

22 files changed

Lines changed: 1705 additions & 0 deletions
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
===========================
2+
HR - Timesheet Cost Account
3+
===========================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:403c4c2a80808e2a6770a0f406d3da28af7699d0ad3b13ee7b7c59a60b28ea24
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ftimesheet-lightgray.png?logo=github
20+
:target: https://github.com/OCA/timesheet/tree/18.0/hr_timesheet_cost_account
21+
:alt: OCA/timesheet
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/timesheet-18-0/timesheet-18-0-hr_timesheet_cost_account
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/timesheet&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module allows recognizing timesheet-based labor costs in
32+
accounting.
33+
34+
It introduces a **Timesheet Costing** document that collects timesheet
35+
lines within a selected date range (optionally filtered by project
36+
and/or employee), computes the total cost based on each employee's
37+
hourly cost, and generates a journal entry with:
38+
39+
- **Debit** to the cost account for each timesheet line (including
40+
analytic distribution)
41+
- **Credit** to the suspense account for the total amount
42+
43+
**Table of contents**
44+
45+
.. contents::
46+
:local:
47+
48+
Configuration
49+
=============
50+
51+
Go to *Accounting > Configuration > Settings* and scroll to the
52+
**Timesheets** section.
53+
54+
Configure the following options:
55+
56+
- **Cost Account**: account to debit for timesheet labor costs (e.g. WIP
57+
or labor expense account)
58+
- **Suspense Account**: account to credit as the counterpart entry
59+
- **Journal**: journal used to generate timesheet cost entries
60+
61+
Ensure that each employee has an **Hourly Cost** defined under
62+
*Employees > Settings*, as it is used to compute the cost amount.
63+
64+
Usage
65+
=====
66+
67+
To use this module:
68+
69+
1. Go to *Timesheets > Timesheet Costing* or *Invoicing > Accounting >
70+
Timesheet Costing*.
71+
2. Click **New** and set the date range (*Date From* / *Date To*).
72+
3. Optionally filter by **Projects** and/or **Employees** (leave empty
73+
to include all).
74+
4. Set the **Accounting Date**.
75+
5. Click **Get Timesheets** to load matching, unprocessed timesheet
76+
lines. The *Total Cost* is computed automatically based on hours and
77+
employee hourly cost.
78+
6. Click **Confirm**, then **Create Journal Entry** to generate the
79+
accounting entry.
80+
81+
To review the result, use the **Journal Entry** smart button on the
82+
costing form. The journal entry also provides a link back to the costing
83+
document.
84+
85+
Bug Tracker
86+
===========
87+
88+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/timesheet/issues>`_.
89+
In case of trouble, please check there if your issue has already been reported.
90+
If you spotted it first, help us to smash it by providing a detailed and welcomed
91+
`feedback <https://github.com/OCA/timesheet/issues/new?body=module:%20hr_timesheet_cost_account%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
92+
93+
Do not contact contributors directly about support or help with technical issues.
94+
95+
Credits
96+
=======
97+
98+
Authors
99+
-------
100+
101+
* Ecosoft
102+
103+
Contributors
104+
------------
105+
106+
- `Ecosoft <https://ecosoft.co.th>`__:
107+
108+
- Saran Lim. <saranl@ecosoft.co.th>
109+
110+
Maintainers
111+
-----------
112+
113+
This module is maintained by the OCA.
114+
115+
.. image:: https://odoo-community.org/logo.png
116+
:alt: Odoo Community Association
117+
:target: https://odoo-community.org
118+
119+
OCA, or the Odoo Community Association, is a nonprofit organization whose
120+
mission is to support the collaborative development of Odoo features and
121+
promote its widespread use.
122+
123+
.. |maintainer-Saran440| image:: https://github.com/Saran440.png?size=40px
124+
:target: https://github.com/Saran440
125+
:alt: Saran440
126+
127+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
128+
129+
|maintainer-Saran440|
130+
131+
This module is part of the `OCA/timesheet <https://github.com/OCA/timesheet/tree/18.0/hr_timesheet_cost_account>`_ project on GitHub.
132+
133+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
from . import models
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2026 Ecosoft Co., Ltd. (<http://ecosoft.co.th>)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
4+
{
5+
"name": "HR - Timesheet Cost Account",
6+
"summary": "Accounting Cost for Timesheet",
7+
"version": "18.0.1.0.0",
8+
"category": "Tools",
9+
"author": "Ecosoft, Odoo Community Association (OCA)",
10+
"website": "https://github.com/OCA/timesheet",
11+
"license": "AGPL-3",
12+
"depends": [
13+
"analytic",
14+
"account",
15+
"hr_hourly_cost",
16+
"hr_timesheet",
17+
],
18+
"data": [
19+
"data/sequence.xml",
20+
"security/ir.model.access.csv",
21+
"views/res_config_settings_views.xml",
22+
"views/hr_timesheet_costing_views.xml",
23+
"views/account_move_views.xml",
24+
],
25+
"maintainers": ["Saran440"],
26+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<record id="sequence_hr_timesheet_costing" model="ir.sequence">
4+
<field name="name">Timesheet Costing</field>
5+
<field name="code">hr.timesheet.costing</field>
6+
<field name="prefix">TSC</field>
7+
<field name="padding">5</field>
8+
</record>
9+
</odoo>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
2+
3+
from . import account_move
4+
from . import res_company
5+
from . import res_config_settings
6+
from . import hr_timesheet
7+
from . import hr_timesheet_costing
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2026 Ecosoft Co., Ltd. (<http://ecosoft.co.th>)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
4+
from odoo import fields, models
5+
6+
7+
class AccountMove(models.Model):
8+
_inherit = "account.move"
9+
10+
timesheet_costing_id = fields.Many2one(
11+
comodel_name="hr.timesheet.costing",
12+
readonly=True,
13+
copy=False,
14+
ondelete="set null",
15+
)
16+
17+
def action_view_timesheet_costing(self):
18+
self.ensure_one()
19+
return {
20+
"type": "ir.actions.act_window",
21+
"res_model": "hr.timesheet.costing",
22+
"view_mode": "form",
23+
"res_id": self.timesheet_costing_id.id,
24+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2026 Ecosoft Co., Ltd. (<http://ecosoft.co.th>)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
4+
from odoo import fields, models
5+
6+
7+
class AccountAnalyticLine(models.Model):
8+
_inherit = "account.analytic.line"
9+
10+
timesheet_costing_id = fields.Many2one(
11+
comodel_name="hr.timesheet.costing",
12+
readonly=True,
13+
copy=False,
14+
ondelete="set null",
15+
)

0 commit comments

Comments
 (0)