Skip to content

Commit 2bce5b3

Browse files
[MIG] fleet_vehicle_log_fuel: Migration to 19.0
1 parent 7fe260b commit 2bce5b3

File tree

6 files changed

+34
-24
lines changed

6 files changed

+34
-24
lines changed

fleet_vehicle_log_fuel/README.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
======================
26
Fleet Vehicle Log Fuel
37
======================
@@ -13,17 +17,17 @@ Fleet Vehicle Log Fuel
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffleet-lightgray.png?logo=github
20-
:target: https://github.com/OCA/fleet/tree/18.0/fleet_vehicle_log_fuel
24+
:target: https://github.com/OCA/fleet/tree/19.0/fleet_vehicle_log_fuel
2125
:alt: OCA/fleet
2226
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/fleet-18-0/fleet-18-0-fleet_vehicle_log_fuel
27+
:target: https://translation.odoo-community.org/projects/fleet-19-0/fleet-19-0-fleet_vehicle_log_fuel
2428
:alt: Translate me on Weblate
2529
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/fleet&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/fleet&target_branch=19.0
2731
:alt: Try me on Runboat
2832

2933
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -41,7 +45,7 @@ Bug Tracker
4145
Bugs are tracked on `GitHub Issues <https://github.com/OCA/fleet/issues>`_.
4246
In case of trouble, please check there if your issue has already been reported.
4347
If you spotted it first, help us to smash it by providing a detailed and welcomed
44-
`feedback <https://github.com/OCA/fleet/issues/new?body=module:%20fleet_vehicle_log_fuel%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
48+
`feedback <https://github.com/OCA/fleet/issues/new?body=module:%20fleet_vehicle_log_fuel%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
4549

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

@@ -77,6 +81,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
7781
mission is to support the collaborative development of Odoo features and
7882
promote its widespread use.
7983

80-
This module is part of the `OCA/fleet <https://github.com/OCA/fleet/tree/18.0/fleet_vehicle_log_fuel>`_ project on GitHub.
84+
This module is part of the `OCA/fleet <https://github.com/OCA/fleet/tree/19.0/fleet_vehicle_log_fuel>`_ project on GitHub.
8185

8286
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

fleet_vehicle_log_fuel/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"name": "Fleet Vehicle Log Fuel",
66
"summary": "Add Log Fuels for your vehicles.",
7-
"version": "18.0.1.0.0",
7+
"version": "19.0.1.0.0",
88
"category": "Fleet",
99
"author": "ForgeFlow, Tecnativa, Odoo Community Association (OCA)",
1010
"website": "https://github.com/OCA/fleet",

fleet_vehicle_log_fuel/models/fleet_vehicle.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ class FleetVehicle(models.Model):
1313

