Skip to content
Snippets Groups Projects
Commit 59be055c authored by Christophe Matthieu's avatar Christophe Matthieu
Browse files

[IMP] website_sale: if base_vat is installed, when the use try to validate...

[IMP] website_sale: if base_vat is installed, when the use try to validate checkout, the vat is checked (VAT Information Exchange System)
parent b5833591
No related branches found
No related tags found
No related merge requests found
......@@ -355,6 +355,11 @@ class website_sale(http.Controller):
if not data.get(field_name):
error[field_name] = 'missing'
if data.get("vat") and hasattr(registry["res.partner"], "check_vat"):
vat_country, vat_number = registry["res.partner"]._split_vat(data.get("vat"))
if not registry["res.partner"].vies_vat_check(cr, uid, vat_country, vat_number, context=None): # simple_vat_check
error["vat"] = 'error'
if data.get("shipping_different"):
for field_name in self.mandatory_shipping_fields:
field_name = 'shipping_' + field_name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment