Odoo Help

0

Manage City and province localization

By
philip
on 8/30/14, 10:32 PM 1,697 views

Hi all,

I want to localize location, how to achieve like link below in openerp7/odoo

let say, when you select City then in the next field should appear only all the province for that city.

for instance:

 

city1 ------ province1

               province2

               province3

http://www.olx.ph/index.php/select+location/parent/adUpdate/field/location/selected/

 

Thanks

0
philip
On 11/6/14, 12:06 PM

XML

<field name="abs_provinces_id" style="width: 50%%"/>
<field name="abs_cities_id" style="width: 48.2%%" domain="[('abs_provinces_id', '=', abs_provinces_id)]"/>
<field name="abs_zip" placeholder="ZIP" style="width: 8%%" invisible="1"/> 

PYTHON

class abs_provinces(osv.Model):
    _name = "abs.provinces"
    _columns = {
        'name': fields.char('Province', size=32),
    }

class abs_cities(osv.Model):
    _name = "abs.cities"
    _columns = {
        'name': fields.char('City', size=32),
        'abs_provinces_id': fields.many2one('abs.provinces', 'Province'),
    }

0
Bole
On 11/7/14, 3:12 AM

look for openerp / odoo module named city, it does exactlky that.. 
adds a new model for unique city entriey, conects them to zip codes, states etc... 

also you might want to check python package py-country  , wich contains all countries and states in the world.. 

If you decide to use module city, be aware that it might cause incompatability issues with other custom modules.. 

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 8/30/14, 10:32 PM
Seen: 1697 times
Last updated: 3/16/15, 8:10 AM