Search 1.9 billion lines of Odoo code on GitHub

website_snippet_country_dropdown

Author: Tecnativa, Odoo Community Association (OCA)
License: LGPL-3
Branch: 12.0-imp-website_snippet_country_dropdown-custom-input-classes
Repository: Tecnativa/website
Dependencies: website
Languages: HTML (387, 41.4%), JavaScript (113, 12.1%), PO File (134, 14.3%), Python (36, 3.9%), Sass (18, 1.9%), XML (138, 14.8%), and reStructuredText (109, 11.7%)
Other branches: 10.0, 12.0, 12.0-fix-website_form_recaptcha-perms, 12.0-fix-website_megamenu-empty_dropdown, 12.0-imp-website_adv_image_optimization-select_image, 12.0-mig-website_adv_image_optimization, 12.0-mig-website_logo, 12.0-website_blog_excerpt_img-rm_empty_images_block, 12.0-website_canonical_url-multirecord_check, 12.0-website_canonical_url-use_domain, 12.0-website_crm_quick_answer-fix_lang, 12.0-website_form_recaptcha-fix_load, 12.0-website_no_crawler-uninstallable, 12.0-website_snippet_anchor-fix_assets, 12.0-website_snippet_big_button-fix_nowrap, 13.0-MIG-website_snippet_country_dropdown, 13.0-add-website_snippet_timeline, 13.0-fix-website_cookiefirst-loading, 13.0-fix-website_crm_recaptcha-editor, 13.0-fw-fix-website_form_recaptcha-perms, 13.0-fw-port-c75cf895d941365e4bdf7dd3a6e1dc4e412aacdf, 13.0-mig-website_snippet_big_button, 13.0-mig-website_snippet_marginless_gallery, 14.0-dck-add-website_forum_subscription, 14.0-mig-website_crm_privacy_policy, 14.0-mig-website_membership_gamification, 14.0-mig-website_snippet_country_dropdown, 14.0-test, 15.0-ADD-website_form_require_legal, 15.0-FIX-website_legal_page, 15.0-MIG-website_legal_page, 15.0-MIG-website_snippet_country_dropdown, 15.0-mig-website_breadcrumb, 15.0-mig-website_cookiebot, 15.0-mig-website_snippet_big_button, 15.0-mig-website_snippet_marginless_gallery, 8.0, 9.0, 9.0-mig-website_disable_odoo, 9.0-website_portal_claim, 9.0-website_portal_invoice_separated, _8.0-esoc, _9.0-esoc, _9.0-website_portal-merge_backports, and website_blog_excerpt_img
Other repositories: 001101/website, 020cui/website, ADVALAKI/website-1, AEK-BKF/website, AITIC/website, AMhadhbi/website, AdvaitT17/website-1, Alex-Woo/website, Anon234/website, App-247/website, BenjaHe/website, BitStab/website, BoxInABox/website, CB-Gran-Canaria/website, Callino/website, Change2improve/website, ClearCorp/oca-website, Colorlessgold/website, CompassionCH/website, Comunitea/website, Confidere/website, CybroOdoo/website, Daemo00/website, DavidNitro/website, Djaitai/website, Dobtor-OCA/website, ELMARDI0107/website, Fitranugraha/website, ForgeFlow/website, Frank278/website, FreshSoftGit/website, Fuchur777/website, GabbasovDinar/website-1, Gabinete-Digital/website, Georgepanpan/website, Gofekra/website, GrupoAlvamex/website, HaTry/website, HammerSport-Marketing/website, Idealisconsulting/website, ImgBotApp/website-5, Ingeos/website, Jaquedeveloper/website, Jarsa/website, JayVora-SerpentCS/website, JazziMc/website, Jeisonpernia/website, Jokevil/website, JonathanOsAlc/website, KEVINYZY/website-1, KIKOU2016/website, Kazebayashi/website, Khwarizmiat/website, KolushovAlexandr/website, LaMachinerieDigitale/odoo_website_oca, LasLabs/website, LevelPrime/website, Logicasoft/FORK_website_OCA, MTantin/website, MadsackMediaStore/website, MathBenTech/website, MediaJockey/website, MisterTobi/website, NL66278/website, NaSol/website, NeatNerdPrime/website, NextERP-Romania/website, Nikul-Chaudhary/website, Nitrokey/odoo-website, Nowheresly/website, Numigi/odoo-website, OCA-MUK/website, OCA/website, ORETEK/website, OctoComputer/website, OpenPymeMx/website, OpusVL/website, OsoTranquilo/website, PCatinean/website, Palpid/website, PismennyiIgor/website, QANSEE/website, Rad0van/website, RealSolutionsLux/website, RedNeboa/website, Ricardlol/website, SalahAdDin/website, SanteLibre/website, Saran440/website, SequarSrl/website, SeuMarco/website, Shiraj-Nisus/website, SicurSam/website, Spearhead-Odoo/website, StefanRijnhart/website, StephanRozendaal/website, Studio73/website, SuzanaBhandari/website, Syci-Consulting/website, TRESCLOUD/website, TechspawnSolutions/website, VasiliyKorobatov/website, Vauxoo/website, VbossEkat/website-1, VisiionSolucionesTecnologicas/website, Xara77/website, XtremXpert/website, YevhenPechurin/website, YogeshMahera-SerpentCS/website, abakus-it/website, accnops/website, acsone/website, adhoc-dev/website, adr9/website, agenterp/website, agrista/odoo-website, ahilali/website, akhdaniel/website, akretion/website, amendoncabh/website, anandkansagra/website, angelmoya/website, anhchuyen/website, anhvu-sg/website, ansinaesmejor/website, antcto/website, antilhue/website, antonio-trey/website, apachesep/website, apetbiz/website, archetipo/website, aryajimbaran/website, aurestic/website, be-cloud-be/website, benwillig/website, bishalgit/website, bizople/website, bizzappdev/website, bjornbillen/website, brain-tec/website, bvkl/website, c-meier/website, camptocamp/website, chakhi/website, colmeirin/website, coopiteasy/website, corsisa/website, cristinamartinrod/website, crnd-inc/website, cubells/website, danztensai/website, daramousk/website, ddico/website, ddufresne/website, devRabbiz/website, devnsys/website, diegobgl/website, diggy128/website, dipendra-karki/website, don-systems/website, druidoo-dev/website, eLBati/website, edsnet/website, eezee-it/website, ehabqino/website, eil00l/website, emyu01/website, ericbbs/website, ernestotejeda/website, eslAmer/website, esosaja/website, eversatis/website, exosoftware/oca-website, ezdoo/website, fagist/website, faisalnoufal/website, fbpatel/website, firefly1994/website, flotho/website, focusate/website-oca, francoisdelarbre/website, gaanto/website, garrettcadams/website, gastonfeng/website, gbaumgartner-callino/website, gbrian/website-1, gfcapalbo/website, grant-thornton/website, gtg305/website, harked/website, haroldtamo/website, hbrunn/website, hgsoft/website, hilarak/website, hinfo506/website, hippe-67/website, hurrinico/website, iRichGit/website, iamyeonhan/website, iledarn/website, initOS/website, invitu/website, isoscl/website, ispan55/website, it-projects-llc/website, jacky82669513/website, jaleelpoovan/website, jansumanpan/website, jason156/website, jcarlosmontoya/website, jcchoquet/website, jop-odoo/website, josepmy/website, josugm/website, joyshmitz/website, jromeroarg/website-1, jsrhtc/website, jsviterig/website, jupiterzhuo/website, karan-dreambits/website, kardec-web/website-1, kenneth-vkd/website, keylor2906/website, khaeusler/website, khaks01/website, kmee/website, kryskool/website, l0wskilled/website, leangjia/website, leemannd/website, lfreeke/website, lideritjnma/website, lincersolucoes/oca-website, lpetkov-sw/website, mamaf/website, manaTec-GmbH/website, manawi/website, mettadipa/website, miguel-trey/website, mikevhe18/website, minhhq09/website, mmotahar/website, mobilizer/website, monksoftware/website, mpanarin/website, mrierav/website, nabiforks/website, nadiaafa/website, navri/website, necrodevz/website, nicolas-petit/website, nikul-serpentcs/website, nisheednair/website-1, njeudy/website, noorealam96/website, novacode-nl/website, ntsystemwork/oca-website, nuobit/website, odoo-etech/website, odoobgorg/OCA-website, odoogap/website, odoosoft/website, old-boy/website-1, onaconsulting/website, one2pret/website, onurugur/website, open-synergy/website, open2bizz/website, osfp-Pakistan/website, osiell/website, ossamagharib/website, ougc27/website, oxidos/website, parminder-chrishan/website, pedrocasi/website, pedroporras/website, petypi/website, popcomputadores-desenv/website, popsolutions/website, pratimedia/website, presenceverte/website, pscloud/website, pstisoluciones/website, py-web/website, pythoner-3k/website, raihansazal/website, raintao/website, ralnakar/website, ravishekharco/website, raycollazo/website, redblow/website, redcor/website, reinka/website, robertrottermann/website, rohitramnani1994/website, romugb/website, rossparks/website, royalline1/website-1, rruebner/website, rsullivan2704/website, saas-addons/website, sadeqamin/website, safecoms/website, sailguest/website, sanube/website, satriani-vai/website, savoirfairelinux/website, searro/website, serdareren/website, shiram/website, simahawk/website, simplifysolutions/website, smurf-U/website, sodexis/website, steingabelgaard/website, subteno-it/website, syci/website-odoo, syentys/website, tafaRU/website, takobi-online/website, tarteo/website, tbaden/website, techorg/website, thijshuijbers/website, thinkopensolutions/oca-website, thomas-willdooit/website, tirma-sa/website, torans/website, treytux/website, unitek-solusi/OCA-website, usmcgwg/website, valmarnet/website, vcloud9ray/website, vdedyukhin/website, vdewulf/website, versada/website, vidtsin/website, vijay-huang/website, vrajesh266/website, wahello/website, windev20/website, xumingzhi/website, y2gsmith/website, yaojiaqing/website, yaoxingqi/website-1, yassine-teoshore/website, yelizariev/website, yfjelley/website, youifki/website, yusniermatos/website, yveshoyos/website, zakoo20122/website, zeroincombenze/website, zhaohuaw/website, and zino974/website

