diff --git a/README.md b/README.md index d50968a21c..6b4796b3bf 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,19 @@ [![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/264/11.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-field-service-264) [![Build Status](https://travis-ci.org/OCA/field-service.svg?branch=11.0)](https://travis-ci.org/OCA/field-service) -# Field Service +# Field Service Management + +[Field service management](https://en.wikipedia.org/wiki/Field_service_management) (FSM) coordinates company resources employed at, or en route to, client sites, rather than on the company's premises. FSM most commonly refers to companies who need to manage installation, service or repairs of systems or equipment. + +Examples of field service use cases are: + +- In telecommunications and cable industry, technicians who install cable or run phone lines into residences or business establishments. +- In healthcare, mobile nurses who provide in-home care for elderly or disabled. +- In gas utilities, engineers who are dispatched to investigate and repair suspected leaks. +- In heavy engineering, mining, industrial and manufacturing, technicians dispatched for preventative maintenance and repair. +- In property maintenance, including landscaping, irrigation, and home and office cleaning. +- In HVAC industry, technicians have the expertise and equipment to investigate units in residential, commercial and industrial environments. -Odoo modules for field service management. [//]: # (addons) diff --git a/fieldservice/__manifest__.py b/fieldservice/__manifest__.py index beee4c86e6..c064afd129 100644 --- a/fieldservice/__manifest__.py +++ b/fieldservice/__manifest__.py @@ -9,6 +9,7 @@ 'author': 'Open Source Integrators, Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/field-service', 'depends': [ + 'base_geolocalize', 'mail', 'web_timeline', ], @@ -25,6 +26,7 @@ 'views/res_partner.xml', 'views/fsm_location.xml', 'views/fsm_person.xml', + 'views/fsm_vehicle.xml', 'views/fsm_order.xml', 'views/fsm_route.xml', 'views/menu.xml', diff --git a/fieldservice/models/__init__.py b/fieldservice/models/__init__.py index acb7632eb0..0dfc2aea9e 100644 --- a/fieldservice/models/__init__.py +++ b/fieldservice/models/__init__.py @@ -8,6 +8,7 @@ fsm_tag, fsm_location, fsm_person, + fsm_vehicle, fsm_order, fsm_route, ) diff --git a/fieldservice/models/fsm_location.py b/fieldservice/models/fsm_location.py index b5f0cad13c..7c3f5a8f6d 100644 --- a/fieldservice/models/fsm_location.py +++ b/fieldservice/models/fsm_location.py @@ -13,6 +13,24 @@ class FSMLocation(models.Model): partner_id = fields.Many2one('res.partner', string='Related Partner', required=True, ondelete='restrict', auto_join=True) + owner_id = fields.Many2one('res.partner', string='Related Owner', + required=True, ondelete='restrict', + auto_join=True) + customer_id = fields.Many2one('res.partner', string='Related Customer', + required=True, ondelete='restrict', + auto_join=True) + tag_ids = fields.Many2many('fsm.tag', + string='Tags') + building = fields.Char(string='Building', size=35) + floor = fields.Char(string='Floor', size=35) + unit = fields.Char(string='Unit', size=35) + room = fields.Char(string='Room', size=35) + description = fields.Char(string='Description') + territory = fields.Char(string='Territory', size=35) + branch = fields.Char(string='Branch', size=35) + district = fields.Char(string='District', size=35) + region = fields.Char(string='Region', size=35) + timezone = fields.Char(string='Timezone', size=35) @api.model def create(self, vals): diff --git a/fieldservice/models/fsm_route.py b/fieldservice/models/fsm_route.py index b1f4e8ab83..8bfddb688b 100644 --- a/fieldservice/models/fsm_route.py +++ b/fieldservice/models/fsm_route.py @@ -16,12 +16,17 @@ class FSMRoute(models.Model): fsm_person_id = fields.Many2one('fsm.person', string='Assigned To', required=True) + fsm_vehicle_id = fields.Many2one('fsm.vehicle', + string='Assigned Vehicle') date = fields.Date(string='Date', required=True) _sql_constraints = [ ('fsm_route_person_date_uniq', 'unique (fsm_person_id, date)', "You cannot create 2 routes for the same person on the same day!"), + ('fsm_route_vehicle_date_uniq', + 'unique (fsm_vehicle_id, date)', + "You cannot create 2 routes for the same vehicle on the same day!"), ] @api.model diff --git a/fieldservice/models/fsm_vehicle.py b/fieldservice/models/fsm_vehicle.py new file mode 100644 index 0000000000..28b8b1b1fe --- /dev/null +++ b/fieldservice/models/fsm_vehicle.py @@ -0,0 +1,16 @@ +# Copyright (C) 2018 - TODAY, Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class FSMVehicle(models.Model): + _name = 'fsm.vehicle' + _description = 'Field Service Vehicle' + + name = fields.Char(string='Name', required='True') + fsm_person_id = fields.Many2one('fsm.person', string='Assigned Driver') + + _sql_constraints = [ + ('name_uniq', 'unique (name)', "Vehicle name already exists!"), + ] diff --git a/fieldservice/security/ir.model.access.csv b/fieldservice/security/ir.model.access.csv index b334a0c41c..0ae52da434 100644 --- a/fieldservice/security/ir.model.access.csv +++ b/fieldservice/security/ir.model.access.csv @@ -11,3 +11,5 @@ access_fsm_order_user,fsm.order.user,model_fsm_order,fieldservice.group_fsm_user access_fsm_order_dispatcher,fsm.order.dispatcher,model_fsm_order,fieldservice.group_fsm_dispatcher,1,1,1,0 access_fsm_route_user,fsm.route.user,model_fsm_route,fieldservice.group_fsm_user,1,1,0,0 access_fsm_route_dispatcher,fsm.route.dispatcher,model_fsm_route,fieldservice.group_fsm_dispatcher,1,1,1,1 +access_fsm_vehicle_fsm_user,fsm.vehicle.user,model_fsm_vehicle,fieldservice.group_fsm_user,1,0,0,0 +access_fsm_vehicle_fsm_manager,fsm.vehicle.manager,model_fsm_vehicle,fieldservice.group_fsm_manager,1,1,1,1 diff --git a/fieldservice/views/fsm_location.xml b/fieldservice/views/fsm_location.xml index 2545459669..0d9c95ed64 100644 --- a/fieldservice/views/fsm_location.xml +++ b/fieldservice/views/fsm_location.xml @@ -1,17 +1,26 @@ - + fsm.location.tree fsm.location + + + + + + + + + fsm.location.form fsm.location @@ -21,32 +30,104 @@ + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + fsm.location.search + fsm.location + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Service Locations fsm.location form tree,form +

Create a Service Locations.

-

- Module not yet enabled. -

diff --git a/fieldservice/views/fsm_route.xml b/fieldservice/views/fsm_route.xml index 0b09429c2f..8654c58254 100644 --- a/fieldservice/views/fsm_route.xml +++ b/fieldservice/views/fsm_route.xml @@ -28,6 +28,7 @@ + diff --git a/fieldservice/views/fsm_vehicle.xml b/fieldservice/views/fsm_vehicle.xml new file mode 100644 index 0000000000..beac8a8092 --- /dev/null +++ b/fieldservice/views/fsm_vehicle.xml @@ -0,0 +1,48 @@ + + + + + + fsm.vehicle.tree + fsm.vehicle + + + + + + + + + + fsm.vehicle.form + fsm.vehicle + +
+ + + + + + + + + + +
+
+
+ + + + Field Service Vehicles + fsm.vehicle + form + tree,form + +

+ Add a Field Service Vehicle here. +

+
+
+ +
diff --git a/fieldservice/views/menu.xml b/fieldservice/views/menu.xml index 859d68fbc7..64423725c8 100644 --- a/fieldservice/views/menu.xml +++ b/fieldservice/views/menu.xml @@ -66,6 +66,13 @@ parent="data" sequence="30"/> + +