From 79cf6dd7b9fc2be8e0bf734a0ab0f4e2fdbe35dd Mon Sep 17 00:00:00 2001 From: Sandip Mangukiya Date: Wed, 10 Oct 2018 07:38:13 -0700 Subject: [PATCH 1/5] [ADD]12567: extended fsm.location object --- fieldservice/models/fsm_location.py | 40 ++++++++++++- fieldservice/views/fsm_location.xml | 87 ++++++++++++++++++++++++++++- 2 files changed, 122 insertions(+), 5 deletions(-) diff --git a/fieldservice/models/fsm_location.py b/fieldservice/models/fsm_location.py index b5f0cad13c..7f5b35c1ba 100644 --- a/fieldservice/models/fsm_location.py +++ b/fieldservice/models/fsm_location.py @@ -13,8 +13,44 @@ 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) + location_type_ids = fields.Many2many('fsm.tag', + 'location_type_fsm_tag', 'fsm_location_id', 'loc_type_id', + string='Location Type') + location_material_ids = fields.Many2many('fsm.tag', + 'location_material_fsm_tag', 'fsm_location_id', 'loc_material_id', + string='Location Material') + tanent_categ_ids = fields.Many2many('fsm.tag', + 'tanent_categ_fsm_tag', 'fsm_location_id', 'tanent_categ_id', + string='Tanent Category') + location_destination_ids = fields.Many2many('fsm.tag', + 'location_destination_fsm_tag', 'fsm_location_id', 'loc_destination_id', + string='Location Destination') + 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) + fsm_longitude = fields.Float(string='FSM Longitude') + fsm_latitude = fields.Float(string='FSM Latitude') + 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) + fsm_address1 = fields.Char(string='FSM Address1', size=35) + fsm_address2 = fields.Char(string='FSM Address2', size=35) + fsm_city = fields.Char(string='FSM City', size=35) + fsm_state = fields.Char(string='FSM State', size=35) + fsm_country = fields.Char(string='FSM Country', size=35) + fsm_postal = fields.Char(string='FSM Postal', size=35) + timezone = fields.Char(string='Timezone', size=35) + @api.model def create(self, vals): vals.update({'fsm_location': True}) - return super(FSMLocation, self).create(vals) + return super(FSMLocation, self).create(vals) \ No newline at end of file diff --git a/fieldservice/views/fsm_location.xml b/fieldservice/views/fsm_location.xml index 2545459669..1e8c7b493b 100644 --- a/fieldservice/views/fsm_location.xml +++ b/fieldservice/views/fsm_location.xml @@ -1,17 +1,27 @@ - + fsm.location.tree fsm.location + + + + + + + + + + fsm.location.form fsm.location @@ -21,18 +31,88 @@ + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + fsm.location.search + fsm.location + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Service Locations @@ -40,6 +120,7 @@ form tree,form +

