Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

License: LGPL-3

Website Snippet Country Code Dropdown

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 add your 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.

All variables you can use to modify its behavior:

  • complete_field to give it a name. Usually it will match the field name.

  • default_value for the complete_field.

  • countries as a res.country ORM recordset.

  • default_country as a res.country record.

  • no_country_placeholder.

You can view an example in website_sale_checkout_country_vat in OCA/e-commerce.

Try me on Runbot

Known issues / Roadmap

  • Add tests.

  • Flag images should be lazy-loaded to optimize loading.

  • Snippet drag and drop seems to be blocked by Odoo for some unknown reason.. Given the main purpose of this module is to provide a reusable template for other modules to use, did not take the time to fix that use case.

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 https://odoo-community.org.

Metadata

Release files for odoo9-addon-website-snippet-country-dropdown 9.0.1.0.0.99.dev10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo9-addon-website-snippet-country-dropdown 9.0.1.0.0.99.dev10
File Interpreter ABI Platform Actions
odoo9_addon_website_snippet_country_dropdown-9.0.1.0.0.99.dev10-py2-none-any.whl Python 2 none any Details for odoo9_addon_website_snippet_country_dropdown-9.0.1.0.0.99.dev10-py2-none-any.whl

Release files / odoo9_addon_website_snippet_country_dropdown-9.0.1.0.0.99.dev10-py2-none-any.whl

Download URL odoo9_addon_website_snippet_country_dropdown-9.0.1.0.0.99.dev10-py2-none-any.whl
Size 28.3 kB
Tags Python 2
SHA-256 checksum
How to use checksums
a4f034e26974e6cff065097dc7a8c67d2877e77be836edf9d675ca08ca8bcea6
BLAKE2b-256 checksum
How to use checksums
4649adb980ace2080807fdeb7f79361593558b23bbf6e2d180b0b6620617bdbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for odoo9-addon-website-snippet-country-dropdown 9.0.1.0.0.99.dev10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page