mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 13:49:13 +00:00
[patch] [minor] set price list currency, where only one currency is used for item price
This commit is contained in:
9
patches/july_2013/p11_update_price_list_currency.py
Normal file
9
patches/july_2013/p11_update_price_list_currency.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
for price_list_name in webnotes.conn.sql_list("""select name from `tabPrice List`
|
||||
where ifnull(currency, '')=''"""):
|
||||
res = webnotes.conn.sql("""select distinct ref_currency from `tabItem Price`
|
||||
where price_list_name=%s""", price_list_name)
|
||||
if res and len(res)==1 and res[0][0]:
|
||||
webnotes.conn.set_value("Price List", price_list_name, "currency", res[0][0])
|
||||
Reference in New Issue
Block a user