diff --git a/fieldservice_vehicle_stock/README.rst b/fieldservice_vehicle_stock/README.rst index 3de087ff1d..da7865594a 100644 --- a/fieldservice_vehicle_stock/README.rst +++ b/fieldservice_vehicle_stock/README.rst @@ -17,13 +17,13 @@ Field Service Vehicles - Stock :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github - :target: https://github.com/OCA/field-service/tree/14.0/fieldservice_vehicle_stock + :target: https://github.com/OCA/field-service/tree/15.0/fieldservice_vehicle_stock :alt: OCA/field-service .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_vehicle_stock + :target: https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_vehicle_stock :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/field-service&target_branch=14.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=15.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -32,6 +32,16 @@ This module is an add-on for the Field Service application in Odoo. It allows you to establish stock locations for field service vehicles and process stock moves with field service vehicles. +In field service operations, the general flow of inventory is as follows: +Stock Location -> Vehicle Location -> Customer Location + +Initially there is a demand for product in the Customer Location, but we +are not sure which field service vehicle needs to load that product until +a field service order and vehicle is planned. + +This module will automatically update pickings linked to field service orders +so that inventory is moved to the proper vehicle storage locations. + **Table of contents** .. contents:: @@ -42,8 +52,47 @@ Configuration To configure this module, you need to: -* Set Inventory Locations for FSM Locations and FSM Vehicles -* Verify procurement routes +# Configure Operation Types for Loading FSM Vehicles +Specific stock operation types can be configured for +moving inventory to the storage locations of FSM Vehicles. +Moves will not be processed if the FSM Vehicle is not set on +the transfers of these operation types. +#. Go to Inventory > Configuration > Operation Types +#. Select or Create an Operation Type +#. Check the box "Used to Load a Field Service Vehicle" + +# Verify procurement routes +Some new procurement routes are added with this module. Check +that these routes fit your individual business needs or you can +create new ones. + +Be sure to have a rule that utilizes an Operation Type that is +configured for FSM Vehicle Loading and the rule has a Destination +Location which is a parent of the FSM Vehicle inventory location + +# Configure FSM Vehicles +Each FSM Vehicle that will carry inventory needs to have a +stock inventory location. Individual vehicle inventory +locations should be a descendant location of a procurement +rule's Destination Location. +#. Go to Field Service > Master Data > Vehicles +#. Select or Create a Field Service Vehicle +#. Set the desired Inventory Location for that vehicle + +Usage +===== + +To use this module you must first generate some stock moves that +that will be transferred using a stock operation type which supports +FSM vehicle loading. + +In order to confirm the transfer, a FSM Vehicle must be set. The FSM +Vehicle can be set manually on the transfer in the Additional Info tab +or it will be automatically set if the transfer has a linked FSM Order +and a vehicle is assigned to that order. + +When the FSM Vehicle is updated on a transfer, the destination locations +are updated to reflect the vehicle storage location. Known issues / Roadmap ====================== @@ -57,7 +106,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -75,6 +124,8 @@ Contributors * Brian McMaster * Serpent Consulting Services Pvt. Ltd. +* `APSL-Nagarro `_: + * Patryk Pyczko Other credits ~~~~~~~~~~~~~ @@ -110,6 +161,6 @@ Current `maintainers `__: |maintainer-brian10048| |maintainer-wolfhall| |maintainer-max3903| -This module is part of the `OCA/field-service `_ project on GitHub. +This module is part of the `OCA/field-service `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fieldservice_vehicle_stock/__manifest__.py b/fieldservice_vehicle_stock/__manifest__.py index 61a5971533..f69cb524bb 100644 --- a/fieldservice_vehicle_stock/__manifest__.py +++ b/fieldservice_vehicle_stock/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Field Service Vehicles - Stock", "summary": "Track inventory of Field Service vehicles", - "version": "14.0.1.1.1", + "version": "15.0.1.0.0", "category": "Field Service", "author": "Open Source Integrators, " "Brian McMaster, " diff --git a/fieldservice_vehicle_stock/readme/CONTRIBUTORS.rst b/fieldservice_vehicle_stock/readme/CONTRIBUTORS.rst index 7ecd842208..4607c51d2e 100644 --- a/fieldservice_vehicle_stock/readme/CONTRIBUTORS.rst +++ b/fieldservice_vehicle_stock/readme/CONTRIBUTORS.rst @@ -1,2 +1,4 @@ * Brian McMaster * Serpent Consulting Services Pvt. Ltd. +* `APSL-Nagarro `_: + * Patryk Pyczko diff --git a/fieldservice_vehicle_stock/static/description/index.html b/fieldservice_vehicle_stock/static/description/index.html index 2cc7a4d59e..1f9c25e32c 100644 --- a/fieldservice_vehicle_stock/static/description/index.html +++ b/fieldservice_vehicle_stock/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,21 +369,29 @@