<h1 class="title">Website Snippet Country Code Dropdown</h1> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/website/tree/12.0/website_snippet_country_dropdown"><img alt="OCA/website" src="https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/website-12-0/website-12-0-website_snippet_country_dropdown"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/186/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>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.</p> <p>This can be inserted into form elements.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#usage" id="id1">Usage</a><ul> <li><a class="reference internal" href="#development" id="id2">Development</a></li> </ul> </li> <li><a class="reference internal" href="#known-issues-roadmap" id="id3">Known issues / Roadmap</a></li> <li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id5">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id6">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li> </ul> </li> </ul> </div> <a name="usage"></a> <h2><a class="toc-backref" href="#id1">Usage</a></h2> <p>To extend this template you need to inherit <code>country_dropdown</code> template and add your personal code.</p> <p>The template have three input text:</p> <ol class="arabic simple"> <li><code>no_country_field</code>: Field without code country.</li> <li><code>country_code_field</code>: Field with only country code (read only)</li> <li><code>complete_field</code>: Field with the previous two joined (hidden)</li> </ol> <p>The name of the complete field is customizable when user insert the snippet into a form element with the website editor.</p> <a name="development"></a> <h3><a class="toc-backref" href="#id2">Development</a></h3> <p>You can call the reusable Qweb template called <code>website_snippet_country_dropdown.country_dropdown</code> in your views to add a sensible country-combined field, ideal for <em>VATs</em>.</p> <p>The default country will be the first match among:</p> <ol class="arabic simple"> <li>Extract it from the <code>default_country</code> variable.</li> <li>Extract it from the first 2 letters of the <code>default_value</code> variable.</li> <li>The current user's country.</li> <li>The current website's company's country.</li> <li>The first country in the list.</li> </ol> <p>All variables you can use to modify its behavior:</p> <ul class="simple"> <li><code>complete_field</code> to give it a name. Usually it will match the field name.</li> <li><code>default_value</code> for the <code>complete_field</code>.</li> <li><code>countries</code> as a <code>res.country</code> ORM recordset.</li> <li><code>default_country</code> as a <code>res.country</code> record.</li> <li><code>no_country_placeholder</code>.</li> </ul> <p>You can view an example in <code>website_sale_checkout_country_vat</code> in OCA/e-commerce.</p> <a name="known-issues-roadmap"></a> <h2><a class="toc-backref" href="#id3">Known issues / Roadmap</a></h2> <ul class="simple"> <li>Add tests.</li> <li>Snippet drag and drop <a class="reference external" href="https://github.com/OCA/website/pull/230#issuecomment-236681777">seems to be blocked by Odoo for some unknown reason.</a>. 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.</li> </ul> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id4">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/website/issues">GitHub Issues</a>. 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 <a class="reference external" href="https://github.com/OCA/website/issues/new?body=module:%20website_snippet_country_dropdown%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="credits"></a> <h2><a class="toc-backref" href="#id5">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id6">Authors</a></h3> <ul class="simple"> <li>Tecnativa</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id7">Contributors</a></h3> <ul class="simple"> <li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul> <li>Sergio Teruel &lt;<a class="reference external" href="mailto:sergio.teruel&#64;tecnativa.com">sergio.teruel&#64;tecnativa.com</a>&gt;</li> <li>Jairo Llopis &lt;<a class="reference external" href="mailto:jairo.llopis&#64;tecnativa.com">jairo.llopis&#64;tecnativa.com</a>&gt;</li> <li>Alexandre Díaz &lt;<a class="reference external" href="mailto:alexandre.diaz&#64;tecnativa.com">alexandre.diaz&#64;tecnativa.com</a>&gt;</li> </ul> </li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id8">Maintainers</a></h3> <p>This module is maintained by the OCA.</p> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>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.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/website/tree/12.0/website_snippet_country_dropdown">OCA/website</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>