[price list] [fix] fix in buying selling price list patch
This commit is contained in:
parent
060d9248d3
commit
a2e2d4bd19
@ -2,6 +2,9 @@ import webnotes
|
|||||||
from webnotes.utils import cint
|
from webnotes.utils import cint
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
webnotes.reload_doc("setup", "doctype", "price_list")
|
||||||
|
webnotes.reload_doc("stock", "doctype", "item_price")
|
||||||
|
|
||||||
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
|
||||||
@ -9,6 +12,7 @@ def execute():
|
|||||||
buying = buying or cint(b)
|
buying = buying or cint(b)
|
||||||
selling = selling or cint(s)
|
selling = selling or cint(s)
|
||||||
|
|
||||||
webnotes.conn.set_value("Price List", price_list, "buying_or_selling", ("Selling" if selling else "Buying"))
|
buying_or_selling = "Selling" if selling else "Buying"
|
||||||
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling=%s where price_list_name=%s""",
|
webnotes.conn.set_value("Price List", price_list, "buying_or_selling", buying_or_selling)
|
||||||
(("Selling" if selling else "Buying"), price_list))
|
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling=%s
|
||||||
|
where price_list_name=%s""", (buying_or_selling, price_list))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user