From d54ec529830d88c96c67229be74b4b6a5b89dc73 Mon Sep 17 00:00:00 2001 From: nabinhait Date: Wed, 6 Jul 2011 12:20:21 +0530 Subject: [PATCH 1/6] fixed error in patches --- patches/patch.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/patches/patch.py b/patches/patch.py index 911c8350d6..23a3aa2712 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1231,3 +1231,27 @@ 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, ststus = %s where name = '%s'" % (d[0], d[2]=='No' and 1 or 2,d[2]=='No' and 'Submitted' or 'Cancelled', 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)) From fccbb0948a0edd548f67ff928b82697dbf8504e2 Mon Sep 17 00:00:00 2001 From: nabinhait Date: Wed, 6 Jul 2011 12:23:27 +0530 Subject: [PATCH 2/6] fixed error in patches --- patches/patch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/patch.py b/patches/patch.py index 23a3aa2712..a535e4f619 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 312 +last_patch = 313 #------------------------------------------- @@ -1236,7 +1236,7 @@ def execute(patch_no): 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, ststus = %s where name = '%s'" % (d[0], d[2]=='No' and 1 or 2,d[2]=='No' and 'Submitted' or 'Cancelled', d[1])) + 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: From 8aee9acfce685864549bceea015f89b79c18fb24 Mon Sep 17 00:00:00 2001 From: nabinhait Date: Wed, 6 Jul 2011 12:34:15 +0530 Subject: [PATCH 3/6] project subject bug --- home/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/__init__.py b/home/__init__.py index bcfcbb7009..44c9042d85 100644 --- a/home/__init__.py +++ b/home/__init__.py @@ -3,7 +3,7 @@ from webnotes import msgprint feed_dict = { # Project - 'Project': ['[%(status)s] %(subject)s', '#000080'], + 'Project': ['[%(status)s]', '#000080'], # Sales 'Lead': ['%(lead_name)s', '#000080'], From 68f86c8ad717b9ede430449ebde64419a06e8b4b Mon Sep 17 00:00:00 2001 From: nabinhait Date: Wed, 6 Jul 2011 12:41:07 +0530 Subject: [PATCH 4/6] double feed bug --- home/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/home/__init__.py b/home/__init__.py index 44c9042d85..36dbacfa80 100644 --- a/home/__init__.py +++ b/home/__init__.py @@ -91,8 +91,11 @@ def update_feed1(doc): subject = subject % doc.fields make_feed(doc, subject, color) -def update_feed(doc): +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 From 22f7edda940cbe53818e7cc5b9623352933ed13b Mon Sep 17 00:00:00 2001 From: nabinhait Date: Wed, 6 Jul 2011 12:45:02 +0530 Subject: [PATCH 5/6] double feed deleted --- patches/patch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index a535e4f619..ac0ea8cc37 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 313 +last_patch = 314 #------------------------------------------- @@ -1255,3 +1255,7 @@ def execute(patch_no): 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 %'") From eb3154025951af0e401b6b6bf6ec00b564a3d507 Mon Sep 17 00:00:00 2001 From: nabinhait Date: Wed, 6 Jul 2011 13:03:31 +0530 Subject: [PATCH 6/6] role added in module home --- patches/patch.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index ac0ea8cc37..8c839e13d0 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 314 +last_patch = 315 #------------------------------------------- @@ -1259,3 +1259,15 @@ def execute(patch_no): 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)