mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 11:39:18 +00:00
more fixes to perms, floats and default enabled / disabled in search
This commit is contained in:
16
patches/december_2012/enable_currencies.py
Normal file
16
patches/december_2012/enable_currencies.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
# get all currencies
|
||||
webnotes.reload_doc("setup", "doctype", "currency")
|
||||
clist = [webnotes.conn.get_default("currency")]
|
||||
for f in webnotes.conn.sql("""select parent, fieldname from tabDocField
|
||||
where options in ('Currency', 'link:Currency')""", as_dict=1):
|
||||
if not webnotes.conn.get_value("DocType", f.parent, "issingle"):
|
||||
clist += [c[0] for c in webnotes.conn.sql("""select distinct `%s`
|
||||
from `tab%s`""" % (f.fieldname, f.parent))]
|
||||
|
||||
clist = list(set(clist))
|
||||
for c in clist:
|
||||
if c:
|
||||
webnotes.conn.sql("""update tabCurrency set `enabled`=1 where name=%s""", c)
|
||||
@@ -155,4 +155,5 @@ patch_list = [
|
||||
"patches.january_2013.purchase_price_list",
|
||||
"execute:webnotes.reload_doc('accounts','Print Format','Payment Receipt Voucher')",
|
||||
"patches.january_2013.update_fraction_for_usd",
|
||||
"patches.january_2013.enable_currencies",
|
||||
]
|
||||
Reference in New Issue
Block a user