[19.0][MIG] fleet vehicle ownership: Migration to 19.0#219
[19.0][MIG] fleet vehicle ownership: Migration to 19.0#219DenerWilliam wants to merge 12 commits intoOCA:19.0from
Conversation
rfc rfc clean up [RFC] cleanup redundant files pre-commit [RFC] improve res_partner pre-commit typo typo typo [RFC] default_owner_id [RFC] tests
0a3442b to
54af1d4
Compare
| "website": "https://github.com/OCA/fleet", | ||
| "maintainers": ["cubells"], | ||
| "depends": ["fleet"], | ||
| "depends": ["fleet", "contacts"], |
There was a problem hiding this comment.
here there is no need to depend on the Contacts module
There was a problem hiding this comment.
The Fleet Vehicle Ownership module depends on Contacts because the vehicle owner is a contact (res.partner), and the module extends the contact form (model and view) to show and access that contact’s vehicles.
In a fresh installation, the Contacts module is not installed by default. If we did not declare contacts as a dependency, Fleet Vehicle Ownership could be installed in an environment where the Contacts app is missing: the extension of the contact form (and the vehicles button) would not work as intended. By declaring the dependency, we ensure that when Fleet Vehicle Ownership is installed, Contacts is installed automatically and the module works correctly in any installation.
Migration to Odoo 19.0
Changes made for Odoo 19 compatibility:
Manifest: version 19.0.1.0.0; dependency "contacts" added for the
res.partner view (Contacts app).
fleet_vehicle (model): owner_id field kept; no API changes.
fleet_vehicle (views): Owner field inserted after "driver_id" in form
and tree instead of "company_id", so Owner appears in single-company
databases (in single-company the Company field is not in the
fleet.vehicle view).
res.partner (model): vehicle_ids without required=True (allows partners
without vehicles); vehicle_count with compute as string
("_compute_vehicle_count") for inheritance and pylint E8147 compliance.
res.partner (view): Vehicles button with context default_owner_id to
set the owner when creating a vehicle from the contact.