Skip to content

Commit

Permalink
[FIX][website_sale_checkout_country_vat] Do not die without country
Browse files Browse the repository at this point in the history
If you leave country field empty before pressing the confirm button at checkout, you were getting a 500 error because `country_id` was `""` (str), which cannot be searched in an int field.

Now we set a default `False` value, which will return an empty recordset without that problem.
  • Loading branch information
yajo authored and pedrobaeza committed Sep 6, 2017
1 parent c08d66e commit 332a88a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion website_sale_checkout_country_vat/__manifest__.py
Expand Up @@ -6,7 +6,7 @@
{
"name": "Website Sale Checkout Country VAT",
"summary": "Autocomplete VAT in checkout process",
"version": "10.0.1.0.0",
"version": "10.0.1.1.0",
"category": "Website",
'website': 'https://www.tecnativa.com',
'author': 'Tecnativa, '
Expand Down
2 changes: 1 addition & 1 deletion website_sale_checkout_country_vat/views/templates.xml
Expand Up @@ -10,7 +10,7 @@
<t t-set="complete_field" t-value="'vat'"/>
<t t-set="default_value" t-value="checkout.get('vat', '')"/>
<t t-set="default_country"
t-value="countries.search([('code', '=', default_value[:2])]) or countries.search([('id', '=', checkout.get('country_id'))])"/>
t-value="countries.search([('code', '=', default_value[:2])]) or countries.search([('id', '=', checkout.get('country_id') or False)])"/>
</t>
</xpath>
</template>
Expand Down

0 comments on commit 332a88a

Please sign in to comment.