Skip to content

Commit

Permalink
Merge 64b7d65 into 1b2af72
Browse files Browse the repository at this point in the history
  • Loading branch information
AminovE99 committed Nov 25, 2019
2 parents 1b2af72 + 64b7d65 commit 16d2fae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext_ocr/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# ------------

# before_install = "erpnext_ocr.install.before_install"
# after_install = "erpnext_ocr.install.after_install"
after_install = "erpnext_ocr.install.after_install"

# Desk Notifications
# ------------------
Expand Down
15 changes: 15 additions & 0 deletions erpnext_ocr/install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import frappe
from erpnext_ocr.erpnext_ocr.doctype.ocr_language.ocr_language import check_language


def fill_languages():
all_lang = frappe.get_all("OCR Language")
for lang in all_lang:
cur_lang = frappe.get_doc("OCR Language", lang)
cur_lang.is_supported = check_language(cur_lang.name)
cur_lang.save()
print(cur_lang.name + ":" + cur_lang.is_supported)


def after_install():
fill_languages()

0 comments on commit 16d2fae

Please sign in to comment.