You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

261 lines
14 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="address_form" name="Address Form">
<div class="row">
<!-- Form for public users to enter their payment information -->
<form t-if="is_public_user"
action="/shop/payment" method="post"
class="checkout_autoformat">
<div class="row">
<t t-set="error_message" t-value="error.get('error_message', False)"/>
<t t-if="error_message">
<h5 class="text-danger" t-esc="error_message[0]"/>
</t>
<div t-attf-class="mb-3 col-lg-12 div_name">
<label class="col-form-label"
for="name">Name
</label>
<input type="text" name="name"
t-attf-class="form-control #{'is-invalid' if error.get('name', '') != '' else 'valid'}"
t-att-value="'name' in checkout and checkout['name']"/>
</div>
<div class="w-100"/>
<div t-attf-class="mb-3 col-lg-6"
id="div_email">
<label t-attf-class="col-form-label #{mode[1] == 'shipping' and 'label-optional' or ''}"
for="email">Email
</label>
<input type="email"
name="email"
t-attf-class="form-control #{'is-invalid' if error.get('email', '') != '' else 'valid'}"
t-att-value="'email' in checkout and checkout['email']"/>
</div>
<div t-attf-class="mb-3 col-lg-6"
id="div_phone">
<label class="col-form-label"
for="phone">Phone
</label>
<input type="tel" name="phone"
t-attf-class="form-control #{'is-invalid' if error.get('name', '') != '' else 'valid'}"
t-att-value="'phone' in checkout and checkout['phone']"/>
</div>
<!-- Input fields for company name and VAT number if in B2B mode -->
<t t-if="website._display_partner_b2b_fields()">
<div class="w-100"/>
<t t-set='vat_warning'
t-value="'vat' in checkout and checkout['vat'] and not can_edit_vat"/>
<t t-if="mode == ('new', 'billing') or (mode == ('edit', 'billing') and (can_edit_vat or 'vat' in checkout and checkout['vat']))">
<div t-attf-class="mb-3 col-lg-6 mb-0">
<label class="col-form-label fw-normal label-optional"
for="company_name">
Company Name
</label>
<input type="text"
name="company_name"
t-attf-class="form-control"
t-att-value="'commercial_company_name' in checkout and checkout['commercial_company_name'] or 'company_name' in checkout and checkout['company_name']"
t-att-readonly="'1' if vat_warning else None"/>
<small t-if="vat_warning"
class="form-text text-muted d-block d-lg-none">
Changing company
name is not allowed
once document(s)
have been issued
for your account.
Please contact us
directly for this
operation.
</small>
</div>
<div t-attf-class="mb-3 col-lg-6 div_vat mb-0">
<label class="col-form-label fw-normal label-optional"
for="vat">TIN /
VAT
</label>
<input type="text"
name="vat"
t-attf-class="form-control"
t-att-value="'vat' in checkout and checkout['vat']"
t-att-readonly="'1' if vat_warning else None"/>
<small t-if="vat_warning"
class="form-text text-muted d-block d-lg-none">
Changing VAT number
is not allowed once
document(s) have
been issued for
your account.
Please contact us
directly for this
operation.
</small>
</div>
<div t-if="vat_warning"
class="col-12 d-none d-lg-block mb-1">
<small class="form-text text-muted">
Changing company
name or VAT number
is not allowed once
document(s) have
been issued for
your account.
Please contact us
directly for this
operation.
</small>
</div>
</t>
</t>
<div class="w-100"/>
<div t-attf-class="mb-3 col-lg-12 div_street">
<label class="col-form-label"
for="street">Street
<span class="d-none d-md-inline">
and Number
</span>
</label>
<input type="text"
name="street"
t-attf-class="form-control #{'is-invalid' if error.get('street', '') != '' else 'valid'}"
t-att-value="'street' in checkout and checkout['street']"/>
</div>
<div t-attf-class="mb-3 col-lg-12 div_street2">
<label class="col-form-label label-optional"
for="street2">Street 2
</label>
<input type="text"
name="street2"
t-attf-class="form-control"
t-att-value="'street2' in checkout and checkout['street2']"/>
</div>
<div class="w-100"/>
<t t-set='zip_city'
t-value='country and [x for x in country.get_address_fields() if x in ["zip", "city"]] or ["city", "zip"]'/>
<t t-if="'zip' in zip_city and zip_city.index('zip') &lt; zip_city.index('city')">
<div t-attf-class="mb-3 col-md-4 div_zip">
<label class="col-form-label label-optional"
for="zip">Zip Code
</label>
<input type="text"
name="zip"
t-attf-class="form-control"
t-att-value="'zip' in checkout and checkout['zip']"/>
</div>
</t>
<div t-attf-class="mb-3 col-md-8 div_city">
<label class="col-form-label"
for="city">City
</label>
<input type="text" name="city"
t-attf-class="form-control #{'is-invalid' if error.get('city', '') != '' else 'valid'}"
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="mb-3 col-md-4 div_zip">
<label class="col-form-label label-optional"
for="zip">Zip Code
</label>
<input type="text"
name="zip"
t-attf-class="form-control"
t-att-value="'zip' in checkout and checkout['zip']"/>
</div>
</t>
<div class="w-100"/>
<div t-attf-class="mb-3 and 'o_has_error' or ''} col-lg-6 div_country">
<label class="col-form-label"
for="country_id">Country
</label>
<select id="country_id"
name="country_id"
t-attf-class="form-select"
t-att-mode="mode[1]">
<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="mb-3 col-lg-6 div_state"
t-att-style="(not country or not country.state_ids) and 'display: none'">
<label class="col-form-label" for="state_id">
State / Province
</label>
<select name="state_id" t-attf-class="form-select"
data-init="1">
<option value="">
State / Province...
</option>
<t t-foreach="country_states" 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>
<div class="w-100"/>
<!-- Checkbox to choose whether to ship to the same address as billing -->
<t t-if="mode == ('new', 'billing') and not only_services">
<div class="col-lg-12">
<div class="checkbox">
<label>
<input type="checkbox"
id='shipping_use_same'
class="mr8"
name='use_same'
value="1"
checked='checked'/>
Ship to the same
address
<span class='ship_to_other text-muted'
style="display: none">
&amp;nbsp;(
<i>Your
shipping
address
will be
requested
later)
</i>
</span>
</label>
</div>
</div>
</t>
</div>
<input type="hidden" name="csrf_token"
t-att-value="request.csrf_token()"
t-nocache="The csrf token must always be up to date."/>
<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"/>
<input type="hidden"
name="field_required"
t-att-value="'phone,name'"/>
<!-- Navigation -->
<div class="d-flex justify-content-between">
<a role="button"
t-att-href="mode == ('new', 'billing') and '/shop/cart' or '/shop/checkout'"
class="btn btn-secondary mb32">
<i class="fa fa-chevron-left"/>
<span>Back</span>
</a>
<a role="button" href="#"
class="btn btn-primary mb32 a-submit a-submit-disable a-submit-loading">
<span>Confirm</span>
<i class="fa fa-chevron-right"/>
</a>
</div>
</form>
</div>
</template>
</odoo>