def setup_holiday_list():
 year = now_datetime().year
 holiday_list = frappe.get_doc({u'doctype': u'Holiday List', u'holiday_list_name': str(year), u'from_date': u'{0}-01-01'.format(year), u'to_date': u'{0}-12-31'.format(year)})
 holiday_list.insert()
 holiday_list.weekly_off = u'Saturday'
 holiday_list.get_weekly_off_dates()
 holiday_list.weekly_off = u'Sunday'
 holiday_list.get_weekly_off_dates()
 holiday_list.save()
 frappe.set_value(u'Company', erpnext.get_default_company(), u'default_holiday_list', holiday_list.name)

def setup_holiday_list ( ) : year = now_datetime ( ) . year holiday_list = frappe . get_doc ( { u'doctype' : u'Holiday List' , u'holiday_list_name' : str ( year ) , u'from_date' : u'{0}-01-01' . format ( year ) , u'to_date' : u'{0}-12-31' . format ( year ) } ) holiday_list . insert ( ) holiday_list . weekly_off = u'Saturday' holiday_list . get_weekly_off_dates ( ) holiday_list . weekly_off = u'Sunday' holiday_list . get_weekly_off_dates ( ) holiday_list . save ( ) frappe . set_value ( u'Company' , erpnext . get_default_company ( ) , u'default_holiday_list' , holiday_list . name )
setup holiday list for the current year .