Odoo18-Base/addons/l10n_br_website_sale/views/templates.xml
2025-01-06 10:57:38 +07:00

93 lines
5.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="address" inherit_id="website_sale.address">
<div id="div_vat" position="before">
<t t-if="(use_delivery_as_billing and address_type == 'delivery' or address_type == 'billing') and res_company.country_id.code == 'BR'">
<!-- Break the line to put Identification Type and Number (vat) on the same line -->
<div class="clearfix"/>
<div class="col-xl-6 mb-3">
<label class="col-form-label" for="l10n_latam_identification_type_id">Identification Type</label>
<t t-if="can_edit_vat">
<select name="l10n_latam_identification_type_id" class="form-select">
<option value="">Identification Type...</option>
<t t-foreach="identification_types" t-as="id_type">
<option t-att-value="id_type.id"
t-att-selected="id_type.id == partner_sudo.l10n_latam_identification_type_id.id">
<t t-out="id_type.name"/>
</option>
</t>
</select>
</t>
<t t-else="">
<p class="form-control"
t-out="partner_sudo.l10n_latam_identification_type_id.name"
readonly="1"
title="Changing Identification type is not allowed once document(s) have been issued for your account. Please contact us directly for this operation."/>
<input name="l10n_latam_identification_type_id"
class="form-control"
t-att-value="partner_sudo.l10n_latam_identification_type_id.id"
type="hidden"/>
</t>
</div>
</t>
</div>
<!-- o_city must remain in DOM, otherwise the standard website_sale js breaks. -->
<input id="o_city" position="attributes">
<attribute name="class" separator=" " add="o_standard_address"/>
</input>
<input id="o_city" position="after">
<select t-if="res_company.account_fiscal_country_id.code == 'BR'" id="o_city_id" name="city_id" class="form-select o_extended_address">
<option value="">City...</option>
<t t-foreach="cities_sudo" t-as="c">
<option t-att-value="c.id" t-att-selected="c.id == city_sudo.id" t-att-code="c.id" t-att-state-id="c.state_id.id" t-att-zip-ranges="c.l10n_br_zip_ranges">
<t t-esc="c.name" />
</option>
</t>
</select>
</input>
<!-- put base_address_extended fields separately to be more user-friendly -->
<div id="div_street" position="attributes">
<attribute name="class" separator=" " add="o_standard_address"/>
</div>
<div id="div_street" position="after">
<t t-if="res_company.account_fiscal_country_id.code == 'BR'">
<div id="div_street_name" t-attf-class="col-lg-8 mb-2 o_extended_address">
<label class="col-form-label" for="o_street_name">Street</label>
<input id="o_street_name" type="text" name="street_name" class="form-control" t-att-value="partner_sudo.street_name"/>
</div>
<div id="div_street_number" t-attf-class="col-lg-4 mb-2 o_extended_address">
<label class="col-form-label" for="o_street_number">Street Number</label>
<input id="o_street_number" type="text" name="street_number" class="form-control" t-att-value="partner_sudo.street_number"/>
</div>
<div class="w-100"/>
<div id="div_street_number2" t-attf-class="col-lg-6 mb-2 o_extended_address">
<label class="col-form-label" for="o_street_number2">Complement</label>
<input id="o_street_number2" type="text" name="street_number2" class="form-control" t-att-value="partner_sudo.street_number2"/>
</div>
<div id="div_street2" position="move"/>
</t>
</div>
<!-- street2 is used for neighborhood in Brazil, change the default label -->
<label for="o_street2" position="attributes">
<attribute name="t-attf-class" separator=" " add="col-form-label label-optional o_standard_address"/>
</label>
<label for="o_street2" position="after">
<label t-if="res_company.account_fiscal_country_id.code == 'BR'" t-attf-class="col-form-label label-optional o_extended_address" for="o_street2">Neighborhood</label>
</label>
</template>
<template id="total" inherit_id="website_sale.total">
<tr id="order_total_untaxed" position="attributes">
<attribute name="t-attf-class" add="#{'d-none' if website.company_id.country_code == 'BR' else ''}" separator=" "/>
</tr>
<tr id="order_total_taxes" position="attributes">
<attribute name="t-attf-class" add="#{'d-none' if website.company_id.country_code == 'BR' else ''}" separator=" "/>
</tr>
<tr id="order_total" position="attributes">
<attribute name="t-attf-class" add="#{'border-top' if website.company_id.country_code != 'BR' else ''}" separator=" "/>
</tr>
</template>
</odoo>