mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
[minor] [patch] fixed old patch
This commit is contained in:
@@ -3,11 +3,13 @@
|
|||||||
|
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import cint
|
from webnotes.utils import cint
|
||||||
|
import MySQLdb
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
webnotes.reload_doc("setup", "doctype", "price_list")
|
webnotes.reload_doc("setup", "doctype", "price_list")
|
||||||
webnotes.reload_doc("stock", "doctype", "item_price")
|
webnotes.reload_doc("stock", "doctype", "item_price")
|
||||||
|
|
||||||
|
try:
|
||||||
for price_list in webnotes.conn.sql_list("""select name from `tabPrice List`"""):
|
for price_list in webnotes.conn.sql_list("""select name from `tabPrice List`"""):
|
||||||
buying, selling = False, False
|
buying, selling = False, False
|
||||||
for b, s in webnotes.conn.sql("""select distinct buying, selling
|
for b, s in webnotes.conn.sql("""select distinct buying, selling
|
||||||
@@ -19,3 +21,6 @@ def execute():
|
|||||||
webnotes.conn.set_value("Price List", price_list, "buying_or_selling", buying_or_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
|
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling=%s
|
||||||
where price_list_name=%s""", (buying_or_selling, price_list))
|
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" """)
|
||||||
|
|||||||
Reference in New Issue
Block a user