Skip to content

Conversation

@DenerWilliam
Copy link

Description

Migration of fleet_vehicle_fuel_type_ethanol from 18.0 to Odoo 19.0.

This module extends Fleet to add Ethanol and Flex (Gasoline/Ethanol) as fuel types for vehicles.

Motivation / Context

In Odoo 19, how fuel type is defined changed:

  • In 18.0 and earlier, the main reference was the fuel_type field on fleet.vehicle.
  • In 19.0, fuel type is defined on fleet.vehicle.model in the default_fuel_type field, and the vehicle’s fuel_type is computed from the model.

For Ethanol and Flex to remain available in the UI (both on the model and on the vehicle), the module must extend both models.

Changes made

Code

  • fleet.vehicle.model: extended default_fuel_type with selection_add for ethanol and flex, including ondelete for Odoo 17+ compatibility.
  • fleet.vehicle: kept the extension of fuel_type with selection_add for the same options (and ondelete where applicable), so the value propagated from the model displays correctly on the vehicle.
  • __manifest__.py: version updated from 18.0.x.x.x to 19.0.1.0.0 to avoid the "incompatible version, setting installable=False" warning on Odoo 19.

Structure

  • Both extensions (model and vehicle) remain in the same file models/fleet_vehicle.py, reusing the existing structure.

Checklist

  • Code compatible with Odoo 19.0
  • Extension on fleet.vehicle.model.default_fuel_type (source of the value in 19.0)
  • Extension on fleet.vehicle.fuel_type (display on the vehicle form)
  • ondelete used for values added via selection_add
  • Manifest version set to 19.0

How to test

  1. Install the Fleet module if not already installed.
  2. Install the Fleet Vehicle Fuel Type Ethanol module.
  3. In Fleet:
    • Open a Vehicle model and check that Ethanol and Flex (Gasoline/Ethanol) appear in the Fuel type field.
    • Open a Vehicle and check the same in the Fuel type field (in the Model/Engine area and in the vehicle section).

Related

  • OCA fleet migration to 19.0
  • Original module (18.0): OCA/fleet — fleet_vehicle_fuel_type_ethanol

@OCA-git-bot
Copy link
Contributor

Hi @marcelsavegnago,
some modules you are maintaining are being modified, check this out!

@marcelsavegnago
Copy link
Member

marcelsavegnago commented Jan 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.

3 participants