Merge branch 'akhileshdarjee-master' into website-wip

This commit is contained in:
Anand Doshi
2013-09-17 16:09:15 +05:30
45 changed files with 362 additions and 505 deletions

View File

@@ -1,12 +0,0 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
webnotes.reload_doc("stock", "doctype", "item_price")
# check for selling
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling = "Selling"
where ifnull(buying_or_selling, '')=''""")

View File

@@ -8,7 +8,7 @@ import MySQLdb
def execute():
webnotes.reload_doc("setup", "doctype", "price_list")
webnotes.reload_doc("stock", "doctype", "item_price")
webnotes.reload_doc("setup", "doctype", "item_price")
try:
for price_list in webnotes.conn.sql_list("""select name from `tabPrice List`"""):
@@ -20,10 +20,9 @@ def execute():
buying_or_selling = "Selling" if selling else "Buying"
webnotes.conn.set_value("Price List", price_list, "buying_or_selling", buying_or_selling)
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling=%s
where price_list_name=%s""", (buying_or_selling, price_list))
except MySQLdb.OperationalError, e:
if e.args[0] == 1054:
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling="Selling" """)
webnotes.conn.sql("""update `tabPrice List` set buying_or_selling='Selling'
where ifnull(buying_or_selling, '')='' """)
else:
raise e
raise e

View File

@@ -121,7 +121,6 @@ patch_list = [
"patches.january_2013.update_country_info",
"patches.january_2013.remove_tds_entry_from_gl_mapper",
"patches.january_2013.update_number_format",
"patches.january_2013.purchase_price_list",
"execute:webnotes.reload_doc('core', 'doctype', 'print_format') #2013-01",
"execute:webnotes.reload_doc('accounts','Print Format','Payment Receipt Voucher')",
"patches.january_2013.update_fraction_for_usd",
@@ -263,6 +262,7 @@ patch_list = [
"patches.september_2013.p01_update_communication",
"execute:webnotes.reload_doc('setup', 'doctype', 'features_setup') # 2013-09-05",
"patches.september_2013.p02_fix_serial_no_status",
"patches.september_2013.p03_modify_item_price_include_in_price_list",
"patches.september_2013.p03_update_stock_uom_in_sle",
"patches.september_2013.p03_move_website_to_framework",
]

View File

@@ -0,0 +1,18 @@
# 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", "price_list")
webnotes.reload_doc("setup", "doctype", "item_price")
webnotes.conn.sql("""update `tabItem Price` set parenttype='Price List',
parentfield='item_prices', item_code=parent""")
# re-arranging idx of items
webnotes.conn.sql("""update `tabItem Price` set parent=price_list, idx=0""")
for pl in webnotes.conn.sql("""select name from `tabPrice List`"""):
webnotes.conn.sql("""set @name=0""")
webnotes.conn.sql("""update `tabItem Price` set idx = @name := IF(ISNULL( @name ), 0, @name + 1)
where idx=0 and parent=%s""", pl[0])