[usability] item price moved to price list

This commit is contained in:
Akhilesh Darjee
2013-09-11 13:05:24 +05:30
parent 881a47f5c7
commit db59ffb76d
32 changed files with 129 additions and 289 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

@@ -6,7 +6,7 @@ from webnotes.utils import cint
def execute():
webnotes.reload_doc("setup", "doctype", "price_list")
webnotes.reload_doc("stock", "doctype", "item_price")
webnotes.reload_doc("setup", "doctype", "item_price")
for price_list in webnotes.conn.sql_list("""select name from `tabPrice List`"""):
buying, selling = False, False
@@ -15,7 +15,5 @@ def execute():
buying = buying or cint(b)
selling = selling or cint(s)
buying_or_selling = "Selling" if selling else "Buying"
buying_or_selling = "Buying" if buying else "Selling"
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))

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,4 +262,5 @@ 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",
]

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])