Skip to main content

Beta License: LGPL-3 OCA/website Translate me on Weblate Try me on Runboat

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.

Table of contents

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.

Known issues / Roadmap

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 to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Tecnativa

Contributors

  • Tecnativa:

    • Sergio Teruel

    • Jairo Llopis

    • Alexandre Díaz

    • Carlos Roca

    • Ernesto Tejeda

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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.

This module is part of the OCA/website project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Release files for odoo-addon-website-snippet-country-dropdown 16.0.1.0.0.9

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 odoo-addon-website-snippet-country-dropdown 16.0.1.0.0.9
File Interpreter ABI Platform
odoo_addon_website_snippet_country_dropdown-16.0.1.0.0.9-py3-none-any.whl Python 3 none any Details

Release files / odoo_addon_website_snippet_country_dropdown-16.0.1.0.0.9-py3-none-any.whl

Download URL odoo_addon_website_snippet_country_dropdown-16.0.1.0.0.9-py3-none-any.whl
Size 35.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fbf426a9db31c1834abb5a8f69efac74596e4dea1545488ad78bb89f67bbe2e
BLAKE2b-256 checksum
How to use checksums
6096edb4c4a88f7a312a5141732dfa534163df2ad155ded48ca085649f0f03f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3
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