fix: reload docs before creating custom fields (#17586)

This commit is contained in:
Saurabh 2019-05-15 11:39:41 +05:30 committed by Nabin Hait
parent 4c0f754a96
commit 9da57d79b5
3 changed files with 15 additions and 1 deletions

View File

@ -70,7 +70,7 @@ def update_instructors(comp_dict):
emp_details = frappe.get_all("Employee", fields=["name", "company"])
for employee in emp_details:
records = comp_dict[employee.company]
records = comp_dict[employee.company] if employee.company else []
for department in records:
when_then.append('''

View File

@ -8,6 +8,17 @@ def execute():
return
frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Declaration")
frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Proof Submission")
frappe.reload_doc("hr", "doctype", "Employee Grade")
frappe.reload_doc("hr", "doctype", "Leave Policy")
frappe.reload_doc("accounts", "doctype", "Bank Account")
frappe.reload_doc("accounts", "doctype", "Tax Withholding Category")
frappe.reload_doc("accounts", "doctype", "Allowed To Transact With")
frappe.reload_doc("accounts", "doctype", "Finance Book")
frappe.reload_doc("accounts", "doctype", "Loyalty Program")
frappe.reload_doc("stock", "doctype", "Item Barcode")
make_custom_fields()
frappe.reload_doc("accounts", "doctype", "sales_taxes_and_charges")

View File

@ -7,6 +7,9 @@ def execute():
if not company:
return
frappe.reload_doc('hr', 'doctype', 'payroll_period')
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration_category')
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission_detail')
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration')
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission')