diff --git a/home/__init__.py b/home/__init__.py index 09c5c1fa49..c254c8e777 100644 --- a/home/__init__.py +++ b/home/__init__.py @@ -95,7 +95,6 @@ def update_feed(doc, method): "adds a new feed" if method=='validate': return - subject, color = feed_dict.get(doc.doctype, [None, None]) if subject: subject = subject % doc.fields diff --git a/patches/patch.py b/patches/patch.py index 911c8350d6..8c839e13d0 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 312 +last_patch = 315 #------------------------------------------- @@ -1231,3 +1231,43 @@ def execute(patch_no): elif patch_no == 312: sql("delete from `tabSessions`") sql("delete from `__SessionCache`") + elif patch_no == 313: + dt = ['GL Entry', 'Stock Ledger Entry'] + for t in dt: + rec = sql("select voucher_type, voucher_no, ifnull(is_cancelled, 'No') from `tab%s` where modified >= '2011-07-06 10:00:00' group by voucher_no" % t) + for d in rec: + sql("update `tab%s` set docstatus = %s where name = '%s'" % (d[0], d[2]=='No' and 1 or 2, d[1])) + + other_dt = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note'] + for dt in other_dt: + rec = sql("select name, status from `tab%s` where modified >= '2011-07-06 10:00:00'" % dt) + for r in rec: + sql("update `tab%s` set docstatus = %s where name = '%s'" % (dt, (r[1] in ['Submitted', 'Closed'] and 1 or r[1]=='Cancelled' and 2 or 0), r[0])) + + + dt_list = ['Delivery Note', 'Purchase Receipt'] + for dt in dt_list: + sql("update `tab%s` set status = 'Submitted' where docstatus = 1 and modified >='2011-07-06 10:00:00'" % dt) + sql("update `tab%s` set status = 'Cancelled' where docstatus = 2 and modified >='2011-07-06 10:00:00'" % dt) + + dt_list = ['Enquiry', 'Quotation', 'Sales Order', 'Indent', 'Purchase Order', 'Production Order', 'Customer Issue', 'Installation Note', 'Receivable Voucher', 'Payable Voucher', 'Delivery Note', 'Purchase Receipt', 'Journal Voucher', 'Stock Entry'] + for d in dt_list: + tbl = sql("select options from `tabDocField` where fieldtype = 'Table' and parent = '%s'" % d) + for t in tbl: + sql("update `tab%s` t1, `tab%s` t2 set t1.docstatus = t2.docstatus where t1.parent = t2.name" % (t[0], d)) + + elif patch_no == 314: + # delete double feed + sql("delete from tabFeed where subject like 'New %'") + elif patch_no == 315: + # delete double feed + sql("delete from tabFeed where doc_name like 'New %'") + reload_doc('core', 'doctype', 'property_setter') + + from webnotes.model.doc import Document + m = Document('Module Def Role') + m.role = 'All' + m.parent = 'Home' + m.parenttype = 'Module Def' + m.parentfield = 'roles' + m.save(1)