Create a Service Locations. @@ -50,4 +131,4 @@ - + \ No newline at end of file From 82244c7a6382034060add21b4ab2e996a3691935 Mon Sep 17 00:00:00 2001 From: Sandip Mangukiya Date: Wed, 10 Oct 2018 08:02:04 -0700 Subject: [PATCH 2/5] [ADD]12567: Update README.rst file --- fieldservice/README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/fieldservice/README.rst b/fieldservice/README.rst index 53b4fa715f..a0766d36ea 100644 --- a/fieldservice/README.rst +++ b/fieldservice/README.rst @@ -85,6 +85,7 @@ Contributors * Wolfgang Hall * Maxime Chambreuil * Steve Campbell +* Sandip Mangukiya Other credits ~~~~~~~~~~~~~ From 7f68ef55b760a8ab46e9ed3fa581f51d1903a406 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Fri, 12 Oct 2018 13:31:10 -0500 Subject: [PATCH 3/5] [IMP] --- fieldservice/__manifest__.py | 1 + fieldservice/models/fsm_location.py | 27 ++++------------- fieldservice/views/fsm_location.xml | 47 +++++++++++++---------------- 3 files changed, 28 insertions(+), 47 deletions(-) diff --git a/fieldservice/__manifest__.py b/fieldservice/__manifest__.py index beee4c86e6..3fbc12de82 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', ], diff --git a/fieldservice/models/fsm_location.py b/fieldservice/models/fsm_location.py index 7f5b35c1ba..c39b8a7f5a 100644 --- a/fieldservice/models/fsm_location.py +++ b/fieldservice/models/fsm_location.py @@ -19,38 +19,23 @@ class FSMLocation(models.Model): customer_id = fields.Many2one('res.partner', string='Related Customer', required=True, ondelete='restrict', auto_join=True) - location_type_ids = fields.Many2many('fsm.tag', - 'location_type_fsm_tag', 'fsm_location_id', 'loc_type_id', - string='Location Type') - location_material_ids = fields.Many2many('fsm.tag', - 'location_material_fsm_tag', 'fsm_location_id', 'loc_material_id', - string='Location Material') - tanent_categ_ids = fields.Many2many('fsm.tag', - 'tanent_categ_fsm_tag', 'fsm_location_id', 'tanent_categ_id', - string='Tanent Category') - location_destination_ids = fields.Many2many('fsm.tag', - 'location_destination_fsm_tag', 'fsm_location_id', 'loc_destination_id', - string='Location Destination') + tag_ids = fields.Many2many('fsm.tag', + 'location_tag', + 'fsm_location_id', + 'fsm_location_id', + 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) - fsm_longitude = fields.Float(string='FSM Longitude') - fsm_latitude = fields.Float(string='FSM Latitude') 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) - fsm_address1 = fields.Char(string='FSM Address1', size=35) - fsm_address2 = fields.Char(string='FSM Address2', size=35) - fsm_city = fields.Char(string='FSM City', size=35) - fsm_state = fields.Char(string='FSM State', size=35) - fsm_country = fields.Char(string='FSM Country', size=35) - fsm_postal = fields.Char(string='FSM Postal', size=35) timezone = fields.Char(string='Timezone', size=35) @api.model def create(self, vals): vals.update({'fsm_location': True}) - return super(FSMLocation, self).create(vals) \ No newline at end of file + return super(FSMLocation, self).create(vals) diff --git a/fieldservice/views/fsm_location.xml b/fieldservice/views/fsm_location.xml index 1e8c7b493b..c14dabe918 100644 --- a/fieldservice/views/fsm_location.xml +++ b/fieldservice/views/fsm_location.xml @@ -8,15 +8,14 @@ - - - + + @@ -40,8 +39,8 @@ - - + + @@ -57,12 +56,12 @@ - - - - - - + + + + + + @@ -76,7 +75,7 @@ - + fsm.location.search @@ -91,25 +90,24 @@ - - + + - - - - - - + + + + + + - - + @@ -125,10 +123,7 @@

Create a Service Locations.

-

- Module not yet enabled. -

-
\ No newline at end of file + From 74479f3c215241f65cd90ea09933116e59810164 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Fri, 12 Oct 2018 13:57:27 -0500 Subject: [PATCH 4/5] [FIX] --- fieldservice/models/fsm_location.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/fieldservice/models/fsm_location.py b/fieldservice/models/fsm_location.py index c39b8a7f5a..7c3f5a8f6d 100644 --- a/fieldservice/models/fsm_location.py +++ b/fieldservice/models/fsm_location.py @@ -14,15 +14,12 @@ class FSMLocation(models.Model): required=True, ondelete='restrict', auto_join=True) owner_id = fields.Many2one('res.partner', string='Related Owner', - required=True, ondelete='restrict', - auto_join=True) + required=True, ondelete='restrict', + auto_join=True) customer_id = fields.Many2one('res.partner', string='Related Customer', - required=True, ondelete='restrict', - auto_join=True) + required=True, ondelete='restrict', + auto_join=True) tag_ids = fields.Many2many('fsm.tag', - 'location_tag', - 'fsm_location_id', - 'fsm_location_id', string='Tags') building = fields.Char(string='Building', size=35) floor = fields.Char(string='Floor', size=35) @@ -34,7 +31,7 @@ class FSMLocation(models.Model): 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): vals.update({'fsm_location': True}) From a5f9d6d7de1327c715b2c99552c5d0b13262f19e Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Fri, 12 Oct 2018 14:04:33 -0500 Subject: [PATCH 5/5] [FIX] --- fieldservice/views/fsm_location.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fieldservice/views/fsm_location.xml b/fieldservice/views/fsm_location.xml index c14dabe918..949df5a0ab 100644 --- a/fieldservice/views/fsm_location.xml +++ b/fieldservice/views/fsm_location.xml @@ -96,7 +96,7 @@ - +