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.
198 lines
10 KiB
198 lines
10 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 id="address_form_id" t-if="request.website.is_public_user()"
|
|
action="/shop/payment" method="post"
|
|
class="checkout_autoformat">
|
|
<div id='address_on_payment'>
|
|
<t t-call="website_sale.address_on_payment" t-set="address"/>
|
|
</div>
|
|
<div class="row" t-if="not add">
|
|
<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>
|
|
<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') < 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') > 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">
|
|
&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" t-if="not add">
|
|
<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>
|
|
|