fix(jobs): auto-resync step.duration_actual on timelog edits

When a supervisor edits a timelog's date_started/date_finished (or
deletes a stale timelog), the parent step's "Actual Min" column
was showing stale data — duration_actual is a regular Float set
once by button_finish.

Adds:
- fp.job.step._fp_resum_duration_actual: quiet helper that re-sums
  duration_actual from time_log_ids.duration_minutes. Skip no-op
  updates so write traffic is minimised.
- fp.job.step.timelog.create/write/unlink hooks: call the helper
  on the affected parent step(s) so duration_actual stays
  consistent. Write hook only fires when date_started/date_finished/
  step_id changed (notes edits skip resync). step_id reassignment
  resyncs both old and new parent.
- Existing action_recompute_duration_from_timelogs (manual button)
  still posts a chatter entry for audit-trail use cases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-11 23:53:45 -04:00
parent b0070afc1b
commit 1c68fd0555
4 changed files with 153 additions and 19 deletions

View File

@@ -5,7 +5,7 @@
{
'name': 'Fusion Plating',
'version': '19.0.18.15.0',
'version': '19.0.18.15.3',
'category': 'Manufacturing/Plating',
'summary': 'Core plating / metal finishing ERP: facilities, processes, tanks, baths, jobs, operators.',
'description': """