[fixes] buying/selling price lists, communication and website settings

This commit is contained in:
Anand Doshi
2013-06-12 17:40:36 +05:30
parent 9c901e75cd
commit 060d9248d3
23 changed files with 162 additions and 67 deletions

View File

@@ -0,0 +1,14 @@
import webnotes
from webnotes.utils import cint
def execute():
for price_list in webnotes.conn.sql_list("""select name from `tabPrice List`"""):
buying, selling = False, False
for b, s in webnotes.conn.sql("""select distinct buying, selling
from `tabItem Price` where price_list_name=%s""", price_list):
buying = buying or cint(b)
selling = selling or cint(s)
webnotes.conn.set_value("Price List", price_list, "buying_or_selling", ("Selling" if selling else "Buying"))
webnotes.conn.sql("""update `tabItem Price` set buying_or_selling=%s where price_list_name=%s""",
(("Selling" if selling else "Buying"), price_list))