* feat: Add default energy point rules during install * fix: Add completed_by field to task doctype * fix: Rule data * fix: Add default rules for opportunity * fix: Add a patch to create default energy point rules * fix: Default success action message * fix: Use .items() instead of .iteritems() * fix: Add "create_default_energy_points" patch entry * fix: Reload Energy Point Rule to fix patch * fix: Import frappe
		
			
				
	
	
		
			28 lines
		
	
	
		
			625 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			625 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from __future__ import unicode_literals
 | |
| from frappe import _
 | |
| 
 | |
| doctype_list = [
 | |
| 	'Purchase Receipt',
 | |
| 	'Purchase Invoice',
 | |
| 	'Quotation',
 | |
| 	'Sales Order',
 | |
| 	'Delivery Note',
 | |
| 	'Sales Invoice'
 | |
| ]
 | |
| 
 | |
| def get_message(doctype):
 | |
| 	return _("{0} has been submitted successfully").format(_(doctype))
 | |
| 
 | |
| def get_first_success_message(doctype):
 | |
| 	return get_message(doctype)
 | |
| 
 | |
| def get_default_success_action():
 | |
| 	return [{
 | |
| 		'doctype': 'Success Action',
 | |
| 		'ref_doctype': doctype,
 | |
| 		'message': get_message(doctype),
 | |
| 		'first_success_message': get_first_success_message(doctype),
 | |
| 		'next_actions': 'new\nprint\nemail'
 | |
| 	} for doctype in doctype_list]
 | |
| 
 |