details: https://code.tryton.org/tryton/commit/a8ab37eab753
branch: 8.0
user: Cédric Krier <[email protected]>
date: Tue May 12 09:02:55 2026 +0200
description:
Include timesheet cost in production work only if timesheet cost module
is activated
f2642fe60c20 extends the cost method using the cost price of the
timesheet line
but without ensuring the module is activated.
Closes #14830
(grafted from 4b38a680f4ee2139a8d0179a3a67eb2606faa7e4)
diffstat:
modules/production_work_timesheet/tryton.cfg | 1 +
modules/production_work_timesheet/work.py | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diffs (22 lines):
diff -r b18cf7cbaa54 -r a8ab37eab753
modules/production_work_timesheet/tryton.cfg
--- a/modules/production_work_timesheet/tryton.cfg Thu May 07 13:34:06
2026 +0200
+++ b/modules/production_work_timesheet/tryton.cfg Tue May 12 09:02:55
2026 +0200
@@ -20,3 +20,4 @@
[register timesheet_cost]
model:
work.WorkCenter
+ work.Work_TimesheetCost
diff -r b18cf7cbaa54 -r a8ab37eab753 modules/production_work_timesheet/work.py
--- a/modules/production_work_timesheet/work.py Thu May 07 13:34:06 2026 +0200
+++ b/modules/production_work_timesheet/work.py Tue May 12 09:02:55 2026 +0200
@@ -130,6 +130,10 @@
'timesheet_end_date': date,
})
+
+class Work_TimesheetCost(metaclass=PoolMeta):
+ __name__ = 'production.work'
+
@classmethod
def _get_cost(cls, works):
pool = Pool()