Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

QWeb conditional in website_sale.address

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
addressqwebecommerceB2Bwebsite_sale
6478 Rodiniai
Portretas
Adrian Schultze

Hey there,

I want to sell a digital product through ecommerce module. Its a B2B transaction and I need the following logic. Whenever a customer selects a country that is Intra-Europe and not Germany, the VAT/ID Field shall be required. How to do that? This is the code. As you can see, I removed "phone" from required and added "company_name".


<?xml version="1.0"?>
<t name="Address Management" t-name="website_sale.address">
        <t t-set="no_footer">1</t>
        <t t-call="website.layout">
            <div id="wrap">
                <div class="container oe_website_sale">
                    <div class="row">
                        <div class="col-md-8 col-md-offset-2 oe_cart">
                    <div class="row">
                        <t t-call="website_sale.wizard_checkout">
                            <t t-set="step" t-value="20"/>
                        </t>
                    </div>
                            <div class="row">
                                <t t-if="mode == ('new', 'billing')">
                                    <h2 class="page-header mt8 ml16">Your Address
                                        <small> or </small>
                                        <a href="/web/login?redirect=/shop/checkout" class="btn btn-primary" style="margin-top: -11px">Log In</a>
                                    </h2>
                                </t>
                                <t t-if="mode == ('edit', 'billing')">
                                    <h2 class="page-header mt8 ml16">Your Address</h2>
                                </t>
                                <t t-if="mode[1] == 'shipping'">
                                    <h2 class="page-header mt8 ml16">Shipping Address </h2>
                                </t>
                                <t t-if="error" t-foreach="error.get('error_message', [])" t-as="err">
                                    <h4 class="text-danger" t-esc="err"/>
                                </t>
                                <form name="/shop/checkout" method="post" class="checkout_autoformat">
                                    <div t-attf-class="form-group #{error.get('name') and 'has-error' or ''} col-md-12 div_name">
                                        <label class="control-label label-optional" for="name">Name</label>
                                        <input type="text" name="name" class="form-control" t-att-value="'name' in checkout and checkout['name']"/>
                                    </div>
                                    <div class="clearfix"/>
                                    <t t-if="mode[1] == 'billing'">
                                        <div t-attf-class="form-group #{error.get('email') and 'has-error' or ''} col-md-6" id="div_email">
                                            <label class="control-label" for="email">Email</label>
                                            <input type="email" name="email" class="form-control" t-att-value="'email' in checkout and checkout['email']"/>
                                        </div>
                                    </t>
                                    <div t-attf-class="form-group #{error.get('phone') and 'has-error' or ''} col-md-6" id="div_phone">
                                        <label class="control-label" for="phone">Phone</label>
                                        <input type="tel" name="phone" class="form-control" t-att-value="'phone' in checkout and checkout['phone']"/>
                                    </div>
                                    <div class="clearfix"/>
                                    <t t-if="mode == ('new', 'billing')">
                                        <div t-attf-class="form-group #{error.get('company_name') and 'has-error' or ''} col-md-6">
                                            <label class="control-label" for="company_name">Company Name</label>
                                            <input type="text" name="company_name" class="form-control" t-att-value="'company_name' in checkout and checkout['company_name']"/>
                                        </div>
                                        <div t-attf-class="form-group #{error.get('vat') and 'has-error' or ''} col-md-6 div_vat">
                                            <label class="control-label font-weight-normal label-optional" for="vat">TIN / VAT </label>
                                            <input type="text" name="vat" class="form-control" t-att-value="'vat' in checkout and checkout['vat']"/>
                                        </div>
                                    </t>
                                    <div class="clearfix"/>
                                    <div t-attf-class="form-group #{error.get('street') and 'has-error' or ''} col-md-12 div_street">
                                        <label class="control-label" for="street">Street <span class="hidden-xs"> and Number</span></label>
                                        <input type="text" name="street" class="form-control" t-att-value="'street' in checkout and checkout['street']"/>
                                    </div>
                                    <div t-attf-class="form-group #{error.get('street2') and 'has-error' or ''} col-md-12 div_street2">
                                        <label class="control-label label-optional" for="street2">Street 2</label>
                                        <input type="text" name="street2" class="form-control" t-att-value="'street2' in checkout and checkout['street2']"/>
                                    </div>
                                    <div class="clearfix"/>
                                    <t t-set="zip_city" t-value="country and [x for x in country.get_address_fields() if x in [&quot;zip&quot;, &quot;city&quot;]] or [&quot;city&quot;, &quot;zip&quot;]"/>
                                    <t t-if="'zip' in zip_city and zip_city.index('zip') &lt; zip_city.index('city')">
                                        <div t-attf-class="form-group #{error.get('zip') and 'has-error' or ''} col-sm-4 div_zip">
                                            <label class="control-label label-optional" for="zip">Zip Code</label>
                                            <input type="text" name="zip" class="form-control" t-att-value="'zip' in checkout and checkout['zip']"/>
                                        </div>
                                    </t>
                                    <div t-attf-class="form-group #{error.get('city') and 'has-error' or ''} col-sm-8 div_city">
                                        <label class="control-label" for="city">City</label>
                                        <input type="text" name="city" class="form-control" t-att-value="'city' in checkout and checkout['city']"/>
                                    </div>
                                    <t t-if="'zip' in zip_city and zip_city.index('zip') &gt; zip_city.index('city')">
                                        <div t-attf-class="form-group #{error.get('zip') and 'has-error' or ''} col-sm-4 div_zip">
                                            <label class="control-label label-optional" for="zip">Zip Code</label>
                                            <input type="text" name="zip" class="form-control" t-att-value="'zip' in checkout and checkout['zip']"/>
                                        </div>
                                    </t>
                                    <div class="clearfix"/>
                                    <div t-attf-class="form-group #{error.get('country_id') and 'has-error' or ''} col-md-6 div_country">
                                        <label class="control-label" for="country_id">Country</label>
                                        <select id="country_id" name="country_id" class="form-control">
                                            <option value="">Country...</option>
                                            <t t-foreach="countries" t-as="c">
                                                <option t-att-value="c.id" t-att-selected="c.id == (country and country.id or -1)">
                                                    <t t-esc="c.name"/>
                                                </option>
                                            </t>
                                        </select>
                                    </div>
                                    <div t-attf-class="form-group #{error.get('state_id') and 'has-error' or ''} col-md-6 div_state" t-att-style="(not country or not country.state_ids) and 'display: none'">
                                        <label class="control-label" for="state_id">State / Province</label>
                                        <select name="state_id" class="form-control" data-init="1">
                                            <option value="">State / Province...</option>
                                            <t t-foreach="country and country.state_ids or []" t-as="s">
                                                <option t-att-value="s.id" t-att-selected="s.id == ('state_id' in checkout and country and checkout['state_id'] != '' and int(checkout['state_id']))">
                                                    <t t-esc="s.name"/>
                                                </option>
                                            </t>
                                        </select>
                                    </div>

                                    <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
                                    <input type="hidden" name="submitted" value="1"/>
                                    <input type="hidden" name="partner_id" t-att-value="partner_id or '0'"/>
                                    <input type="hidden" name="callback" t-att-value="callback"/>
                                    <!-- Example -->
                                    <input type="hidden" name="field_required" t-att-value="'company_name'"/>

                                    <div class="clearfix"/>
                                    <div style="padding: 0 15px">
                                        <a t-att-href="mode == ('new', 'billing') and '/shop/cart' or '/shop/checkout'" class="btn btn-default mb32">
                                            <span class="fa fa-long-arrow-left"/> Back
                                        </a>
                                        <a class="btn btn-primary pull-right mb32 a-submit a-submit-disable a-submit-loading">
                                            <span>Next </span><span class="fa fa-long-arrow-right"/>
                                        </a>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </t>
    </t>
    

Thanks for your help.


Adrian



0
Portretas
Atmesti
Rupesh Dalvi

Hello @Adrian,
I am working on a similar case, did you find the solution?

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registracija
Related Posts Replies Rodiniai Veikla
Qweb foreign currency printing problem Solved
qweb currency ecommerce website_sale
Portretas
Portretas
Portretas
3
spal. 25
5577
B2B Product Access Restricted by Company
ecommerce B2B
Portretas
Portretas
Portretas
Portretas
4
gruod. 24
2678
Don't ask for address in online sellings
address ecommerce
Portretas
0
kov. 22
1619
Add shop and wishlist buttons on new website theme module
ecommerce website_sale
Portretas
0
vas. 22
3001
Odoo 12 - How to Add Field at template
ecommerce website_sale
Portretas
Portretas
2
liep. 19
7247
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now