Skip to content

Commit

Permalink
[MIG] fleet_vehicle_calendar_year: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HeliconiaSolutions committed Dec 31, 2024
1 parent 4a2ffb5 commit bf26239
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 1 deletion.
1 change: 1 addition & 0 deletions fleet_vehicle_calendar_year/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Contributors

- Marcel Savegnago <marcel.savegnago@escodoo.com.br>
- Kaynnan Lemes <kaynnan.lemes@escodoo.com.br>
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

Other credits
-------------
Expand Down
2 changes: 1 addition & 1 deletion fleet_vehicle_calendar_year/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"summary": """
This module extends the fleet management functionality. Allows the
registration of the vehicle's calendar year.""",
"version": "16.0.1.0.0",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"category": "Human Resources/Fleet",
"author": "Escodoo,Odoo Community Association (OCA)",
Expand Down
1 change: 1 addition & 0 deletions fleet_vehicle_calendar_year/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Marcel Savegnago \<<marcel.savegnago@escodoo.com.br>\>
- Kaynnan Lemes \<<kaynnan.lemes@escodoo.com.br>\>
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
1 change: 1 addition & 0 deletions fleet_vehicle_calendar_year/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Marcel Savegnago &lt;<a class="reference external" href="mailto:marcel.savegnago&#64;escodoo.com.br">marcel.savegnago&#64;escodoo.com.br</a>&gt;</li>
<li>Kaynnan Lemes &lt;<a class="reference external" href="mailto:kaynnan.lemes&#64;escodoo.com.br">kaynnan.lemes&#64;escodoo.com.br</a>&gt;</li>
<li><a class="reference external" href="https://www.heliconia.io">Heliconia Solutions Pvt. Ltd.</a></li>
</ul>
</div>
<div class="section" id="other-credits">
Expand Down
1 change: 1 addition & 0 deletions fleet_vehicle_calendar_year/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import fleet_vehicle_test
46 changes: 46 additions & 0 deletions fleet_vehicle_calendar_year/tests/fleet_vehicle_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from odoo.tests.common import TransactionCase


class TestFleetVehicle(TransactionCase):
def setUp(self):
super().setUp()
self.FleetVehicle = self.env["fleet.vehicle"]
self.vehicle = self.FleetVehicle.create(
{
"name": "Test Vehicle",
"license_plate": "TEST123",
"model_id": self.env["fleet.vehicle.model"]
.create({"name": "Test Model"})
.id,
"calendar_year": "2024",
}
)

def test_calendar_year_field(self):
"""Test the calendar_year field functionality."""
# Check initial value
self.assertEqual(
self.vehicle.calendar_year, "2024", "Calendar year should be '2024'"
)

# Update calendar_year
self.vehicle.calendar_year = "2025"
self.assertEqual(
self.vehicle.calendar_year,
"2025",
"Calendar year should be updated to '2025'",
)

def test_tracking(self):
"""Test if changes in the calendar_year field are tracked in the chatter."""
message_count_before = len(self.vehicle.message_ids)

# Modify the calendar_year
self.vehicle.calendar_year = "2026"

message_count_after = len(self.vehicle.message_ids)
self.assertGreater(
message_count_after,
message_count_before,
"The calendar_year change should create a new message in the chatter",
)

0 comments on commit bf26239

Please sign in to comment.