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
This commit is contained in:
Cédric Krier
2026-05-12 09:02:55 +02:00
parent eeeec6340d
commit 0c5f1bfe53
2 changed files with 5 additions and 0 deletions
@@ -20,3 +20,4 @@ model:
[register timesheet_cost]
model:
work.WorkCenter
work.Work_TimesheetCost
@@ -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()