changeset 32f82e5a28c1 in modules/party:default
details: https://hg.tryton.org/modules/party?cmd=changeset;node=32f82e5a28c1
description:
Set depends on _autocomplete_domain
This avoid to maintain them on autocomplete_zip and autocomplete_city.
issue8264
review281351002
diffstat:
address.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r 5c9aea44af5a -r 32f82e5a28c1 address.py
--- a/address.py Mon May 06 15:04:57 2019 +0200
+++ b/address.py Mon May 20 15:45:29 2019 +0200
@@ -83,6 +83,7 @@
_autocomplete_limit = 100
+ @fields.depends('country', 'subdivision')
def _autocomplete_domain(self):
domain = []
if self.country:
@@ -104,14 +105,14 @@
return sorted({getattr(z, name) for z in records})
return []
- @fields.depends('city', 'country', 'subdivision')
+ @fields.depends('city', methods=['_autocomplete_domain'])
def autocomplete_zip(self):
domain = self._autocomplete_domain()
if self.city:
domain.append(('city', 'ilike', '%%%s%%' % self.city))
return self._autocomplete_search(domain, 'zip')
- @fields.depends('zip', 'country', 'subdivision')
+ @fields.depends('zip', methods=['_autocomplete_domain'])
def autocomplete_city(self):
domain = self._autocomplete_domain()
if self.zip: