Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
		
						commit
						5f2bc144e4
					
				| @ -2,7 +2,7 @@ | |||||||
|  { |  { | ||||||
|   "creation": "2013-04-10 11:45:37",  |   "creation": "2013-04-10 11:45:37",  | ||||||
|   "docstatus": 0,  |   "docstatus": 0,  | ||||||
|   "modified": "2013-09-26 16:30:36",  |   "modified": "2013-10-09 15:27:54",  | ||||||
|   "modified_by": "Administrator",  |   "modified_by": "Administrator",  | ||||||
|   "owner": "Administrator" |   "owner": "Administrator" | ||||||
|  },  |  },  | ||||||
| @ -174,19 +174,6 @@ | |||||||
|   "options": "Profile",  |   "options": "Profile",  | ||||||
|   "search_index": 1 |   "search_index": 1 | ||||||
|  },  |  },  | ||||||
|  { |  | ||||||
|   "depends_on": "eval:!doc.__islocal",  |  | ||||||
|   "description": "Date on which the lead was last contacted",  |  | ||||||
|   "doctype": "DocField",  |  | ||||||
|   "fieldname": "last_contact_date",  |  | ||||||
|   "fieldtype": "Date",  |  | ||||||
|   "label": "Last Contact Date",  |  | ||||||
|   "no_copy": 1,  |  | ||||||
|   "oldfieldname": "last_contact_date",  |  | ||||||
|   "oldfieldtype": "Date",  |  | ||||||
|   "print_hide": 1,  |  | ||||||
|   "read_only": 1 |  | ||||||
|  },  |  | ||||||
|  { |  { | ||||||
|   "doctype": "DocField",  |   "doctype": "DocField",  | ||||||
|   "fieldname": "col_break123",  |   "fieldname": "col_break123",  | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ | |||||||
| from __future__ import unicode_literals | from __future__ import unicode_literals | ||||||
| import webnotes | import webnotes | ||||||
| 
 | 
 | ||||||
| from webnotes.utils import cstr, getdate, cint | from webnotes.utils import cstr, cint | ||||||
| from webnotes.model.bean import getlist | from webnotes.model.bean import getlist | ||||||
| from webnotes import msgprint | from webnotes import msgprint | ||||||
| 
 | 
 | ||||||
| @ -70,10 +70,6 @@ class DocType(TransactionBase): | |||||||
| 		return ret | 		return ret | ||||||
| 		 | 		 | ||||||
| 	def on_update(self): | 	def on_update(self): | ||||||
| 		# Add to calendar |  | ||||||
| 		if self.doc.contact_date and self.doc.contact_date_ref != self.doc.contact_date: |  | ||||||
| 			webnotes.conn.set(self.doc, 'contact_date_ref',self.doc.contact_date) |  | ||||||
| 
 |  | ||||||
| 		self.add_calendar_event() | 		self.add_calendar_event() | ||||||
| 
 | 
 | ||||||
| 	def add_calendar_event(self, opts=None, force=False): | 	def add_calendar_event(self, opts=None, force=False): | ||||||
| @ -101,14 +97,6 @@ class DocType(TransactionBase): | |||||||
| 		 | 		 | ||||||
| 		super(DocType, self).add_calendar_event(opts, force) | 		super(DocType, self).add_calendar_event(opts, force) | ||||||
| 
 | 
 | ||||||
| 	def set_last_contact_date(self): |  | ||||||
| 		if self.doc.contact_date_ref and self.doc.contact_date_ref != self.doc.contact_date: |  | ||||||
| 			if getdate(self.doc.contact_date_ref) < getdate(self.doc.contact_date): |  | ||||||
| 				self.doc.last_contact_date=self.doc.contact_date_ref |  | ||||||
| 			else: |  | ||||||
| 				msgprint("Contact Date Cannot be before Last Contact Date") |  | ||||||
| 				raise Exception |  | ||||||
| 
 |  | ||||||
| 	def validate_item_details(self): | 	def validate_item_details(self): | ||||||
| 		if not getlist(self.doclist, 'enquiry_details'): | 		if not getlist(self.doclist, 'enquiry_details'): | ||||||
| 			msgprint("Please select items for which enquiry needs to be made") | 			msgprint("Please select items for which enquiry needs to be made") | ||||||
| @ -121,7 +109,6 @@ class DocType(TransactionBase): | |||||||
| 			msgprint("Customer is mandatory if 'Opportunity From' is selected as Customer", raise_exception=1) | 			msgprint("Customer is mandatory if 'Opportunity From' is selected as Customer", raise_exception=1) | ||||||
| 
 | 
 | ||||||
| 	def validate(self): | 	def validate(self): | ||||||
| 		self.set_last_contact_date() |  | ||||||
| 		self.validate_item_details() | 		self.validate_item_details() | ||||||
| 		self.validate_uom_is_integer("uom", "qty") | 		self.validate_uom_is_integer("uom", "qty") | ||||||
| 		self.validate_lead_cust() | 		self.validate_lead_cust() | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ | |||||||
|  { |  { | ||||||
|   "creation": "2013-03-07 18:50:30",  |   "creation": "2013-03-07 18:50:30",  | ||||||
|   "docstatus": 0,  |   "docstatus": 0,  | ||||||
|   "modified": "2013-09-25 19:32:29",  |   "modified": "2013-10-09 15:26:29",  | ||||||
|   "modified_by": "Administrator",  |   "modified_by": "Administrator",  | ||||||
|   "owner": "Administrator" |   "owner": "Administrator" | ||||||
|  },  |  },  | ||||||
| @ -408,20 +408,6 @@ | |||||||
|   "oldfieldtype": "Date",  |   "oldfieldtype": "Date",  | ||||||
|   "read_only": 0 |   "read_only": 0 | ||||||
|  },  |  },  | ||||||
|  { |  | ||||||
|   "allow_on_submit": 0,  |  | ||||||
|   "depends_on": "eval:!doc.__islocal",  |  | ||||||
|   "description": "Date on which the lead was last contacted",  |  | ||||||
|   "doctype": "DocField",  |  | ||||||
|   "fieldname": "last_contact_date",  |  | ||||||
|   "fieldtype": "Date",  |  | ||||||
|   "label": "Last Contact Date",  |  | ||||||
|   "no_copy": 1,  |  | ||||||
|   "oldfieldname": "last_contact_date",  |  | ||||||
|   "oldfieldtype": "Date",  |  | ||||||
|   "print_hide": 1,  |  | ||||||
|   "read_only": 1 |  | ||||||
|  },  |  | ||||||
|  { |  { | ||||||
|   "doctype": "DocField",  |   "doctype": "DocField",  | ||||||
|   "fieldname": "to_discuss",  |   "fieldname": "to_discuss",  | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ | |||||||
| from __future__ import unicode_literals | from __future__ import unicode_literals | ||||||
| import webnotes | import webnotes | ||||||
| 
 | 
 | ||||||
| from webnotes.utils import cstr, getdate | from webnotes.utils import cstr | ||||||
| from webnotes.model.bean import getlist | from webnotes.model.bean import getlist | ||||||
| from webnotes.model.code import get_obj | from webnotes.model.code import get_obj | ||||||
| from webnotes import _, msgprint | from webnotes import _, msgprint | ||||||
| @ -93,19 +93,6 @@ class DocType(SellingController): | |||||||
| 					msgprint("You can not select non sales item "+d.item_code+" in Sales Quotation") | 					msgprint("You can not select non sales item "+d.item_code+" in Sales Quotation") | ||||||
| 					raise Exception | 					raise Exception | ||||||
| 	 | 	 | ||||||
| 	#--------------Validation For Last Contact Date----------------- |  | ||||||
| 	# ==================================================================================================================== |  | ||||||
| 	def set_last_contact_date(self): |  | ||||||
| 		#if not self.doc.contact_date_ref: |  | ||||||
| 			#self.doc.contact_date_ref=self.doc.contact_date |  | ||||||
| 			#self.doc.last_contact_date=self.doc.contact_date_ref |  | ||||||
| 		if self.doc.contact_date_ref and self.doc.contact_date_ref != self.doc.contact_date: |  | ||||||
| 			if getdate(self.doc.contact_date_ref) < getdate(self.doc.contact_date): |  | ||||||
| 				self.doc.last_contact_date=self.doc.contact_date_ref |  | ||||||
| 			else: |  | ||||||
| 				msgprint("Contact Date Cannot be before Last Contact Date") |  | ||||||
| 				raise Exception |  | ||||||
| 
 |  | ||||||
| 	def validate(self): | 	def validate(self): | ||||||
| 		super(DocType, self).validate() | 		super(DocType, self).validate() | ||||||
| 		 | 		 | ||||||
| @ -116,7 +103,6 @@ class DocType(SellingController): | |||||||
| 			utilities.validate_status(self.doc.status, ["Draft", "Submitted",  | 			utilities.validate_status(self.doc.status, ["Draft", "Submitted",  | ||||||
| 				"Order Confirmed", "Order Lost", "Cancelled"]) | 				"Order Confirmed", "Order Lost", "Cancelled"]) | ||||||
| 
 | 
 | ||||||
| 		self.set_last_contact_date() |  | ||||||
| 		self.validate_order_type() | 		self.validate_order_type() | ||||||
| 		self.validate_for_items() | 		self.validate_for_items() | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user