mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 18:51:21 +00:00
Merge branch 'master' of github.com:webnotes/erpnext into responsive
Conflicts: patches/patch_list.py projects/doctype/project/project.py utilities/transaction_base.py
This commit is contained in:
21
patches/june_2013/p04_fix_event_for_lead_oppty_project.py
Normal file
21
patches/june_2013/p04_fix_event_for_lead_oppty_project.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
# delete orphaned Event User
|
||||
webnotes.conn.sql("""delete from `tabEvent User`
|
||||
where not exists(select name from `tabEvent` where `tabEvent`.name = `tabEvent User`.parent)""")
|
||||
|
||||
for dt in ["Lead", "Opportunity", "Project"]:
|
||||
for ref_name in webnotes.conn.sql_list("""select ref_name
|
||||
from `tabEvent` where ref_type=%s and ifnull(starts_on, '')='' """, dt):
|
||||
if webnotes.conn.exists(dt, ref_name):
|
||||
controller = webnotes.get_obj(dt, ref_name)
|
||||
if dt == "Project":
|
||||
controller.add_calendar_event()
|
||||
else:
|
||||
controller.delete_events()
|
||||
controller._add_calendar_event()
|
||||
else:
|
||||
# remove events where ref doc doesn't exist
|
||||
webnotes.delete_doc("Event", webnotes.conn.sql_list("""select name from `tabEvent`
|
||||
where ref_type=%s and ref_name=%s""", (dt, ref_name)))
|
||||
@@ -259,4 +259,6 @@ patch_list = [
|
||||
"patches.may_2013.p08_change_item_wise_tax",
|
||||
"patches.june_2013.p01_update_bom_exploded_items",
|
||||
"patches.june_2013.p02_update_project_completed",
|
||||
"execute:webnotes.delete_doc('DocType', 'System Console')",
|
||||
"patches.june_2013.p04_fix_event_for_lead_oppty_project",
|
||||
]
|
||||
Reference in New Issue
Block a user