Skip to main content

Allow to select country in a dropdown

Project description

License: LGPL-3

Snippet’s dropdown country code

This module adds a snippet with a dropdown and an input text field, is a base for be inherited by others modules into an HTML form.

This can be inserted into form elements.

Usage

To extend this template you need to inherit country_dropdown template and to add you personal code.

The template have three input text:

  1. no_country_field: Field without code country.
  2. country_code_field: Field with only country code (read only)
  3. complete_field: Field with the previous two joined (hidden)

The name of the complete field is customizable when user insert the snippet into a form element with the website editor.

Development

You can call the reusable Qweb template called website_snippet_country_dropdown.country_dropdown in your views to add a sensible country-combined field, ideal for VATs.

The default country will be the first match among:

  1. Extract it from the default_country variable.
  2. Extract it from the first 2 letters of the default_value variable.
  3. The current user’s country.
  4. The current website’s company’s country.
  5. The first country in the list.

You can view an example in https://github.com/OCA/e-commerce/tree/8.0/website_sale_checkout_country_vat.

Try me on Runbot

Known issues / Roadmap

  • Add tests.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Credits

Images

  • Odoo Community Association: Icon.

Contributors

Maintainer

Odoo Community Association

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for odoo8-addon-website-snippet-country-dropdown, version 8.0.1.1.0.99.dev6
Filename, size File type Python version Upload date Hashes
Filename, size odoo8_addon_website_snippet_country_dropdown-8.0.1.1.0.99.dev6-py2-none-any.whl (33.5 kB) File type Wheel Python version py2 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page