Hi, Am Fri, 9 Sep 2011 21:10:34 +0200 schrieb Cédric Krier <[email protected]>: > I checked the module country_ar [1] and if I understand correctly you > try to get some kind of autocompletion for the Argentina cities. > > First, I don't think it is good to extend the Subdivision to support > cities, especially because there is already a field in address to > store the city and it is not part of the ISO3166 nor ISO3166-2. > > So I (and Nicolas) thought about how we could provide a generic way > to get autocompletion on city (or other field in address). > Here are the result: > > - We need a place to store the combination of fields: zip, city, > country, subdivision. > - We must have autocompletion [1] on the fields zip and city. > - The system should learn from already encoding tuple. > > So to satisfy those requirements we think about this design: > > class City(ModelSQL, ModelView): > _name = 'country.city' > > zip = fields.Char('City', autocomplete=['city', 'country', > 'subdivision'], ...) > city = ... > country = ... > subdivision = ... > > def autocomplete_zip(self, values): > ... > > def autocomplete_city(self, values): > ... > > class Address(ModelSQL, ModelView): > _name = 'party.address' > _inherits = {'country.city': 'city'} > > party = ... > ... > city = fields.Many2One('country.city', 'City', ...) > > > The idea is that the table country_city could be prefilled with know > cities to get autocompletion and will be also mixed with filled > cities informations. > > So what do you think about this? It is a good idea for me. We could provide data as xml-only modules like we already do for charts of accounts. Each module can provide the zips and cities of a country.
Some usability questions: * Did I understand correctly, while enter the zip, the selection list for city, subdivision and country is filled by the appropriate values which match to the zip? * When there is only one entry for city, subdivision and country for a given zip, all those fields are auto filled? Regards Udo > [1] https://bitbucket.org/bvillasanti/trytond_ar > [2] http://hg.tryton.org/trytond/rev/01fb8b8a4dfd > > Regards, -- _____________________________ virtual things Preisler & Spallek GbR München - Aachen Windeckstr. 77 81375 München Tel: +49 (89) 710 481 55 Fax: +49 (89) 710 481 56 [email protected] http://www.virtual-things.biz -- [email protected] mailing list
