diff --git a/justworks_erpnext/hooks.py b/justworks_erpnext/hooks.py index e035308..b729646 100644 --- a/justworks_erpnext/hooks.py +++ b/justworks_erpnext/hooks.py @@ -12,6 +12,9 @@ app_email = "code@studioinfinity.org" app_license = "GNU General Public License (v3)" fixtures = ['Custom Field'] +accounting_dimension_doctypes = ['JW Employee Allocation'] + +after_install = "justworks_erpnext.install.after_install" # Includes in # ------------------ @@ -61,7 +64,6 @@ fixtures = ['Custom Field'] # ------------ # before_install = "justworks_erpnext.install.before_install" -# after_install = "justworks_erpnext.install.after_install" # Desk Notifications # ------------------ diff --git a/justworks_erpnext/install.py b/justworks_erpnext/install.py new file mode 100644 index 0000000..9eff927 --- /dev/null +++ b/justworks_erpnext/install.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +from erpnext.doctype.accounting_dimension.accounting_dimension import make_dimension_in_accounting_doctypes, get_accounting_dimensions + +def after_install(): + jw_doclist = frappe.get_hooks('accounting_dimension_doctypes', + app='justworks_erpnext') + acc_dims = get_accounting_dimensions(as_list=False) + for dim in acc_dims: + make_dimension_in_accounting_doctypes(dim, doclist=jw_doclist) diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.json b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.json index a109746..2e6f30b 100644 --- a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.json +++ b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.json @@ -28,7 +28,7 @@ "reqd": 1 }, { - "default": "employee.employee_name", + "fetch_from": "employee.employee_name", "fieldname": "employee_name", "fieldtype": "Data", "in_list_view": 1, @@ -90,7 +90,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2020-11-17 00:49:16.498573", + "modified": "2020-11-17 01:39:51.349422", "modified_by": "Administrator", "module": "Justworks ERPNext Connector", "name": "JW Employee Allocation",