Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
236 changes: 236 additions & 0 deletions fleet_traffic_infractions/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
=========================
Fleet Traffic Infractions
=========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a72564b08a702e50ad0785994d18f0ded624170855d95ba29dab9bed681daf97
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffleet-lightgray.png?logo=github
:target: https://github.com/OCA/fleet/tree/18.0/fleet_traffic_infractions
:alt: OCA/fleet
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/fleet-18-0/fleet-18-0-fleet_traffic_infractions
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/fleet&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module provides a robust framework to manage and track traffic
infractions for your fleet vehicles.

**Key Features:**

- Create and manage a central registry of all traffic infractions.
- Automatically suggest the responsible driver by checking the vehicle's
assignment logs for the exact date and time of the incident.
- Log a detailed, timezone-aware note in the chatter if a user manually
changes the suggested driver, ensuring a clear audit trail.
- Define and categorize different types of infractions (e.g., speeding,
illegal parking) with jurisdictional details.
- Mark contact partners as "Traffic Issuing Agencies" to streamline data
entry.
- Integrates directly with the Vehicle and Partner forms, adding smart
buttons to quickly view all related infractions.
- Allows infractions to be saved in a draft state and only validates
mandatory fields upon confirmation.

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

Managing a fleet of vehicles often involves dealing with a constant and
disorganized flow of traffic tickets. Fleet managers face several key
challenges:

- **Identifying the Responsible Driver:** It can be a time-consuming and
manual process to determine who was driving a specific vehicle at the
exact time a fine was issued, often leading to disputes.
- **Lack of Centralized Tracking:** Without a dedicated system, it's
difficult to track the status of an infraction from the moment it's
received until it's resolved.
- **Operational vs. Financial Disconnect:** The operational details of a
fine (who, what, when) are often disconnected from the financial
process (paying the agency, charging the driver).

This module was created to solve the **operational** part of this
problem. It provides a clean, focused system for recording what happened
and, most importantly, automates the critical task of identifying the
responsible driver using the vehicle's assignment history. By creating a
reliable operational record, it lays the foundation for a transparent
and efficient management process.

Installation
============

To install this module, you need to:

1. Add this module to your Odoo addons path.
2. Restart the Odoo server.
3. Go to the "Apps" menu, find the module, and click "Install".

**Dependencies:**

This module's core driver suggestion feature relies on the
``fleet_vehicle_assignation_log_datetime`` module. Please ensure it is
installed and that your vehicle assignment logs are properly maintained
with start and end datetimes for accurate driver lookups.

Configuration
=============

Before you can effectively use this module, you need to perform two
configuration steps:

1. **Mark Traffic Issuing Agencies:**

- Navigate to the ``Contacts`` application.
- Find or create the contact record for an agency that issues fines
(e.g., "City Traffic Department", "State Highway Patrol").
- On the contact form, check the box labeled **"Is a Traffic Issuing
Agency"**.
- *This will ensure that only relevant partners appear in the
"Issuing Agency" dropdown when creating an infraction.*

2. **Define Infraction Types:**

- Navigate to ``Fleet > Configuration > Infraction Types``.
- Click "New" to create categories for the fines you typically
receive.
- Fill in the details:

- **Infraction Code:** A unique code for the infraction (e.g.,
``SPEED-01``).
- **Description:** A clear description (e.g., "Exceeding Speed
Limit by 10-20%").
- **Jurisdiction:** Define if the rule is at the Country, State, or
Municipal level.

- *This allows for consistent data entry and will be useful for
future reporting.*

Usage
=====

This module is designed to be straightforward. The main workflow is
creating and confirming an infraction.

**1. Registering a New Traffic Infraction:**

- Navigate to ``Fleet > Infractions > Traffic Infractions`` and click
"New".
- The form is designed for a logical workflow. For the best experience,
follow these steps:

1. Select the **Vehicle** that received the fine.
2. Set the **Infraction Datetime** to the exact date and time the
incident occurred.

- **Automatic Driver Suggestion:** After setting the vehicle and
datetime, the **Driver** field will be automatically populated based
on the vehicle's assignment logs.
- Fill in the remaining details of the ticket:

- **Infraction Type:** Select the category you configured.
- **Infraction Auto Number:** Enter the official ticket or reference
number.
- **Issuing Agency:** Select the agency that issued the fine.
- **Fine Amount** and **Due Date**.

- You can click **Save** at any time to keep the infraction in a
``Draft`` state.

**2. Confirming and Managing the Infraction:**

- Once all details are complete, click the **Confirm** button. The
system will verify that all mandatory fields are filled before
changing the state to ``Confirmed``.
- **Driver Change Logging:** If the automatically suggested driver is
incorrect and you manually change it, a detailed note will be
automatically posted in the chatter. This note includes the old and
new driver, the infraction time (with the user's timezone), and a
comparison against the assignment log, ensuring full traceability.

**3. Accessing Infractions from Other Views:**

- On a **Vehicle** form, you can use the **"Traffic Infractions"** smart
button to see all fines associated with that vehicle.
- On a **Partner** form, you will see a **"Driver Infractions"** smart
button to view all infractions where that partner was the driver.

Known issues / Roadmap
======================

This module provides the core operational foundation for managing
traffic infractions. The roadmap includes creating a separate companion
module for financial integration.

**Future Module: ``fleet_traffic_infractions_account``**

This planned module will extend the functionality of this one to handle
all accounting aspects:

- Create a Vendor Bill from a confirmed infraction, with the "Issuing
Agency" as the vendor.
- Create a Customer Invoice to charge the fine and any administrative
fees to the responsible driver.
- Track the payment status of both the bill and the invoice.
- Provide a clear link between the infraction record and its
corresponding journal entries.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/fleet/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/fleet/issues/new?body=module:%20fleet_traffic_infractions%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Raimundo Pereira da Silva Junior

Contributors
------------

- Raimundo Pereira da Silva Junior
- Odoo Community Association (OCA)

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/fleet <https://github.com/OCA/fleet/tree/18.0/fleet_traffic_infractions>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions fleet_traffic_infractions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
28 changes: 28 additions & 0 deletions fleet_traffic_infractions/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2025 Raimundo Pereira da Silva Junior, Odoo Community Association (OCA)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Fleet Traffic Infractions",
"version": "18.0.1.0.0",
"category": "Fleet",
"summary": "Manage and track traffic infractions for your fleet vehicles.",
"author": "Raimundo Pereira da Silva Junior, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/fleet",
"license": "AGPL-3",
"depends": [
"fleet",
"fleet_vehicle_assignation_log_datetime",
],
"data": [
"security/ir.model.access.csv",
"views/fleet_traffic_infraction_type_views.xml",
"views/fleet_traffic_infraction_views.xml",
"views/fleet_vehicle_views.xml",
"views/res_partner_views.xml",
"data/ir_sequence_data.xml",
"views/fleet_traffic_infraction_menus.xml",
],
"demo": [
"demo/fleet_traffic_infractions_demo.xml",
],
"installable": True,
}
11 changes: 11 additions & 0 deletions fleet_traffic_infractions/data/ir_sequence_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!-- Sequence for fleet.traffic.infractions -->
<record id="seq_fleet_traffic_infractions" model="ir.sequence">
<field name="name">Traffic Infraction Sequence</field>
<field name="code">fleet.traffic.infractions</field>
<field name="prefix">TI</field>
<field name="padding">5</field>
<field name="company_id" eval="False" />
</record>
</odoo>
Loading
Loading