fix(regional,italy): autoset company cf, tax_id before validating

This commit is contained in:
Gaurav 2019-03-28 12:18:03 +05:30
parent 010acf75fa
commit bd80fd13cb

View File

@ -199,6 +199,8 @@ def sales_invoice_validate(doc):
else:
doc.company_fiscal_regime = company_fiscal_regime
doc.company_tax_id = frappe.get_cached_value("Company", doc.company, 'tax_id')
doc.company_fiscal_code = frappe.get_cached_value("Company", doc.company, 'fiscal_code')
if not doc.company_tax_id and not doc.company_fiscal_code:
frappe.throw(_("Please set either the Tax ID or Fiscal Code on Company '%s'" % doc.company), title=_("E-Invoicing Information Missing"))