feat: upgrade version from 18 to 19 #211
Closed
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.
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:
fuel_typefield onfleet.vehicle.fleet.vehicle.modelin thedefault_fuel_typefield, and the vehicle’sfuel_typeis 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: extendeddefault_fuel_typewithselection_addforethanolandflex, includingondeletefor Odoo 17+ compatibility.fleet.vehicle: kept the extension offuel_typewithselection_addfor the same options (andondeletewhere applicable), so the value propagated from the model displays correctly on the vehicle.__manifest__.py: version updated from18.0.x.x.xto19.0.1.0.0to avoid the "incompatible version, setting installable=False" warning on Odoo 19.Structure
models/fleet_vehicle.py, reusing the existing structure.Checklist
fleet.vehicle.model.default_fuel_type(source of the value in 19.0)fleet.vehicle.fuel_type(display on the vehicle form)ondeleteused for values added viaselection_addHow to test
Related