Skip to content

bug: Allow empty end odometer for trips#186

Merged
dannymcc merged 2 commits into
dannymcc:devfrom
attiks:issues-185
May 16, 2026
Merged

bug: Allow empty end odometer for trips#186
dannymcc merged 2 commits into
dannymcc:devfrom
attiks:issues-185

Conversation

@attiks
Copy link
Copy Markdown
Contributor

@attiks attiks commented May 13, 2026

Refs: #185

Summary

Allows "End Odometer" to be empty.

Testing

How were these changes tested?

  • Tested locally
  • Tested with Docker image

dannymcc and others added 2 commits May 3, 2026 18:26
@dannymcc dannymcc changed the base branch from main to dev May 16, 2026 15:37
@dannymcc dannymcc merged commit f6ef143 into dannymcc:dev May 16, 2026
dannymcc added a commit that referenced this pull request May 16, 2026
…rsion, export units

- #182: nested <form> for attachment delete was closing the outer form on edit
  pages, orphaning the Save button. Replaced with a JS-driven POST helper that
  builds a hidden form on click — no nesting, full page reload preserves flash
  messages.

- #183: <datalist> on quick fuel log shows a chevron in some browsers but
  doesn't always open. Switched to the same <select> + free-text pattern the
  full fuel form uses, which works consistently.

- #181: consumption math used the raw odometer delta without converting to
  the unit each formula assumes (miles for MPG, km for L/100km). Added a
  shared _distance_in helper and applied it in FuelLog.get_consumption and
  Vehicle.get_average_consumption. Existing tests were encoding the broken
  behaviour, so sample_vehicle now pins odometer_unit='km' for clarity.

- #173: Vehicle.get_total_distance ignored its distance_unit argument for
  non-Tessie vehicles, so the dashboard could label miles as km. Now uses
  _distance_in to convert from the vehicle's effective odometer unit.
  Added odometer_unit / distance_unit columns to the vehicles, fuel_logs,
  expenses and trips CSV exports so the data is self-describing.

- Hardened get_last_odometer to skip trips with NULL end_odometer — follow-up
  to the #185 / PR #186 merge so max() doesn't crash on a freshly-created
  trip without an end odometer.

- Bump APP_VERSION to 0.22.3
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.

2 participants