[FIX] website_sale: Postal Code is required during checkout for countries without postal codes; Zip must be not required.

This commit is contained in:
Christophe Matthieu
2014-10-27 10:24:13 +01:00
committed by Christophe Simonis
parent ae02468e0a
commit 4a46fce95a
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -432,10 +432,10 @@ class website_sale(http.Controller):
return values
mandatory_billing_fields = ["name", "phone", "email", "street2", "city", "country_id", "zip"]
optional_billing_fields = ["street", "state_id", "vat", "vat_subjected"]
mandatory_shipping_fields = ["name", "phone", "street", "city", "country_id", "zip"]
optional_shipping_fields = ["state_id"]
mandatory_billing_fields = ["name", "phone", "email", "street2", "city", "country_id"]
optional_billing_fields = ["street", "state_id", "vat", "vat_subjected", "zip"]
mandatory_shipping_fields = ["name", "phone", "street", "city", "country_id"]
optional_shipping_fields = ["state_id", "zip"]
def checkout_parse(self, address_type, data, remove_prefix=False):
""" data is a dict OR a partner browse record
+2 -2
View File
@@ -882,7 +882,7 @@
<input type="text" name="city" class="form-control" t-att-value="checkout.get('city')"/>
</div>
<div t-attf-class="form-group #{error.get('zip') and 'has-error' or ''} col-lg-6">
<label class="control-label" for="zip">Zip / Postal Code</label>
<label class="control-label" for="zip" style="font-weight: normal">Zip / Postal Code</label>
<input type="text" name="zip" class="form-control" t-att-value="checkout.get('zip')"/>
</div>
<div t-attf-class="form-group #{error.get('country_id') and 'has-error' or ''} col-lg-6">
@@ -946,7 +946,7 @@
<input type="text" name="shipping_city" class="form-control" t-att-value="checkout.get('shipping_city', '')" t-att-readonly=" 'readonly' if shipping_id &gt;= 0 else ''"/>
</div>
<div t-attf-class="form-group #{error.get('shipping_zip') and 'has-error' or ''} col-lg-6">
<label class="control-label" for="shipping_zip">Zip / Postal Code</label>
<label class="control-label" for="shipping_zip" style="font-weight: normal">Zip / Postal Code</label>
<input type="text" name="shipping_zip" class="form-control" t-att-value="checkout.get('shipping_zip', '')" t-att-readonly=" 'readonly' if shipping_id &gt;= 0 else ''"/>
</div>
<div t-attf-class="form-group #{error.get('shipping_country_id') and 'has-error' or ''} col-lg-6">