-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
[15.0][ADD] l10n_jp_partner_zip_address #40
Conversation
request_url = ( | ||
"http://zipcloud.ibsnet.co.jp/api/search?zipcode" "=%s" % self.zipcode | ||
) | ||
request = urllib.request.Request(request_url) | ||
response_data = json.loads( | ||
urllib.request.urlopen(request).read().decode("utf-8") | ||
) | ||
self.state_id = False | ||
self.city = False | ||
self.street = False | ||
self.street2 = False | ||
if response_data["status"] != 200: | ||
self.zipcode = False | ||
return { | ||
"warning": { | ||
"title": _("Error"), | ||
"message": response_data["message"], | ||
} | ||
} | ||
else: | ||
address_data = response_data["results"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we split the connection part into a separate method with an exception handling?
Consider using requests
instead of urllib
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module name suggestion: l10n_jp_partner_postcode_address
d2ee6aa
to
d0d9948
Compare
3b5168a
to
a88200a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AungKoKoLin1997 I've added a commit. Please review the changes and if OK, please add tests.
69a735e
to
f510e17
Compare
Fixed it. I had made a mistake with the translation file directory. |
@AungKoKoLin1997 Can you please squash commits and push once you confirm the udpate. |
a739b43
to
5d1869c
Compare
I have confirmed that the translation has been applied. |
/ocabot merge nobump |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at e9f4a84. Thanks a lot for contributing to OCA. ❤️ |
@qrtl