fix(Holiday List): allow empty value
diff --git a/erpnext/setup/doctype/holiday_list/holiday_list.js b/erpnext/setup/doctype/holiday_list/holiday_list.js
index 8df49e1..8384ccf 100644
--- a/erpnext/setup/doctype/holiday_list/holiday_list.js
+++ b/erpnext/setup/doctype/holiday_list/holiday_list.js
@@ -9,11 +9,10 @@
frm.call("get_supported_countries").then(r => {
frm.subdivisions_by_country = r.message.subdivisions_by_country;
- frm.set_df_property(
- "country",
- "options",
- r.message.countries.sort((a, b) => a.label.localeCompare(b.label))
- );
+ const countries = r.message.countries.sort((a, b) => a.label.localeCompare(b.label));
+ countries.unshift({ value: "", label: __("Select Country ...") });
+
+ frm.set_df_property("country", "options", countries);
if (frm.doc.country) {
frm.trigger("set_subdivisions");
@@ -34,9 +33,10 @@
}
},
set_subdivisions: function(frm) {
- const subdivisions = frm.subdivisions_by_country[frm.doc.country];
+ const subdivisions = [...frm.subdivisions_by_country[frm.doc.country]];
if (subdivisions && subdivisions.length > 0) {
- frm.set_df_property("subdivision", "options", frm.subdivisions_by_country[frm.doc.country]);
+ subdivisions.unshift({ value: "", label: __("Select Subdivision ...") });
+ frm.set_df_property("subdivision", "options", subdivisions);
frm.set_df_property("subdivision", "hidden", 0);
} else {
frm.set_df_property("subdivision", "options", "");
diff --git a/erpnext/setup/doctype/holiday_list/holiday_list.py b/erpnext/setup/doctype/holiday_list/holiday_list.py
index d463356..2ef4e65 100644
--- a/erpnext/setup/doctype/holiday_list/holiday_list.py
+++ b/erpnext/setup/doctype/holiday_list/holiday_list.py
@@ -53,7 +53,7 @@
@frappe.whitelist()
def get_local_holidays(self):
if not self.country:
- throw(_("Please select Country"))
+ throw(_("Please select a country"))
existing_holidays = self.get_holidays()
from_date = getdate(self.from_date)
diff --git a/erpnext/translations/de.csv b/erpnext/translations/de.csv
index ad9897c..31eec6e 100644
--- a/erpnext/translations/de.csv
+++ b/erpnext/translations/de.csv
@@ -4004,6 +4004,8 @@
Search for anything ...,Nach etwas suchen ...,
Search results for,Suchergebnisse für,
Select All,Alles auswählen,
+Select Country ...,Land auswählen ...,
+Select Subdivision ...,Teilgebiet auswählen ...,
Select Difference Account,Wählen Sie Differenzkonto,
Select a Default Priority.,Wählen Sie eine Standardpriorität.,
Select a company,Wählen Sie eine Firma aus,
@@ -4194,6 +4196,7 @@
No students Found,Keine Schüler gefunden,
Not in Stock,Nicht lagernd,
Please select a Customer,Bitte wählen Sie einen Kunden aus,
+Please select a country,Bitte wählen Sie ein Land aus,
Printed On,Gedruckt auf,
Received From,Erhalten von,
Sales Person,Verkäufer,