Skip to content

[18.0][ADD] fleet_vehicle_category_analytic: Set analytic account on invoice line from vehicle, via vehicle categories#220

Open
arnaudlayec wants to merge 1 commit intoOCA:18.0from
arnaudlayec:18.0
Open

[18.0][ADD] fleet_vehicle_category_analytic: Set analytic account on invoice line from vehicle, via vehicle categories#220
arnaudlayec wants to merge 1 commit intoOCA:18.0from
arnaudlayec:18.0

Conversation

@arnaudlayec
Copy link

@arnaudlayec arnaudlayec commented Feb 27, 2026

This PR is a proposal to be discussed.

Summary

Based on fleet_vehicle_category, it allow to automatically set an Analytic Distribution (analytic_distribution) on invoices lines (account.move.line) when choosing the vehicle on invoices lines.

Usage

Please see USAGE.md. In short: define an analytic account on a vehicle category, and then use the vehicle on an invoice line.

Choice discussion

Dependency with module fleet_vehicle_category

I choose to define the Analytic Account on the fleet.vehicle.category model from the corresponding OCA module.
Indeed, we could think of other way to define this Analytic Account on vehicle:

  • directly on vehicle: but very manual and unitary
  • on native Odoo object, like fleet.vehicle.model or fleet.vehicle.model.category: but those are really related to vehicle's manufacturer, which is limiting.
Analytic Account instead of Analytic Distribution

I choose to define a single Analytic Account in the vehicle category for simplicity. It could evolve to Analytic Distribution, but the merging logic with invoice lines would need to be defined.
For now, this merging logic is very simple:

  • set the analytic account at 100% if not already set (so leave it, for instance, at 50% if it were already modified at 50%)
  • leave any other part of the Analytic Distribution in place

…e line from vehicle, via vehicle categories

precomit
@arnaudlayec arnaudlayec changed the title [ADD] fleet_vehicle_category_analytic: Set analytic account on invoice line from vehicle, via vehicle categories [18.0][ADD] fleet_vehicle_category_analytic: Set analytic account on invoice line from vehicle, via vehicle categories Feb 27, 2026
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