Skip to content

Conversation

@rpsjr
Copy link

@rpsjr rpsjr commented Sep 17, 2025

Depends on #184

Motivation

This module introduces a framework for the comprehensive management of traffic infractions within a vehicle fleet. Many companies struggle to track fines, identify the responsible driver, and manage the lifecycle of an infraction from notification to resolution.

The primary motivation is to create a foundational module that focuses exclusively on the operational aspects of infraction management. It provides the necessary tools to record infractions accurately, link them to the correct vehicle, and, most importantly, suggest the driver who was in charge of the vehicle at the time of the incident.

This module intentionally separates the operational tracking from the financial transactions. This approach creates a lean and focused base module, fleet_traffic_infractions, upon which financial modules, such as an accounting integration, can be built.

Implementation

To achieve this, the module implements the following:

    **New Models:**
    fleet.traffic.infractions: The central model to record all details of an infraction, including the vehicle, driver, issuing agency, date, fine amount, and status (Draft, Confirmed, Canceled).
    fleet.traffic.infraction.type: A model to categorize and define different types of infractions with codes, descriptions, and jurisdictional details.
    
    **Driver Suggestion Logic:**
    Leveraging the fleet_vehicle_assignation_log_datetime module, it automatically suggests the driver who was assigned to the vehicle at the exact date and time the infraction occurred.
    If a user manually changes the suggested driver, a log note is automatically posted in the chatter, providing a clear audit trail and highlighting any discrepancies with the vehicle's assignment history.
    
    **Integration with Existing Models:**
    Vehicle Form: A new smart button on the fleet.vehicle form shows the total count of infractions for that vehicle and provides a direct link to view them.
    Partner Form: The res.partner model is enhanced to:
    Identify a partner as a "Traffic Issuing Agency."
    Display smart buttons for viewing infractions where the partner was the driver or the issuing agency.
    Calculate the total fine amount attributed to a partner as a driver.
    
    **User Experience:**
    Provides dedicated menu items to access and manage infraction types and the infractions themselves.
    Includes security groups for standard users (read-only) and fleet managers (full access).

This module serves as the definitive record for what happened, who was responsible, and the operational status of the fine. All accounting-related features, such as creating bills or invoices, are explicitly out of scope.

Roadmap
This module is the first step in a two-part plan for complete traffic infraction management. The next step will be the creation of the fleet_traffic_infractions_account module, which will build directly on this foundation.

The future accounting module will be responsible for:

  • Creating a Vendor Bill from an infraction (or a generic accout.move), payable to the "Issuing Agency."
  • Creating a Customer Invoice to charge the fine and any administrative fees to the responsible driver or a third party.
  • Tracking the payment status of fines.
  • Linking infractions directly to their corresponding journal entries for full financial traceability.

@rpsjr rpsjr marked this pull request as draft September 17, 2025 16:56
@rpsjr rpsjr changed the title [18.0][ADD]fleet_traffic_infraction: new module [18.0][ADD]fleet_traffic_infraction: add new module Sep 17, 2025
@rpsjr rpsjr force-pushed the 18.0-ADD-fleet_traffic_infraction branch 6 times, most recently from c733846 to 027ed4e Compare September 25, 2025 14:47
@rpsjr rpsjr marked this pull request as ready for review September 25, 2025 14:49
@rpsjr
Copy link
Author

rpsjr commented Sep 25, 2025

@rpsjr rpsjr force-pushed the 18.0-ADD-fleet_traffic_infraction branch 2 times, most recently from 147bcc4 to 63a1574 Compare September 25, 2025 16:55
@marcelsavegnago
Copy link
Member

marcelsavegnago commented Sep 26, 2025

@rpsjr Could you please edit the commit message?

[18.0][ADD]fleet_traffic_infraction: new module

to

[ADD]fleet_traffic_infraction: new module

@rpsjr rpsjr changed the title [18.0][ADD]fleet_traffic_infraction: add new module [ADD]fleet_traffic_infraction: new module Sep 28, 2025
@rpsjr rpsjr force-pushed the 18.0-ADD-fleet_traffic_infraction branch from 63a1574 to 047c405 Compare September 28, 2025 11:17
@rpsjr rpsjr changed the title [ADD]fleet_traffic_infraction: new module [18.0][ADD]fleet_traffic_infraction: new module Sep 28, 2025
@rpsjr
Copy link
Author

rpsjr commented Sep 30, 2025

@rpsjr Could you please edit the commit message?

[18.0][ADD]fleet_traffic_infraction: new module

to

[ADD]fleet_traffic_infraction: new module

Made it

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