mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 16:45:02 +00:00
[fix] [minor] price list patch
This commit is contained in:
@@ -7,11 +7,13 @@ import webnotes
|
||||
def execute():
|
||||
webnotes.reload_doc("setup", "doctype", "price_list")
|
||||
webnotes.reload_doc("setup", "doctype", "item_price")
|
||||
webnotes.reload_doc("stock", "doctype", "item")
|
||||
|
||||
webnotes.conn.sql("""update `tabItem Price` set parenttype='Price List',
|
||||
parentfield='item_prices', item_code=parent""")
|
||||
|
||||
parentfield='item_prices', `item_code`=`parent`""")
|
||||
|
||||
# re-arranging idx of items
|
||||
webnotes.conn.sql("""update `tabItem Price` set parent=price_list, idx=0""")
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user