Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subdivision is always required, even when validators.Required unset #196

Open
mbehrle opened this issue Jun 29, 2014 · 2 comments
Open

subdivision is always required, even when validators.Required unset #196

mbehrle opened this issue Jun 29, 2014 · 2 comments

Comments

@mbehrle
Copy link
Contributor

mbehrle commented Jun 29, 2014

With the following change subdivision remains required in My Account / Add Address:

diff --git a/trytond_nereid/party.py b/trytond_nereid/party.py
index bd2b146..0d57f6a 100644
--- a/trytond_nereid/party.py
+++ b/trytond_nereid/party.py
@@ -28,9 +28,12 @@ class AddressForm(Form):
streetbis = TextField(('Street (Bis)'))
zip = TextField(
('Post Code'), [validators.Required(), ])
city = TextField(_('City'), [validators.Required(), ])

  • #country = SelectField(_('Country'), [validators.Required(), ], coerce=int)
  • country = SelectField(_('Country'))
  • #subdivision = IntegerField(_('State/County'), [validators.Required()])
  • subdivision = IntegerField(_('State/County'))

It is quite unusual to select (or even request) the subdivision in some European countries.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@sharoonthomas
Copy link

@mbehrle what do you think should be the default ?

  1. core module makes the field required and downstream does not.
  2. core module makes it optional and downstream modules which need it makes it required

@mbehrle
Copy link
Contributor Author

mbehrle commented Jul 6, 2014

@mbehrle what do you think should be the default ?

  1. core module makes the field required and downstream does not.
  2. core module makes it optional and downstream modules which need it makes
    it required

I would prefer in any case 2, because there are really many countries (if not
all in Europe?), which don't require subdivision.

Of course the best way would be to have it configurable by country, so when you
are making deals with countries needing subdivision in the address format, it
would be required.

Even still better to only display field subdivision, when it is required.

Mathias Behrle
PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants