added new fields and function that automaticly sets ceo
This commit is contained in:
parent
83aa8611fb
commit
151548f947
|
|
@ -0,0 +1,9 @@
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def on_update(doc, method):
|
||||||
|
# Проверяем, сменился ли статус на "Completed"
|
||||||
|
if doc.boarding_status == "Completed":
|
||||||
|
# Проверяем, является ли сотрудник CEO
|
||||||
|
if doc.designation == "Chief Executive Officer":
|
||||||
|
if doc.company:
|
||||||
|
frappe.db.set_value("Company", doc.company, "ceo", doc.employee)
|
||||||
|
|
@ -18,7 +18,25 @@ def create_custom_fields():
|
||||||
fieldtype='Data',
|
fieldtype='Data',
|
||||||
insert_after='swift_number'
|
insert_after='swift_number'
|
||||||
)
|
)
|
||||||
]
|
],
|
||||||
|
"Employee Transfer": [
|
||||||
|
dict(
|
||||||
|
fieldname='reason',
|
||||||
|
label='Reason',
|
||||||
|
fieldtype='Data',
|
||||||
|
insert_after='amended_from'
|
||||||
|
)
|
||||||
|
],
|
||||||
|
"Company": [
|
||||||
|
dict(
|
||||||
|
fieldname='ceo',
|
||||||
|
label='Chief Executive Officer',
|
||||||
|
fieldtype='Link',
|
||||||
|
options='Employee',
|
||||||
|
insert_after='default_holiday_list',
|
||||||
|
read_only=1
|
||||||
|
)
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
for doctype, fields in custom_fields.items():
|
for doctype, fields in custom_fields.items():
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,12 @@ override_doctype_class = {
|
||||||
"Report": "jey_erp.custom_report.CustomReport"
|
"Report": "jey_erp.custom_report.CustomReport"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doc_events = {
|
||||||
|
"Employee Onboarding": {
|
||||||
|
"on_update": "jey_erp.custom_employee_onboarding.on_update"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
after_migrate = "jey_erp.hooks.after_migrate_combined"
|
after_migrate = "jey_erp.hooks.after_migrate_combined"
|
||||||
|
|
||||||
def after_migrate_combined():
|
def after_migrate_combined():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue