diff --git a/fleet_vehicle_fuel_capacity/README.rst b/fleet_vehicle_fuel_capacity/README.rst new file mode 100644 index 00000000..b9db8bb1 --- /dev/null +++ b/fleet_vehicle_fuel_capacity/README.rst @@ -0,0 +1,100 @@ +=========================== +Fleet Vehicle Fuel Capacity +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b926107013d3a3567e57cca6ed552a326bf0eb5d5f7a093f3e4db76c44479db9 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/17.0/fleet_vehicle_fuel_capacity + :alt: OCA/fleet +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/fleet-17-0/fleet-17-0-fleet_vehicle_fuel_capacity + :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=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of fleet management. It allows the +registration of a vehicle's fuel capacity + +**Table of contents** + +.. contents:: + :local: + +Known issues / Roadmap +====================== + +- Add restriction fuel capacity in the refueling logs + (fleet.vehicle.log.fuel) + +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_fuel_capacity/__init__.py b/fleet_vehicle_fuel_capacity/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/fleet_vehicle_fuel_capacity/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/fleet_vehicle_fuel_capacity/__manifest__.py b/fleet_vehicle_fuel_capacity/__manifest__.py new file mode 100644 index 00000000..1fd595d0 --- /dev/null +++ b/fleet_vehicle_fuel_capacity/__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 Fuel Capacity", + "summary": """ + This module extends the functionality of fleet management. It allows the + registration of a vehicle's fuel capacity.""", + "version": "17.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_fuel_capacity/i18n/es.po b/fleet_vehicle_fuel_capacity/i18n/es.po new file mode 100644 index 00000000..9e9f21fa --- /dev/null +++ b/fleet_vehicle_fuel_capacity/i18n/es.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fleet_vehicle_fuel_capacity +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-09-05 21:37+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_fuel_capacity +#: model:ir.model.fields,field_description:fleet_vehicle_fuel_capacity.field_fleet_vehicle__fuel_capacity +msgid "Fuel Capacity (L)" +msgstr "Capacidad de combustible (L)" + +#. module: fleet_vehicle_fuel_capacity +#: model:ir.model.constraint,message:fleet_vehicle_fuel_capacity.constraint_fleet_vehicle_check_fuel_capacity +msgid "Fuel capacity must be greater than or equal to 0" +msgstr "La capacidad de combustible debe ser mayor o igual a 0" + +#. module: fleet_vehicle_fuel_capacity +#: model:ir.model,name:fleet_vehicle_fuel_capacity.model_fleet_vehicle +msgid "Vehicle" +msgstr "Vehículo" diff --git a/fleet_vehicle_fuel_capacity/i18n/fleet_vehicle_fuel_capacity.pot b/fleet_vehicle_fuel_capacity/i18n/fleet_vehicle_fuel_capacity.pot new file mode 100644 index 00000000..955a2fc8 --- /dev/null +++ b/fleet_vehicle_fuel_capacity/i18n/fleet_vehicle_fuel_capacity.pot @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fleet_vehicle_fuel_capacity +# +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_fuel_capacity +#: model:ir.model.fields,field_description:fleet_vehicle_fuel_capacity.field_fleet_vehicle__fuel_capacity +msgid "Fuel Capacity (L)" +msgstr "" + +#. module: fleet_vehicle_fuel_capacity +#: model:ir.model.constraint,message:fleet_vehicle_fuel_capacity.constraint_fleet_vehicle_check_fuel_capacity +msgid "Fuel capacity must be greater than or equal to 0" +msgstr "" + +#. module: fleet_vehicle_fuel_capacity +#: model:ir.model,name:fleet_vehicle_fuel_capacity.model_fleet_vehicle +msgid "Vehicle" +msgstr "" diff --git a/fleet_vehicle_fuel_capacity/i18n/it.po b/fleet_vehicle_fuel_capacity/i18n/it.po new file mode 100644 index 00000000..6a82fa20 --- /dev/null +++ b/fleet_vehicle_fuel_capacity/i18n/it.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fleet_vehicle_fuel_capacity +# +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_fuel_capacity +#: model:ir.model.fields,field_description:fleet_vehicle_fuel_capacity.field_fleet_vehicle__fuel_capacity +msgid "Fuel Capacity (L)" +msgstr "Capacità carburante (L)" + +#. module: fleet_vehicle_fuel_capacity +#: model:ir.model.constraint,message:fleet_vehicle_fuel_capacity.constraint_fleet_vehicle_check_fuel_capacity +msgid "Fuel capacity must be greater than or equal to 0" +msgstr "La capacità carburante deve essere maggiore o uguale a zero" + +#. module: fleet_vehicle_fuel_capacity +#: model:ir.model,name:fleet_vehicle_fuel_capacity.model_fleet_vehicle +msgid "Vehicle" +msgstr "Veicolo" diff --git a/fleet_vehicle_fuel_capacity/i18n/pt_BR.po b/fleet_vehicle_fuel_capacity/i18n/pt_BR.po new file mode 100644 index 00000000..ee5d7141 --- /dev/null +++ b/fleet_vehicle_fuel_capacity/i18n/pt_BR.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fleet_vehicle_fuel_capacity +# +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_fuel_capacity +#: model:ir.model.fields,field_description:fleet_vehicle_fuel_capacity.field_fleet_vehicle__fuel_capacity +msgid "Fuel Capacity (L)" +msgstr "Capacidade de Combustível(L)" + +#. module: fleet_vehicle_fuel_capacity +#: model:ir.model.constraint,message:fleet_vehicle_fuel_capacity.constraint_fleet_vehicle_check_fuel_capacity +msgid "Fuel capacity must be greater than or equal to 0" +msgstr "A capacidade do combustível deve ser maior ou igual a 0" + +#. module: fleet_vehicle_fuel_capacity +#: model:ir.model,name:fleet_vehicle_fuel_capacity.model_fleet_vehicle +msgid "Vehicle" +msgstr "Veículo" diff --git a/fleet_vehicle_fuel_capacity/i18n/sv.po b/fleet_vehicle_fuel_capacity/i18n/sv.po new file mode 100644 index 00000000..2a527de4 --- /dev/null +++ b/fleet_vehicle_fuel_capacity/i18n/sv.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fleet_vehicle_fuel_capacity +# +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_fuel_capacity +#: model:ir.model.fields,field_description:fleet_vehicle_fuel_capacity.field_fleet_vehicle__fuel_capacity +msgid "Fuel Capacity (L)" +msgstr "Bränslekapacitet (L)" + +#. module: fleet_vehicle_fuel_capacity +#: model:ir.model.constraint,message:fleet_vehicle_fuel_capacity.constraint_fleet_vehicle_check_fuel_capacity +msgid "Fuel capacity must be greater than or equal to 0" +msgstr "Bränslekapaciteten måste vara större än eller lika med 0" + +#. module: fleet_vehicle_fuel_capacity +#: model:ir.model,name:fleet_vehicle_fuel_capacity.model_fleet_vehicle +msgid "Vehicle" +msgstr "Fordon" diff --git a/fleet_vehicle_fuel_capacity/models/__init__.py b/fleet_vehicle_fuel_capacity/models/__init__.py new file mode 100644 index 00000000..53bbf7bd --- /dev/null +++ b/fleet_vehicle_fuel_capacity/models/__init__.py @@ -0,0 +1 @@ +from . import fleet_vehicle diff --git a/fleet_vehicle_fuel_capacity/models/fleet_vehicle.py b/fleet_vehicle_fuel_capacity/models/fleet_vehicle.py new file mode 100644 index 00000000..9eab46a3 --- /dev/null +++ b/fleet_vehicle_fuel_capacity/models/fleet_vehicle.py @@ -0,0 +1,18 @@ +# 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" + + fuel_capacity = fields.Float(string="Fuel Capacity (L)", tracking=True) + + _sql_constraints = [ + ( + "check_fuel_capacity", + "CHECK(fuel_capacity >= 0)", + "Fuel capacity must be greater than or equal to 0", + ) + ] diff --git a/fleet_vehicle_fuel_capacity/pyproject.toml b/fleet_vehicle_fuel_capacity/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/fleet_vehicle_fuel_capacity/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/fleet_vehicle_fuel_capacity/readme/CONTRIBUTORS.md b/fleet_vehicle_fuel_capacity/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..134a56ed --- /dev/null +++ b/fleet_vehicle_fuel_capacity/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Marcel Savegnago \<\> +- Kaynnan Lemes \<\> +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) diff --git a/fleet_vehicle_fuel_capacity/readme/CREDITS.md b/fleet_vehicle_fuel_capacity/readme/CREDITS.md new file mode 100644 index 00000000..7bf0340a --- /dev/null +++ b/fleet_vehicle_fuel_capacity/readme/CREDITS.md @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +- Escodoo - diff --git a/fleet_vehicle_fuel_capacity/readme/DESCRIPTION.md b/fleet_vehicle_fuel_capacity/readme/DESCRIPTION.md new file mode 100644 index 00000000..fb68a962 --- /dev/null +++ b/fleet_vehicle_fuel_capacity/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module extends the functionality of fleet management. It allows the +registration of a vehicle's fuel capacity diff --git a/fleet_vehicle_fuel_capacity/readme/ROADMAP.md b/fleet_vehicle_fuel_capacity/readme/ROADMAP.md new file mode 100644 index 00000000..f806748a --- /dev/null +++ b/fleet_vehicle_fuel_capacity/readme/ROADMAP.md @@ -0,0 +1,2 @@ +- Add restriction fuel capacity in the refueling logs + (fleet.vehicle.log.fuel) diff --git a/fleet_vehicle_fuel_capacity/static/description/banner.png b/fleet_vehicle_fuel_capacity/static/description/banner.png new file mode 100644 index 00000000..da4f6de2 Binary files /dev/null and b/fleet_vehicle_fuel_capacity/static/description/banner.png differ diff --git a/fleet_vehicle_fuel_capacity/static/description/icon.png b/fleet_vehicle_fuel_capacity/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/fleet_vehicle_fuel_capacity/static/description/icon.png differ diff --git a/fleet_vehicle_fuel_capacity/static/description/index.html b/fleet_vehicle_fuel_capacity/static/description/index.html new file mode 100644 index 00000000..ff7cc6ef --- /dev/null +++ b/fleet_vehicle_fuel_capacity/static/description/index.html @@ -0,0 +1,444 @@ + + + + + +Fleet Vehicle Fuel Capacity + + + +
+

Fleet Vehicle Fuel Capacity

+ + +

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

+

This module extends the functionality of fleet management. It allows the +registration of a vehicle’s fuel capacity

+

Table of contents

+ +
+

Known issues / Roadmap

+
    +
  • Add restriction fuel capacity in the refueling logs +(fleet.vehicle.log.fuel)
  • +
+
+
+

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_fuel_capacity/tests.zip b/fleet_vehicle_fuel_capacity/tests.zip new file mode 100644 index 00000000..70eb3cd5 Binary files /dev/null and b/fleet_vehicle_fuel_capacity/tests.zip differ diff --git a/fleet_vehicle_fuel_capacity/tests/__init__.py b/fleet_vehicle_fuel_capacity/tests/__init__.py new file mode 100644 index 00000000..52c23c4c --- /dev/null +++ b/fleet_vehicle_fuel_capacity/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2021 - TODAY, Marcel Savegnago +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_vehicle_fuel_capacity diff --git a/fleet_vehicle_fuel_capacity/tests/test_vehicle_fuel_capacity.py b/fleet_vehicle_fuel_capacity/tests/test_vehicle_fuel_capacity.py new file mode 100644 index 00000000..7cc0eee7 --- /dev/null +++ b/fleet_vehicle_fuel_capacity/tests/test_vehicle_fuel_capacity.py @@ -0,0 +1,32 @@ +# Copyright 2021 - TODAY, Marcel Savegnago +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo.tests.common import TransactionCase + + +class TestFleetVehicleFuelCapacity(TransactionCase): + def setUp(self): + """Set up initial data for the test cases.""" + super().setUp() + + # Create a vehicle model (you can use a valid brand ID or mock it) + self.vehicle_model = self.env["fleet.vehicle.model"].create( + { + "name": "Model Name", + "brand_id": 1, # Assuming brand_id 1 exists + } + ) + + def test_valid_fuel_capacity(self): + """Test if a vehicle can be created with a valid fuel capacity.""" + vehicle = self.env["fleet.vehicle"].create( + { + "model_id": self.vehicle_model.id, + "fuel_capacity": 50.0, # Valid fuel capacity + } + ) + + self.assertEqual( + vehicle.fuel_capacity, 50.0, "The fuel capacity should be 50.0 liters." + ) diff --git a/fleet_vehicle_fuel_capacity/views/fleet_vehicle.xml b/fleet_vehicle_fuel_capacity/views/fleet_vehicle.xml new file mode 100644 index 00000000..dba9b9e9 --- /dev/null +++ b/fleet_vehicle_fuel_capacity/views/fleet_vehicle.xml @@ -0,0 +1,17 @@ + + + + + + fleet.vehicle.form (in fleet_vehicle_fuel_capacity) + fleet.vehicle + + + + + + + + +