mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
[usability] item price moved to price list
This commit is contained in:
@@ -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])
|
||||
Reference in New Issue
Block a user