2013-02-07 03:39:14 +00:00
|
|
|
def execute():
|
|
|
|
import webnotes
|
2013-02-07 05:25:48 +00:00
|
|
|
webnotes.reload_doc("hr", "doctype", "leave_application")
|
|
|
|
|
2013-02-07 03:39:14 +00:00
|
|
|
webnotes.conn.sql("""update `tabLeave Application`, `tabEmployee` set
|
|
|
|
`tabLeave Application`.company = `tabEmployee`.company where
|
|
|
|
`tabLeave Application`.employee = `tabEmployee`.name""")
|
|
|
|
|
|
|
|
company = webnotes.conn.get_default("company")
|
2013-02-07 05:28:15 +00:00
|
|
|
if company:
|
|
|
|
webnotes.conn.sql("""update `tabLeave Application`
|
|
|
|
set company = %s where ifnull(company,'')=''""", company)
|