From 229f4d3d92e9db12afc2ed6c5d99cadc304dc4f0 Mon Sep 17 00:00:00 2001 From: Bhavan23 Date: Wed, 5 Mar 2025 20:09:21 +0530 Subject: [PATCH 1/2] fix: make 'company_tax_id' and 'company_fiscal_code' as mandatory (cherry picked from commit abd044eb0d0175f849777d24c2d7ec8401eb480d) --- erpnext/regional/italy/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py index 43ff59a1006..cec037e3892 100644 --- a/erpnext/regional/italy/utils.py +++ b/erpnext/regional/italy/utils.py @@ -261,12 +261,11 @@ def sales_invoice_validate(doc): 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: + if not doc.company_tax_id or not doc.company_fiscal_code: frappe.throw( - _("Please set either the Tax ID or Fiscal Code on Company '%s'" % doc.company), + _(f"Please set both the Tax ID and Fiscal Code on Company {doc.company}"), title=_("E-Invoicing Information Missing"), ) - # Validate customer details customer = frappe.get_doc("Customer", doc.customer) From 31dc6021e2a4200a7d7f90378f0c5b7a3e94ecbd Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 11 Mar 2025 16:55:04 +0530 Subject: [PATCH 2/2] chore: translatable strings (cherry picked from commit 121798ba857350bfdb594d824ea8d158fc15628d) --- erpnext/regional/italy/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py index cec037e3892..d996ff9b2ac 100644 --- a/erpnext/regional/italy/utils.py +++ b/erpnext/regional/italy/utils.py @@ -263,7 +263,7 @@ def sales_invoice_validate(doc): doc.company_fiscal_code = frappe.get_cached_value("Company", doc.company, "fiscal_code") if not doc.company_tax_id or not doc.company_fiscal_code: frappe.throw( - _(f"Please set both the Tax ID and Fiscal Code on Company {doc.company}"), + _("Please set both the Tax ID and Fiscal Code on Company {0}").format(doc.company), title=_("E-Invoicing Information Missing"), ) # Validate customer details