From 0c5f1bfe5318985fcfeaa35e8ddf4588a77c6646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 12 May 2026 09:02:55 +0200 Subject: [PATCH] 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) --HG-- branch : 8.0 --- modules/production_work_timesheet/tryton.cfg | 1 + modules/production_work_timesheet/work.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/modules/production_work_timesheet/tryton.cfg b/modules/production_work_timesheet/tryton.cfg index 341616d566..b70039ea12 100644 --- a/modules/production_work_timesheet/tryton.cfg +++ b/modules/production_work_timesheet/tryton.cfg @@ -20,3 +20,4 @@ model: [register timesheet_cost] model: work.WorkCenter + work.Work_TimesheetCost diff --git a/modules/production_work_timesheet/work.py b/modules/production_work_timesheet/work.py index 755c8f253c..3c2ef8d083 100644 --- a/modules/production_work_timesheet/work.py +++ b/modules/production_work_timesheet/work.py @@ -130,6 +130,10 @@ class Work(metaclass=PoolMeta): 'timesheet_end_date': date, }) + +class Work_TimesheetCost(metaclass=PoolMeta): + __name__ = 'production.work' + @classmethod def _get_cost(cls, works): pool = Pool()