diff --git a/fleet_vehicle_calendar_year/README.rst b/fleet_vehicle_calendar_year/README.rst new file mode 100644 index 00000000..5de62ee3 --- /dev/null +++ b/fleet_vehicle_calendar_year/README.rst @@ -0,0 +1,99 @@ +=========================== +Fleet Vehicle Calendar Year +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:270a34f0b9f59fd2f3243058b81c87b45cd3a423d0b52b89b1e1d02143783577 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffleet-lightgray.png?logo=github + :target: https://github.com/OCA/fleet/tree/18.0/fleet_vehicle_calendar_year + :alt: OCA/fleet +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/fleet-18-0/fleet-18-0-fleet_vehicle_calendar_year + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/fleet&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the fleet management functionality. Allows the +registration of the vehicle's calendar year. + +One example is the difference between the use of "model-year" and +"calendar-year" in describing the year of a fleet vehicle. Most of the +world uses calendar-year to designate a vehicle date; however, the U.S., +Mexico, and Canada use model-year. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Escodoo + +Contributors +------------ + +- Marcel Savegnago +- Kaynnan Lemes +- `Heliconia Solutions Pvt. Ltd. `__ + +Other credits +------------- + +The development of this module has been financially supported by: + +- Escodoo - https://www.escodoo.com.br + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-marcelsavegnago| image:: https://github.com/marcelsavegnago.png?size=40px + :target: https://github.com/marcelsavegnago + :alt: marcelsavegnago + +Current `maintainer `__: + +|maintainer-marcelsavegnago| + +This module is part of the `OCA/fleet `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fleet_vehicle_calendar_year/__init__.py b/fleet_vehicle_calendar_year/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/fleet_vehicle_calendar_year/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/fleet_vehicle_calendar_year/__manifest__.py b/fleet_vehicle_calendar_year/__manifest__.py new file mode 100644 index 00000000..4f9d91af --- /dev/null +++ b/fleet_vehicle_calendar_year/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2021 - TODAY, Escodoo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Fleet Vehicle Calendar Year", + "summary": """ + This module extends the fleet management functionality. Allows the + registration of the vehicle's calendar year.""", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "category": "Human Resources/Fleet", + "author": "Escodoo,Odoo Community Association (OCA)", + "maintainers": ["marcelsavegnago"], + "images": ["static/description/banner.png"], + "website": "https://github.com/OCA/fleet", + "depends": [ + "fleet", + ], + "data": [ + "views/fleet_vehicle.xml", + ], +} diff --git a/fleet_vehicle_calendar_year/i18n/es.po b/fleet_vehicle_calendar_year/i18n/es.po new file mode 100644 index 00000000..400ee1a5 --- /dev/null +++ b/fleet_vehicle_calendar_year/i18n/es.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fleet_vehicle_calendar_year +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-08-03 21:10+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model.fields,field_description:fleet_vehicle_calendar_year.field_fleet_vehicle__calendar_year +msgid "Calendar Year" +msgstr "Año del calendario" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model.fields,help:fleet_vehicle_calendar_year.field_fleet_vehicle__calendar_year +msgid "Calendar year of the vehicle" +msgstr "Año calendario del vehículo" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model,name:fleet_vehicle_calendar_year.model_fleet_vehicle +msgid "Vehicle" +msgstr "Vehículo" diff --git a/fleet_vehicle_calendar_year/i18n/fleet_vehicle_calendar_year.pot b/fleet_vehicle_calendar_year/i18n/fleet_vehicle_calendar_year.pot new file mode 100644 index 00000000..dcd10158 --- /dev/null +++ b/fleet_vehicle_calendar_year/i18n/fleet_vehicle_calendar_year.pot @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fleet_vehicle_calendar_year +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model.fields,field_description:fleet_vehicle_calendar_year.field_fleet_vehicle__calendar_year +msgid "Calendar Year" +msgstr "" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model.fields,help:fleet_vehicle_calendar_year.field_fleet_vehicle__calendar_year +msgid "Calendar year of the vehicle" +msgstr "" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model,name:fleet_vehicle_calendar_year.model_fleet_vehicle +msgid "Vehicle" +msgstr "" diff --git a/fleet_vehicle_calendar_year/i18n/it.po b/fleet_vehicle_calendar_year/i18n/it.po new file mode 100644 index 00000000..58169e10 --- /dev/null +++ b/fleet_vehicle_calendar_year/i18n/it.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fleet_vehicle_calendar_year +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-03-30 14:26+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model.fields,field_description:fleet_vehicle_calendar_year.field_fleet_vehicle__calendar_year +msgid "Calendar Year" +msgstr "Anno del calendario" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model.fields,help:fleet_vehicle_calendar_year.field_fleet_vehicle__calendar_year +msgid "Calendar year of the vehicle" +msgstr "Anno calendario del veicolo" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model,name:fleet_vehicle_calendar_year.model_fleet_vehicle +msgid "Vehicle" +msgstr "Veicolo" diff --git a/fleet_vehicle_calendar_year/i18n/pt_BR.po b/fleet_vehicle_calendar_year/i18n/pt_BR.po new file mode 100644 index 00000000..28fb9c4d --- /dev/null +++ b/fleet_vehicle_calendar_year/i18n/pt_BR.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fleet_vehicle_calendar_year +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-04-27 19:59+0000\n" +"Last-Translator: Marcel Savegnago \n" +"Language-Team: none\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model.fields,field_description:fleet_vehicle_calendar_year.field_fleet_vehicle__calendar_year +msgid "Calendar Year" +msgstr "Ano Calendário" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model.fields,help:fleet_vehicle_calendar_year.field_fleet_vehicle__calendar_year +msgid "Calendar year of the vehicle" +msgstr "Ano calendário do veículo" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model,name:fleet_vehicle_calendar_year.model_fleet_vehicle +msgid "Vehicle" +msgstr "Veículo" diff --git a/fleet_vehicle_calendar_year/i18n/sv.po b/fleet_vehicle_calendar_year/i18n/sv.po new file mode 100644 index 00000000..25fe7fa3 --- /dev/null +++ b/fleet_vehicle_calendar_year/i18n/sv.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fleet_vehicle_calendar_year +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-02 14:36+0000\n" +"Last-Translator: jakobkrabbe \n" +"Language-Team: none\n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model.fields,field_description:fleet_vehicle_calendar_year.field_fleet_vehicle__calendar_year +msgid "Calendar Year" +msgstr "Kalenderår" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model.fields,help:fleet_vehicle_calendar_year.field_fleet_vehicle__calendar_year +msgid "Calendar year of the vehicle" +msgstr "Kalenderår för fordonet" + +#. module: fleet_vehicle_calendar_year +#: model:ir.model,name:fleet_vehicle_calendar_year.model_fleet_vehicle +msgid "Vehicle" +msgstr "Fordon" diff --git a/fleet_vehicle_calendar_year/models/__init__.py b/fleet_vehicle_calendar_year/models/__init__.py new file mode 100644 index 00000000..53bbf7bd --- /dev/null +++ b/fleet_vehicle_calendar_year/models/__init__.py @@ -0,0 +1 @@ +from . import fleet_vehicle diff --git a/fleet_vehicle_calendar_year/models/fleet_vehicle.py b/fleet_vehicle_calendar_year/models/fleet_vehicle.py new file mode 100644 index 00000000..af821a4d --- /dev/null +++ b/fleet_vehicle_calendar_year/models/fleet_vehicle.py @@ -0,0 +1,13 @@ +# Copyright 2021 - TODAY, Marcel Savegnago +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class FleetVehicle(models.Model): + _inherit = "fleet.vehicle" + + calendar_year = fields.Char( + tracking=True, + help="Calendar year of the vehicle", + ) diff --git a/fleet_vehicle_calendar_year/pyproject.toml b/fleet_vehicle_calendar_year/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/fleet_vehicle_calendar_year/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/fleet_vehicle_calendar_year/readme/CONTRIBUTORS.md b/fleet_vehicle_calendar_year/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..134a56ed --- /dev/null +++ b/fleet_vehicle_calendar_year/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Marcel Savegnago \<\> +- Kaynnan Lemes \<\> +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) diff --git a/fleet_vehicle_calendar_year/readme/CREDITS.md b/fleet_vehicle_calendar_year/readme/CREDITS.md new file mode 100644 index 00000000..7bf0340a --- /dev/null +++ b/fleet_vehicle_calendar_year/readme/CREDITS.md @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +- Escodoo - diff --git a/fleet_vehicle_calendar_year/readme/DESCRIPTION.md b/fleet_vehicle_calendar_year/readme/DESCRIPTION.md new file mode 100644 index 00000000..7ae8a648 --- /dev/null +++ b/fleet_vehicle_calendar_year/readme/DESCRIPTION.md @@ -0,0 +1,7 @@ +This module extends the fleet management functionality. Allows the +registration of the vehicle's calendar year. + +One example is the difference between the use of "model-year" and +"calendar-year" in describing the year of a fleet vehicle. Most of the +world uses calendar-year to designate a vehicle date; however, the U.S., +Mexico, and Canada use model-year. diff --git a/fleet_vehicle_calendar_year/static/description/banner.png b/fleet_vehicle_calendar_year/static/description/banner.png new file mode 100644 index 00000000..da4f6de2 Binary files /dev/null and b/fleet_vehicle_calendar_year/static/description/banner.png differ diff --git a/fleet_vehicle_calendar_year/static/description/icon.png b/fleet_vehicle_calendar_year/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/fleet_vehicle_calendar_year/static/description/icon.png differ diff --git a/fleet_vehicle_calendar_year/static/description/index.html b/fleet_vehicle_calendar_year/static/description/index.html new file mode 100644 index 00000000..a44ee1b0 --- /dev/null +++ b/fleet_vehicle_calendar_year/static/description/index.html @@ -0,0 +1,440 @@ + + + + + +Fleet Vehicle Calendar Year + + + +
+

Fleet Vehicle Calendar Year

+ + +

Beta License: AGPL-3 OCA/fleet Translate me on Weblate Try me on Runboat

+

This module extends the fleet management functionality. Allows the +registration of the vehicle’s calendar year.

+

One example is the difference between the use of “model-year” and +“calendar-year” in describing the year of a fleet vehicle. Most of the +world uses calendar-year to designate a vehicle date; however, the U.S., +Mexico, and Canada use model-year.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Escodoo
  • +
+
+ +
+

Other credits

+

The development of this module has been financially supported by:

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

marcelsavegnago

+

This module is part of the OCA/fleet project on GitHub.

+

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

+
+
+
+ + 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", + ) diff --git a/fleet_vehicle_calendar_year/views/fleet_vehicle.xml b/fleet_vehicle_calendar_year/views/fleet_vehicle.xml new file mode 100644 index 00000000..69e9e7fa --- /dev/null +++ b/fleet_vehicle_calendar_year/views/fleet_vehicle.xml @@ -0,0 +1,15 @@ + + + + + fleet.vehicle.form (in fleet_vehicle_calendar_year) + fleet.vehicle + + + + + + + +