1414
@api.depends("log_fuels")
1515
def _compute_fuel_count(self):
16-
res = self.env["fleet.vehicle.log.fuel"].read_group(
16+
data = self.env["fleet.vehicle.log.fuel"]._read_group(
1717
domain=[("vehicle_id", "in", self.ids)],
18-
fields=["vehicle_id"],
1918
groupby=["vehicle_id"],
19+
aggregates=["__count"],
2020
)
21-
res_dict = {x["vehicle_id"][0]: x["vehicle_id_count"] for x in res}
21+
res_dict = {vehicle.id: count for vehicle, count in data}
2222
for record in self:
2323
record.fuel_count = res_dict.get(record.id, 0)
24-
return res
2524

2625
def action_view_log_fuel(self):
2726
action = self.env["ir.actions.act_window"]._for_xml_id(

fleet_vehicle_log_fuel/models/fleet_vehicle_log_fuel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2024 Tecnativa - Víctor Martínez
33
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
44

5-
from odoo import _, api, fields, models
5+
from odoo import api, fields, models
66
from odoo.exceptions import UserError
77

88

@@ -103,7 +103,7 @@ def _compute_odometer(self):
103103
def _inverse_odometer(self):
104104
if any(not x.odometer for x in self):
105105
raise UserError(
106-
_("Emptying the odometer value of a vehicle is not allowed.")
106+
self.env._("Emptying the odometer value of a vehicle is not allowed.")
107107
)
108108
for record in self:
109109
self.odometer_id = self.env["fleet.vehicle.odometer"].create(

fleet_vehicle_log_fuel/static/description/index.html

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Fleet Vehicle Log Fuel</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,21 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="fleet-vehicle-log-fuel">
364-
<h1 class="title">Fleet Vehicle Log Fuel</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="fleet-vehicle-log-fuel">
370+
<h1>Fleet Vehicle Log Fuel</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:5152da5ba0e2b43adf86a831cae944094e73b5ddf5ffe34f441f96ad620a4cc0
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/fleet/tree/18.0/fleet_vehicle_log_fuel"><img alt="OCA/fleet" src="https://img.shields.io/badge/github-OCA%2Ffleet-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/fleet-18-0/fleet-18-0-fleet_vehicle_log_fuel"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/fleet&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/fleet/tree/19.0/fleet_vehicle_log_fuel"><img alt="OCA/fleet" src="https://img.shields.io/badge/github-OCA%2Ffleet-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/fleet-19-0/fleet-19-0-fleet_vehicle_log_fuel"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/fleet&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p>This module adds fuel logs in a similar way as services.</p>
374379
<p><strong>Table of contents</strong></p>
375380
<div class="contents local topic" id="contents">
@@ -384,24 +389,24 @@ <h1 class="title">Fleet Vehicle Log Fuel</h1>
384389
</ul>
385390
</div>
386391
<div class="section" id="bug-tracker">
387-
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
392+
<h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
388393
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/fleet/issues">GitHub Issues</a>.
389394
In case of trouble, please check there if your issue has already been reported.
390395
If you spotted it first, help us to smash it by providing a detailed and welcomed
391-
<a class="reference external" href="https://github.com/OCA/fleet/issues/new?body=module:%20fleet_vehicle_log_fuel%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
396+
<a class="reference external" href="https://github.com/OCA/fleet/issues/new?body=module:%20fleet_vehicle_log_fuel%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
392397
<p>Do not contact contributors directly about support or help with technical issues.</p>
393398
</div>
394399
<div class="section" id="credits">
395-
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
400+
<h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
396401
<div class="section" id="authors">
397-
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
402+
<h3><a class="toc-backref" href="#toc-entry-3">Authors</a></h3>
398403
<ul class="simple">
399404
<li>ForgeFlow</li>
400405
<li>Tecnativa</li>
401406
</ul>
402407
</div>
403408
<div class="section" id="contributors">
404-
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
409+
<h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
405410
<ul class="simple">
406411
<li>Miquel Raïch &lt;<a class="reference external" href="mailto:miquel.raich&#64;forgeflow.com">miquel.raich&#64;forgeflow.com</a>&gt;</li>
407412
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
@@ -413,18 +418,19 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
413418
</ul>
414419
</div>
415420
<div class="section" id="maintainers">
416-
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
421+
<h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
417422
<p>This module is maintained by the OCA.</p>
418423
<a class="reference external image-reference" href="https://odoo-community.org">
419424
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
420425
</a>
421426
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
422427
mission is to support the collaborative development of Odoo features and
423428
promote its widespread use.</p>
424-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/fleet/tree/18.0/fleet_vehicle_log_fuel">OCA/fleet</a> project on GitHub.</p>
429+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/fleet/tree/19.0/fleet_vehicle_log_fuel">OCA/fleet</a> project on GitHub.</p>
425430
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
426431
</div>
427432
</div>
428433
</div>
434+
</div>
429435
</body>
430436
</html>

fleet_vehicle_log_fuel/views/fleet_vehicle_log_fuel_views.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
nolabel="1"
7474
name="notes"
7575
placeholder="Write here any other information related to the service completed."
76+
colspan="2"
7677
/>
7778
</group>
7879
</sheet>

0 commit comments

Comments
 (0)