mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
resoved conflict in patch, company and renaming tools
This commit is contained in:
@@ -72,6 +72,7 @@ cur_frm.fields_dict['master_name'].get_query=function(doc){
|
||||
else alert("Please select master type");
|
||||
}
|
||||
|
||||
/*
|
||||
// Get customer/supplier address
|
||||
// -----------------------------------------
|
||||
cur_frm.cscript.master_name = function(doc,cdt,cdn){
|
||||
@@ -79,6 +80,7 @@ cur_frm.cscript.master_name = function(doc,cdt,cdn){
|
||||
get_server_fields('get_address','','',doc,cdt,cdn);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// parent account get query
|
||||
// -----------------------------------------
|
||||
|
||||
@@ -260,3 +260,16 @@ class DocType:
|
||||
def on_restore(self):
|
||||
# rebuild tree
|
||||
self.update_nsm_model()
|
||||
|
||||
# on rename
|
||||
# ---------
|
||||
def on_rename(self,newdn,olddn):
|
||||
company_abbr = sql("select tc.abbr from `tabAccount` ta, `tabCompany` tc where ta.company = tc.name and ta.name=%s", olddn)[0][0]
|
||||
|
||||
newdnchk = newdn.split(" - ")
|
||||
|
||||
if newdnchk[-1].lower() != company_abbr.lower():
|
||||
msgprint("Please add company abbreviation <b>%s</b>" %(company_abbr), raise_exception=1)
|
||||
else:
|
||||
account_name = " - ".join(newdnchk[:-1])
|
||||
sql("update `tabAccount` set account_name = '%s' where name = '%s'" %(account_name,olddn))
|
||||
|
||||
Reference in New Issue
Block a user