Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
		
						commit
						f377402592
					
				| @ -16,6 +16,7 @@ | |||||||
| 
 | 
 | ||||||
| from __future__ import unicode_literals | from __future__ import unicode_literals | ||||||
| import webnotes | import webnotes | ||||||
|  | from webnotes import _, msgprint | ||||||
| 
 | 
 | ||||||
| from webnotes.utils import cstr | from webnotes.utils import cstr | ||||||
| from webnotes.model.doc import Document | from webnotes.model.doc import Document | ||||||
| @ -288,6 +289,9 @@ class DocType: | |||||||
| 			and value=%s""", self.doc.name) | 			and value=%s""", self.doc.name) | ||||||
| 			 | 			 | ||||||
| 	def on_rename(self,newdn,olddn, merge=False): | 	def on_rename(self,newdn,olddn, merge=False): | ||||||
|  | 		if merge: | ||||||
|  | 			msgprint(_("Sorry. Companies cannot be merged"), raise_exception=True) | ||||||
|  | 		 | ||||||
| 		webnotes.conn.sql("""update `tabCompany` set company_name=%s | 		webnotes.conn.sql("""update `tabCompany` set company_name=%s | ||||||
| 			where name=%s""", (newdn, olddn)) | 			where name=%s""", (newdn, olddn)) | ||||||
| 		 | 		 | ||||||
|  | |||||||
| @ -19,7 +19,7 @@ import webnotes | |||||||
| 
 | 
 | ||||||
| from webnotes.utils import cint, getdate, nowdate | from webnotes.utils import cint, getdate, nowdate | ||||||
| import datetime | import datetime | ||||||
| from webnotes import msgprint | from webnotes import msgprint, _ | ||||||
| 	 | 	 | ||||||
| from controllers.stock_controller import StockController | from controllers.stock_controller import StockController | ||||||
| 
 | 
 | ||||||
| @ -119,6 +119,9 @@ class DocType(StockController): | |||||||
| 	 | 	 | ||||||
| 	def on_rename(self, new, old, merge=False): | 	def on_rename(self, new, old, merge=False): | ||||||
| 		"""rename serial_no text fields""" | 		"""rename serial_no text fields""" | ||||||
|  | 		if merge: | ||||||
|  | 			msgprint(_("Sorry. Serial Nos. cannot be merged"), raise_exception=True) | ||||||
|  | 		 | ||||||
| 		for dt in webnotes.conn.sql("""select parent from tabDocField  | 		for dt in webnotes.conn.sql("""select parent from tabDocField  | ||||||
| 			where fieldname='serial_no' and fieldtype='Text'"""): | 			where fieldname='serial_no' and fieldtype='Text'"""): | ||||||
| 			 | 			 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user