Skip to content

Release v0.39.0 - #333

Merged
dannymcc merged 2 commits into
mainfrom
dev
Aug 25, 2026
Merged

Release v0.39.0#333
dannymcc merged 2 commits into
mainfrom
dev

Conversation

@dannymcc

@dannymcc dannymcc commented Aug 25, 2026

Copy link
Copy Markdown
Owner

0.39.0

Vehicles metered in engine hours — tractors, generators, plant — are now serviced and labelled in hours rather than in distance.

Features

  • A maintenance schedule for a vehicle tracked in engine hours is set in hours ("every 250 hours") instead of kilometres or miles. Previously the only reading-based intervals on offer were distances, and the next-due reading was worked out by running that distance through the km/mi conversion before adding it to a figure that was already in hours, so such a vehicle could never be serviced to anything sensible. The km and miles boxes are hidden for an hours-metered vehicle and shown again for any other, decided server-side so the form is right before any script runs. (#282)

Fixes

  • Readings on an hours-tracked vehicle, and the figures derived from them, are labelled in hours: "h" beside a reading, "L / h" for consumption, "Cost per h", "kWh / 100 h", and "Engine hours" rather than "Odometer" on forms. Fuel, expenses, notes, tyres, mileage allowance, the vehicle page, the maintenance list, the calendar feed and the PDF report all follow the vehicle's own unit now; the figures themselves have been correct since 0.36.1, only the labels beside them still read in distance terms. (#282)
  • "Due soon" for a schedule on an hours-tracked vehicle means within 25 engine hours rather than within 500, which had put every such service permanently in the amber. (#282)
  • The next-due reading in the maintenance list takes the owning vehicle's unit rather than the account's distance preference, which was also wrong for any vehicle whose own odometer unit differed from it. (#282)

Other

  • New interval_hours column on maintenance schedules (migration f2a3b4c5d6e7, applied automatically on start-up); it is carried through backup and restore.
  • Translations updated for the new strings across all supported languages.
  • README updated for engine-hour intervals and labelling.

Thanks to the reporter of #282 for the detail on how hour-metered machinery is actually serviced.

Known limitations

The trip and charging forms, and the timeline on the vehicle page, still label a reading with the account's distance unit, as they do for every vehicle.

Summary by CodeRabbit

  • New Features

    • Added engine-hour tracking for maintenance schedules, including hour-based intervals and readings.
    • Added a 25-hour “Due soon” threshold for hour-tracked vehicles.
    • Updated vehicle pages, reports, forms, and logs to display vehicle-specific reading and consumption units.
    • Added backup and restore support for engine-hour maintenance intervals.
  • Documentation

    • Updated the changelog and README with engine-hour tracking and unit behaviour.

Harness added 2 commits August 25, 2026 00:44
…282)

Issue #323 made tracking_unit authoritative for the consumption and
running-cost maths but left two gaps, and both are what the reporter
of #282 actually runs into.

A maintenance schedule could only state a reading-based interval in
kilometres or miles, and calculate_next_due ran that interval through
the km/mi conversion before adding it to a reading that was in engine
hours, so a tractor could never be serviced to anything sensible.
Schedules gain interval_hours, added untouched for such a vehicle; a
stray distance interval on one is ignored rather than misread. "Due
soon" for it means within 25 engine hours, not 500, which had put
every such service permanently in the amber. The form hides the km and
miles boxes for an hours vehicle and shows them again for any other,
rendered server-side so it is right before any script runs.

Readings on an hours-tracked vehicle and the figures derived from them
are now labelled in hours — "h", "L / h", "Cost per h", "kWh / 100 h",
and "Engine hours" rather than "Odometer" — across fuel, expenses,
notes, tyres, mileage allowance, the vehicle page, the maintenance
list, the calendar feed and the PDF report. The maintenance list also
took its unit from the account's distance preference, which was wrong
for any vehicle whose own odometer unit differed from it.

The trip and charging forms still label the reading with the account's
distance unit, as they do for every vehicle, and are unchanged here.
@dannymcc
dannymcc merged commit 8b2069b into main Aug 25, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8b2ddf6c-b9da-4a30-97d6-ff44a87c2582

📥 Commits

Reviewing files that changed from the base of the PR and between e7034e2 and b00aadc.

⛔ Files ignored due to path filters (39)
  • app/translations/ar/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/ar/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/cs/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/cs/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/da/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/da/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/de/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/de/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/es/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/es/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/fi/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/fi/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/fr/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/fr/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/hu/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/hu/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/it/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/it/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/ja/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/ja/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/ko/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/ko/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/messages.pot is excluded by !app/translations/**
  • app/translations/nl/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/nl/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/no/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/no/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/pl/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/pl/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/pt/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/pt/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/ru/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/ru/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/sv/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/sv/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/tr/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/tr/LC_MESSAGES/messages.po is excluded by !app/translations/**
  • app/translations/zh/LC_MESSAGES/messages.mo is excluded by !app/translations/**
  • app/translations/zh/LC_MESSAGES/messages.po is excluded by !app/translations/**
📒 Files selected for processing (25)
  • CHANGELOG.md
  • README.md
  • app/models.py
  • app/routes/calendar.py
  • app/routes/maintenance.py
  • app/services/backup_restore.py
  • app/templates/allowance/form.html
  • app/templates/allowance/index.html
  • app/templates/expenses/form.html
  • app/templates/expenses/index.html
  • app/templates/fuel/form.html
  • app/templates/fuel/index.html
  • app/templates/fuel/quick.html
  • app/templates/maintenance/form.html
  • app/templates/maintenance/index.html
  • app/templates/notes/form.html
  • app/templates/notes/index.html
  • app/templates/tires/form.html
  • app/templates/tires/index.html
  • app/templates/vehicles/form.html
  • app/templates/vehicles/report_pdf.html
  • app/templates/vehicles/view.html
  • config.py
  • migrations/versions/f2a3b4c5d6e7_add_interval_hours_to_maintenance_schedules.py
  • tests/test_maintenance_hours.py

📝 Walkthrough

Walkthrough

The change adds engine-hour maintenance schedules, tracking-specific intervals and due-soon thresholds. Vehicle reading, span, and consumption labels now use vehicle-specific units across forms, lists, reports, and vehicle views.

Changes

Engine-hour maintenance

Layer / File(s) Summary
Reading units and maintenance model
app/models.py, migrations/versions/...
Vehicles expose engine-hour labels and units. Maintenance schedules store interval_hours and calculate intervals and due-soon thresholds by tracking mode.
Maintenance form and schedule flow
app/routes/maintenance.py, app/routes/calendar.py, app/services/backup_restore.py, app/templates/maintenance/*, tests/test_maintenance_hours.py
Maintenance forms, routes, calendar text, backup restore, and maintenance lists support hour-based intervals. Tests cover hour and distance behaviour.
Vehicle-specific labels and units
app/templates/allowance/*, app/templates/expenses/*, app/templates/fuel/*, app/templates/notes/*, app/templates/tires/*, app/templates/vehicles/*
Reading and consumption displays use vehicle-specific units. Hour-tracked vehicle summaries use hour-based labels.
Documentation and release metadata
README.md, CHANGELOG.md, config.py
Documentation describes engine-hour tracking and thresholds. The application version is 0.39.0.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Driver
  participant MaintenanceForm
  participant MaintenanceRoutes
  participant MaintenanceSchedule
  participant Database
  Driver->>MaintenanceForm: Select vehicle and interval type
  MaintenanceForm->>MaintenanceRoutes: Submit interval_hours or distance interval
  MaintenanceRoutes->>MaintenanceSchedule: Create or update schedule
  MaintenanceSchedule->>Database: Store maintenance interval
  MaintenanceSchedule->>MaintenanceForm: Calculate labels and due reading
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant