-
-
Notifications
You must be signed in to change notification settings - Fork 107
[18.0][ADD]fleet_traffic_infractions_account: add new module #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
rpsjr
wants to merge
25
commits into
OCA:18.0
Choose a base branch
from
rpsjr:18.0-add-fleet_vehicle_traffic_infractions_account
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[18.0][ADD]fleet_traffic_infractions_account: add new module #187
rpsjr
wants to merge
25
commits into
OCA:18.0
from
rpsjr:18.0-add-fleet_vehicle_traffic_infractions_account
Conversation
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.
Depends on:
#184 fleet_vehicle_assignation_log_datetime
#185 fleet_traffic_infractions
[ADD] fleet_traffic_infractions_account: Financial integration for traffic infractions.This pull request introduces the
fleet_traffic_infractions_accountmodule. It serves as a bridge to connect the operational data from thefleet_traffic_infractionsmodule with Odoo's accounting functionalities, featuring a powerful, rule-based engine for applying driver invoicing policies.Motivation
The
fleet_traffic_infractionsmodule provides a robust foundation for the operational tracking of traffic fines. However, to complete the business process, a financial layer is required to handle the invoicing of drivers and the payment of fines to issuing agencies.This functionality is intentionally separated into this bridge module for several key reasons:
accountandproduct.hr_expense).Implementation
This module extends the
fleet_traffic_infractionsmodule by adding the following features:Dependencies: It adds dependencies on
fleet_traffic_infractionsandaccount.Financial Workflow: It extends the state machine of the
fleet.traffic.infractionsmodel to include a full financial workflow. TheConfirmedstate now transitions to:To Invoice Driver->To Create Agency Bill->Processed.Rule-Based Driver Invoicing with "Invoicing Rules":
fleet.traffic.infraction.invoicing.termmodel, designed as a powerful rule engine. This provides a highly flexible, "compressive" system for managing different invoicing policies.driver_domain.driver_domainuses Odoo's domain builder to precisely target which drivers the rule applies to (e.g., by department, employee tag, partner type, etc.).sequencefield allows for prioritizing these rules. The system evaluates them in order and applies the first matching rule it finds. This enables complex logic, such as specific rules for certain teams and a final "catch-all" rule for everyone else.account.movefor the driver based on the matched rule.Configurable Agency Billing (Company Policy):
Fleet > Configuration > Settingsto define how fines from issuing agencies are recorded.Model & View Extensions:
Fine Productfield is added to thefleet.traffic.infraction.typemodel to link infractions to specific income/expense accounts.fleet.traffic.infractionsform is updated with new buttons for the financial workflow and smart links to the generated accounting entries.applied_invoicing_term_idfield has been added to the infraction form to clearly show the user which specific rule was matched and applied, ensuring transparency.