[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
Open
Conversation
…e line from vehicle, via vehicle categories precomit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_categoryI choose to define the Analytic Account on the
fleet.vehicle.categorymodel from the corresponding OCA module.Indeed, we could think of other way to define this Analytic Account on vehicle:
fleet.vehicle.modelorfleet.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: