Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
04ae7b86ff
@ -1,19 +0,0 @@
|
|||||||
# ERPNext - web based ERP (http://erpnext.com)
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
import webnotes
|
|
||||||
from webnotes.model.doc import copy_common_fields
|
|
||||||
|
|
||||||
def update_employee_details(controller, method=None):
|
|
||||||
"""update employee details in linked doctypes"""
|
|
||||||
if method == "on_update" and controller.doc.doctype == "Employee":
|
|
||||||
# update salary structure
|
|
||||||
active_salary_structure = webnotes.conn.get_value("Salary Structure",
|
|
||||||
{"is_active": "Yes", "employee": controller.doc.name})
|
|
||||||
if not active_salary_structure:
|
|
||||||
return
|
|
||||||
|
|
||||||
ss = webnotes.model_wrapper("Salary Structure", active_salary_structure)
|
|
||||||
copy_common_fields(controller.doc, ss.doc)
|
|
||||||
ss.save()
|
|
||||||
@ -17,6 +17,5 @@
|
|||||||
observer_map = {
|
observer_map = {
|
||||||
"*:on_update": "home.update_feed",
|
"*:on_update": "home.update_feed",
|
||||||
"*:on_submit": "home.update_feed",
|
"*:on_submit": "home.update_feed",
|
||||||
"Employee:on_update": "hr.helpers.employee.update_employee_details"
|
|
||||||
# "*:on_update": "webnotes.widgets.moduleview.update_count"
|
# "*:on_update": "webnotes.widgets.moduleview.update_count"
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user