Browse Source

[10.0][IMP] base_location(geonames): Add Lat/Long (#405)

* [IMP] base_location: Add lat & long to `better.zip`
* Add latitude and longitude columns to `better.zip`

* [IMP] base_location_geonames_import: Add lat/long
* Add support for latitude & longitude to genomes importer
pull/417/head
Dave Lasley 8 years ago
committed by Rafael Blasco
parent
commit
ff78566d94
  1. 1
      base_location/README.rst
  2. 2
      base_location/__manifest__.py
  3. 2
      base_location/models/better_zip.py
  4. 1
      base_location_geonames_import/README.rst
  5. 2
      base_location_geonames_import/__manifest__.py
  6. 2
      base_location_geonames_import/wizard/geonames_import.py

1
base_location/README.rst

@ -43,6 +43,7 @@ Contributors
* Sandy Carter <sandy.carter@savoirfairelinux.com> * Sandy Carter <sandy.carter@savoirfairelinux.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com> * Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Francesco Apruzzese <f.apruzzese@apuliasoftware.it> * Francesco Apruzzese <f.apruzzese@apuliasoftware.it>
* Dave Lasley <dave@laslabs.com>
Icon Icon
---- ----

2
base_location/__manifest__.py

@ -4,7 +4,7 @@
{ {
'name': 'Location management (aka Better ZIP)', 'name': 'Location management (aka Better ZIP)',
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'depends': [ 'depends': [
'base', 'base',
], ],

2
base_location/models/better_zip.py

@ -20,6 +20,8 @@ class BetterZip(models.Model):
city = fields.Char('City', required=True) city = fields.Char('City', required=True)
state_id = fields.Many2one('res.country.state', 'State') state_id = fields.Many2one('res.country.state', 'State')
country_id = fields.Many2one('res.country', 'Country') country_id = fields.Many2one('res.country', 'Country')
latitude = fields.Float()
longitude = fields.Float()
@api.one @api.one
@api.depends( @api.depends(

1
base_location_geonames_import/README.rst

@ -55,6 +55,7 @@ Contributors
* Alexis de Lattre <alexis.delattre@akretion.com> * Alexis de Lattre <alexis.delattre@akretion.com>
* Lorenzo Battistini <lorenzo.battistini@agilebg.com> * Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> * Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Dave Lasley <dave@laslabs.com>
Icon Icon
---- ----

2
base_location_geonames_import/__manifest__.py

@ -6,7 +6,7 @@
{ {
'name': 'Base Location Geonames Import', 'name': 'Base Location Geonames Import',
'version': '10.0.1.0.0',
'version': '10.0.1.0.1',
'category': 'Partner Management', 'category': 'Partner Management',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Import better zip entries from Geonames', 'summary': 'Import better zip entries from Geonames',

2
base_location_geonames_import/wizard/geonames_import.py

@ -59,6 +59,8 @@ class BetterZipGeonamesImport(models.TransientModel):
'city': self.transform_city_name(row[2], country), 'city': self.transform_city_name(row[2], country),
'state_id': state.id, 'state_id': state.id,
'country_id': country.id, 'country_id': country.id,
'latitude': row[9],
'longitude': row[10],
} }
return vals return vals

Loading…
Cancel
Save