Field Service Vehicles - Stock

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:6f16452b948d65c702f8ce4a4aa4dd65d9418107b70b742b01ab2bbb9d2a86ae !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module is an add-on for the Field Service application in Odoo. It allows you to establish stock locations for field service vehicles and process stock moves with field service vehicles.

+

In field service operations, the general flow of inventory is as follows: +Stock Location -> Vehicle Location -> Customer Location

+

Initially there is a demand for product in the Customer Location, but we +are not sure which field service vehicle needs to load that product until +a field service order and vehicle is planned.

+

This module will automatically update pickings linked to field service orders +so that inventory is moved to the proper vehicle storage locations.

Table of contents

  • Configuration
  • -
  • Known issues / Roadmap
  • -
  • Bug Tracker
  • -
  • Credits @@ -391,57 +399,92 @@

    Field Service Vehicles - Stock

    Configuration

    To configure this module, you need to:

    -
      -
    • Set Inventory Locations for FSM Locations and FSM Vehicles
    • -
    • Verify procurement routes
    • -
    +

    # Configure Operation Types for Loading FSM Vehicles +Specific stock operation types can be configured for +moving inventory to the storage locations of FSM Vehicles. +Moves will not be processed if the FSM Vehicle is not set on +the transfers of these operation types. +#. Go to Inventory > Configuration > Operation Types +#. Select or Create an Operation Type +#. Check the box “Used to Load a Field Service Vehicle”

    +

    # Verify procurement routes +Some new procurement routes are added with this module. Check +that these routes fit your individual business needs or you can +create new ones.

    +

    Be sure to have a rule that utilizes an Operation Type that is +configured for FSM Vehicle Loading and the rule has a Destination +Location which is a parent of the FSM Vehicle inventory location

    +

    # Configure FSM Vehicles +Each FSM Vehicle that will carry inventory needs to have a +stock inventory location. Individual vehicle inventory +locations should be a descendant location of a procurement +rule’s Destination Location. +#. Go to Field Service > Master Data > Vehicles +#. Select or Create a Field Service Vehicle +#. Set the desired Inventory Location for that vehicle

    +
    +
    +

    Usage

    +

    To use this module you must first generate some stock moves that +that will be transferred using a stock operation type which supports +FSM vehicle loading.

    +

    In order to confirm the transfer, a FSM Vehicle must be set. The FSM +Vehicle can be set manually on the transfer in the Additional Info tab +or it will be automatically set if the transfer has a linked FSM Order +and a vehicle is assigned to that order.

    +

    When the FSM Vehicle is updated on a transfer, the destination locations +are updated to reflect the vehicle storage location.

    -

    Known issues / Roadmap

    +

    Known issues / Roadmap

    The roadmap of the Field Service application is documented on Github.

    -

    Bug Tracker

    +

    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.

    +feedback.

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

    -

    Credits

    +

    Credits

    -

    Authors

    +

    Authors

    • Open Source Integrators
    • Brian McMaster
    -

    Contributors

    +

    Contributors

    -

    Other credits

    +

    Other credits

    The development of this module has been financially supported by:

    -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +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 maintainers:

    brian10048 wolfhall max3903

    -

    This module is part of the OCA/field-service project on GitHub.

    +

    This module is part of the OCA/field-service project on GitHub.

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

    diff --git a/fieldservice_vehicle_stock/tests/test_fsm_vehicle_stock.py b/fieldservice_vehicle_stock/tests/test_fsm_vehicle_stock.py index a37943815f..60ce6d3803 100644 --- a/fieldservice_vehicle_stock/tests/test_fsm_vehicle_stock.py +++ b/fieldservice_vehicle_stock/tests/test_fsm_vehicle_stock.py @@ -5,97 +5,98 @@ class TestFSMVehicleStock(TransactionCase): - def setUp(self): - super(TestFSMVehicleStock, self).setUp() + @classmethod + def setUpClass(cls): + super().setUpClass() # Set up inventory locations - self.veh_parent_loc = self.env.ref( + cls.veh_parent_loc = cls.env.ref( "fieldservice_vehicle_stock.stock_location_vehicle_storage" ) - self.stock_location = self.env.ref("stock.stock_location_stock") - self.veh_1_loc = self.env["stock.location"].create( + cls.stock_location = cls.env.ref("stock.stock_location_stock") + cls.veh_1_loc = cls.env["stock.location"].create( { "name": "Vehicle 1 Storage", - "location_id": self.veh_parent_loc.id, + "location_id": cls.veh_parent_loc.id, "usage": "internal", } ) - self.veh_2_loc = self.env["stock.location"].create( + cls.veh_2_loc = cls.env["stock.location"].create( { "name": "Vehicle 2 Storage", - "location_id": self.veh_parent_loc.id, + "location_id": cls.veh_parent_loc.id, "usage": "internal", } ) - self.non_vehicle_stock_loc = self.env["stock.location"].create( + cls.non_vehicle_stock_loc = cls.env["stock.location"].create( { "name": "Other Stock Location", - "location_id": self.stock_location.id, + "location_id": cls.stock_location.id, "usage": "internal", } ) # Set up FSM Vehicles with inventory locations - self.fsm_veh_1 = self.env["fsm.vehicle"].create( + cls.fsm_veh_1 = cls.env["fsm.vehicle"].create( { "name": "Vehicle 1", - "inventory_location_id": self.veh_1_loc.id, + "inventory_location_id": cls.veh_1_loc.id, } ) - self.fsm_veh_2 = self.env["fsm.vehicle"].create( + cls.fsm_veh_2 = cls.env["fsm.vehicle"].create( { "name": "Vehicle 2", - "inventory_location_id": self.veh_2_loc.id, + "inventory_location_id": cls.veh_2_loc.id, } ) - self.fsm_veh_bad_loc = self.env["fsm.vehicle"].create( + cls.fsm_veh_bad_loc = cls.env["fsm.vehicle"].create( { "name": "Vehicle with Incorrect Location", - "inventory_location_id": self.non_vehicle_stock_loc.id, + "inventory_location_id": cls.non_vehicle_stock_loc.id, } ) # Set up product and stock it to use for a transfer - self.product = self.env["product.product"].create( + cls.product = cls.env["product.product"].create( { "name": "Product A", "type": "product", - "categ_id": self.env.ref("product.product_category_all").id, + "categ_id": cls.env.ref("product.product_category_all").id, } ) - self.env["stock.quant"]._update_available_quantity( - self.product, self.stock_location, 100 + cls.env["stock.quant"]._update_available_quantity( + cls.product, cls.stock_location, 100 ) # Set up a transfer using the operation type for vehicle loading - self.picking_type_id = self.env.ref( + cls.picking_type_id = cls.env.ref( "fieldservice_vehicle_stock.picking_type_output_to_vehicle" ) - self.picking_out = self.env["stock.picking"].create( + cls.picking_out = cls.env["stock.picking"].create( { - "picking_type_id": self.picking_type_id.id, - "location_id": self.stock_location.id, - "location_dest_id": self.veh_parent_loc.id, + "picking_type_id": cls.picking_type_id.id, + "location_id": cls.stock_location.id, + "location_dest_id": cls.veh_parent_loc.id, } ) - self.move = self.env["stock.move"].create( + cls.move = cls.env["stock.move"].create( { "name": "Test Vehicle Stock Move", - "location_id": self.stock_location.id, - "location_dest_id": self.veh_parent_loc.id, - "product_id": self.product.id, + "location_id": cls.stock_location.id, + "location_dest_id": cls.veh_parent_loc.id, + "product_id": cls.product.id, "product_uom_qty": 8.0, - "product_uom": self.env.ref("uom.product_uom_unit").id, - "picking_id": self.picking_out.id, + "product_uom": cls.env.ref("uom.product_uom_unit").id, + "picking_id": cls.picking_out.id, } ) # Setup FSM Order - self.fsm_location = self.env.ref("fieldservice.test_location") - self.fsm_order_1 = self.env["fsm.order"].create( + cls.fsm_location = cls.env.ref("fieldservice.test_location") + cls.fsm_order_1 = cls.env["fsm.order"].create( { "name": "FSM Order 1", - "location_id": self.fsm_location.id, + "location_id": cls.fsm_location.id, } )