diff --git a/fleet_vehicle_calendar_year/README.rst b/fleet_vehicle_calendar_year/README.rst index 80f63522..5de62ee3 100644 --- a/fleet_vehicle_calendar_year/README.rst +++ b/fleet_vehicle_calendar_year/README.rst @@ -64,6 +64,7 @@ Contributors - Marcel Savegnago - Kaynnan Lemes +- `Heliconia Solutions Pvt. Ltd. `__ Other credits ------------- diff --git a/fleet_vehicle_calendar_year/__manifest__.py b/fleet_vehicle_calendar_year/__manifest__.py index 9b78dc30..4f9d91af 100644 --- a/fleet_vehicle_calendar_year/__manifest__.py +++ b/fleet_vehicle_calendar_year/__manifest__.py @@ -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)", diff --git a/fleet_vehicle_calendar_year/readme/CONTRIBUTORS.md b/fleet_vehicle_calendar_year/readme/CONTRIBUTORS.md index 8117100e..134a56ed 100644 --- a/fleet_vehicle_calendar_year/readme/CONTRIBUTORS.md +++ b/fleet_vehicle_calendar_year/readme/CONTRIBUTORS.md @@ -1,2 +1,3 @@ - Marcel Savegnago \<\> - Kaynnan Lemes \<\> +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) diff --git a/fleet_vehicle_calendar_year/static/description/index.html b/fleet_vehicle_calendar_year/static/description/index.html index 05ffff74..a44ee1b0 100644 --- a/fleet_vehicle_calendar_year/static/description/index.html +++ b/fleet_vehicle_calendar_year/static/description/index.html @@ -410,6 +410,7 @@

Contributors

diff --git a/fleet_vehicle_calendar_year/tests/__init__.py b/fleet_vehicle_calendar_year/tests/__init__.py new file mode 100644 index 00000000..70933248 --- /dev/null +++ b/fleet_vehicle_calendar_year/tests/__init__.py @@ -0,0 +1 @@ +from . import fleet_vehicle_test diff --git a/fleet_vehicle_calendar_year/tests/fleet_vehicle_test.py b/fleet_vehicle_calendar_year/tests/fleet_vehicle_test.py new file mode 100644 index 00000000..6a91e2dc --- /dev/null +++ b/fleet_vehicle_calendar_year/tests/fleet_vehicle_test.py @@ -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", + )