remove euro currency patch, address / contact supplier/customer can now contain slashes in their name
This commit is contained in:
parent
e316795196
commit
4792f51e2a
16
erpnext/patches/may_2012/remove_euro_currency.py
Normal file
16
erpnext/patches/may_2012/remove_euro_currency.py
Normal file
@ -0,0 +1,16 @@
|
||||
def execute():
|
||||
"""
|
||||
* Replace EURO with EUR
|
||||
* Delete EURO from tabCurrency
|
||||
"""
|
||||
import webnotes
|
||||
tables = webnotes.conn.sql("show tables")
|
||||
for (tab,) in tables:
|
||||
desc = webnotes.conn.sql("desc `%s`" % tab, as_dict=1)
|
||||
for d in desc:
|
||||
if "currency" in d.get('Field'):
|
||||
field = d.get('Field')
|
||||
webnotes.conn.sql("""\
|
||||
update `%s` set `%s`='EUR'
|
||||
where `%s`='EURO'""" % (tab, field, field))
|
||||
webnotes.conn.sql("delete from `tabCurrency` where name='EURO'")
|
@ -402,4 +402,9 @@ patch_list = [
|
||||
'patch_file': 'profile_perm_patch',
|
||||
'description': 'Make profile readonly for role All'
|
||||
},
|
||||
{
|
||||
'patch_module': 'patches.may_2012',
|
||||
'patch_file': 'remove_euro_currency',
|
||||
'description': 'Remove EURO currency and replace with EUR'
|
||||
},
|
||||
]
|
@ -20,17 +20,17 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
var route = wn.get_route();
|
||||
if(route[1]=='Supplier') {
|
||||
var supplier = locals.Supplier[route[2]]
|
||||
var supplier = wn.container.page.frm.doc;
|
||||
doc.supplier = supplier.name;
|
||||
doc.supplier_name = supplier.supplier_name;
|
||||
doc.address_type = 'Office';
|
||||
} else if(route[1]=='Customer') {
|
||||
var customer = locals.Customer[route[2]]
|
||||
var customer = wn.container.page.frm.doc;
|
||||
doc.customer = customer.name;
|
||||
doc.customer_name = customer.customer_name;
|
||||
doc.address_type = 'Office';
|
||||
} else if(route[1]=='Sales Partner') {
|
||||
var sp = locals['Sales Partner'][route[2]];
|
||||
var sp = wn.container.page.frm.doc;
|
||||
doc.sales_partner = sp.name;
|
||||
doc.address_type = 'Office';
|
||||
}
|
||||
|
@ -21,18 +21,18 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
var route = wn.get_route();
|
||||
if(route[1]=='Supplier') {
|
||||
var supplier = locals.Supplier[route[2]]
|
||||
var supplier = wn.container.page.frm.doc;
|
||||
doc.supplier = supplier.name;
|
||||
doc.supplier_name = supplier.supplier_name;
|
||||
} else if(route[1]=='Customer') {
|
||||
var customer = locals.Customer[route[2]];
|
||||
var customer = wn.container.page.frm.doc;
|
||||
doc.customer = customer.name;
|
||||
doc.customer_name = customer.customer_name;
|
||||
if(customer.customer_type == 'Individual') {
|
||||
doc.first_name = customer.customer_name;
|
||||
}
|
||||
} else if(route[1]=='Sales Partner') {
|
||||
var sp = locals['Sales Partner'][route[2]];
|
||||
var sp = wn.container.page.frm.doc;
|
||||
doc.sales_partner = sp.name;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user