[merge] merged with master

This commit is contained in:
Nabin Hait
2013-10-24 11:21:11 +05:30
61 changed files with 974 additions and 705 deletions

View File

@@ -4,5 +4,7 @@
import webnotes
def execute():
webnotes.delete_doc("DocType", "Sales and Purchase Return Item")
webnotes.delete_doc("DocType", "Sales and Purchase Return Tool")
if webnotes.conn.exists("DocType", "Sales and Purchase Return Item"):
webnotes.delete_doc("DocType", "Sales and Purchase Return Item")
if webnotes.conn.exists("DocType", "Sales and Purchase Return Tool"):
webnotes.delete_doc("DocType", "Sales and Purchase Return Tool")

View File

@@ -11,6 +11,7 @@ def execute():
and docstatus=2""" % (entry['voucher_type'], "%s"), entry['voucher_no'])
is_cancelled = docstatus and 'Yes' or None
if is_cancelled:
print entry['voucher_type'], entry['voucher_no']
webnotes.conn.sql("""update `tabGL Entry` set is_cancelled = 'Yes'
where voucher_type = %s and voucher_no = %s""",
(entry['voucher_type'], entry['voucher_no']))

View File

@@ -0,0 +1,20 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
def execute():
webnotes.reload_doc("setup", "doctype", "item_price")
webnotes.conn.sql("""update `tabItem Price` ip, `tabItem` i
set ip.item_name=i.item_name, ip.item_description=i.description
where ip.item_code=i.name""")
webnotes.conn.sql("""update `tabItem Price` ip, `tabPrice List` pl
set ip.price_list=pl.name, ip.currency=pl.currency,
ip.buying_or_selling=pl.buying_or_selling
where ip.parent=pl.name""")
webnotes.conn.sql("""update `tabItem Price`
set parent=null, parenttype=null, parentfield=null, idx=null""")

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
def execute():
from patches.march_2013 import p06_remove_sales_purchase_return_tool
p06_remove_sales_purchase_return_tool.execute()

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
webnotes.conn.sql("""update tabDocPerm set `create`=1 where
parent='Report'
and role in ('Administrator', 'Report Manager', 'System Manager')""")

View File

@@ -0,0 +1,16 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
def execute():
import webnotes
entries = webnotes.conn.sql("""select voucher_type, voucher_no
from `tabGL Entry` group by voucher_type, voucher_no""", as_dict=1)
for entry in entries:
try:
cancelled_voucher = webnotes.conn.sql("""select name from `tab%s` where name = %s
and docstatus=2""" % (entry['voucher_type'], "%s"), entry['voucher_no'])
if cancelled_voucher:
webnotes.conn.sql("""delete from `tabGL Entry` where voucher_type = %s and
voucher_no = %s""", (entry['voucher_type'], entry['voucher_no']))
except:
pass

View File

@@ -229,4 +229,9 @@ patch_list = [
"patches.october_2013.p06_rename_packing_list_doctype",
"execute:webnotes.delete_doc('DocType', 'Sales Common')",
"patches.october_2013.p09_update_naming_series_settings",
"patches.october_2013.p02_update_price_list_and_item_details_in_item_price",
"execute:webnotes.delete_doc('Report', 'Item-wise Price List')",
"patches.october_2013.p03_remove_sales_and_purchase_return_tool",
"patches.october_2013.p04_update_report_permission",
"patches.october_2013.p05_delete_gl_entries_for_cancelled_vouchers",
]