mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	* Implement a generic API endpoint for enumeration of status codes * Adds endpoint for PurchaseOrderStatus * Add more endpoints (sales order / return orer) * Add endpoints for StockStatus and StockTrackingCode * Support build status * Use the attribute name as the dict key * Refactored status codes in javascript - Now accessible by "name" (instead of integer key) - Will make javascript code much more readable * Bump API version
		
			
				
	
	
		
			24 lines
		
	
	
		
			595 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			595 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| {% load report %}
 | |
| 
 | |
| /*
 | |
|  * Status codes for the {{ label }} model.
 | |
|  * Generated from the values specified in "status_codes.py"
 | |
|  */
 | |
| const {{ label }}Codes = {
 | |
|     {% for entry in data %}
 | |
|     '{{ entry.name }}': {
 | |
|         key: {{ entry.key }},
 | |
|         value: '{{ entry.label }}',{% if entry.color %}
 | |
|         label: 'bg-{{ entry.color }}',{% endif %}
 | |
|     },
 | |
|     {% endfor %}
 | |
| };
 | |
| 
 | |
| /*
 | |
|  * Render the status for a {{ label }} object.
 | |
|  * Uses the values specified in "status_codes.py"
 | |
|  */
 | |
| function {{ label }}StatusDisplay(key, options={}) {
 | |
|     return renderStatusLabel(key, {{ label }}Codes, options);
 | |
| }
 |