mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Allow editing of extra line items in order table (#3888)
* Allow editing of extra line items in order table * Allow addition of extra line items even if order is not "pending" * Allow addition and editing of extra line items for sales orders * javascript linting
This commit is contained in:
		| @@ -48,7 +48,7 @@ | |||||||
|             <h4>{% trans "Extra Lines" %}</h4> |             <h4>{% trans "Extra Lines" %}</h4> | ||||||
|             {% include "spacer.html" %} |             {% include "spacer.html" %} | ||||||
|             <div class='btn-group' role='group'> |             <div class='btn-group' role='group'> | ||||||
|                 {% if roles.purchase_order.change and order.status == PurchaseOrderStatus.PENDING %} |                 {% if roles.purchase_order.change  %} | ||||||
|                 <button type='button' class='btn btn-success' id='new-po-extra-line'> |                 <button type='button' class='btn btn-success' id='new-po-extra-line'> | ||||||
|                     <span class='fas fa-plus-circle'></span> {% trans "Add Extra Line" %} |                     <span class='fas fa-plus-circle'></span> {% trans "Add Extra Line" %} | ||||||
|                 </button> |                 </button> | ||||||
|   | |||||||
| @@ -42,7 +42,7 @@ | |||||||
|             <h4>{% trans "Extra Lines" %}</h4> |             <h4>{% trans "Extra Lines" %}</h4> | ||||||
|             {% include "spacer.html" %} |             {% include "spacer.html" %} | ||||||
|             <div class='btn-group' role='group'> |             <div class='btn-group' role='group'> | ||||||
|                 {% if roles.sales_order.change and order.is_pending %} |                 {% if roles.sales_order.change %} | ||||||
|                 <button type='button' class='btn btn-success' id='new-so-extra-line'> |                 <button type='button' class='btn btn-success' id='new-so-extra-line'> | ||||||
|                     <span class='fas fa-plus-circle'></span> {% trans "Add Extra Line" %} |                     <span class='fas fa-plus-circle'></span> {% trans "Add Extra Line" %} | ||||||
|                 </button> |                 </button> | ||||||
|   | |||||||
| @@ -2473,9 +2473,6 @@ function loadPurchaseOrderExtraLineTable(table, options={}) { | |||||||
|  |  | ||||||
|     setupFilterList('purchaseorderextraline', $(table), filter_target); |     setupFilterList('purchaseorderextraline', $(table), filter_target); | ||||||
|  |  | ||||||
|     // Is the order pending? |  | ||||||
|     var pending = options.status == {{ SalesOrderStatus.PENDING }}; |  | ||||||
|  |  | ||||||
|     // Table columns to display |     // Table columns to display | ||||||
|     var columns = [ |     var columns = [ | ||||||
|         { |         { | ||||||
| @@ -2555,7 +2552,6 @@ function loadPurchaseOrderExtraLineTable(table, options={}) { | |||||||
|         title: '{% trans "Notes" %}', |         title: '{% trans "Notes" %}', | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     if (pending) { |  | ||||||
|     columns.push({ |     columns.push({ | ||||||
|         field: 'buttons', |         field: 'buttons', | ||||||
|         switchable: false, |         switchable: false, | ||||||
| @@ -2574,7 +2570,6 @@ function loadPurchaseOrderExtraLineTable(table, options={}) { | |||||||
|             return html; |             return html; | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
|     } |  | ||||||
|  |  | ||||||
|     function reloadTable() { |     function reloadTable() { | ||||||
|         $(table).bootstrapTable('refresh'); |         $(table).bootstrapTable('refresh'); | ||||||
| @@ -4320,9 +4315,6 @@ function loadSalesOrderExtraLineTable(table, options={}) { | |||||||
|  |  | ||||||
|     setupFilterList('salesorderextraline', $(table), filter_target); |     setupFilterList('salesorderextraline', $(table), filter_target); | ||||||
|  |  | ||||||
|     // Is the order pending? |  | ||||||
|     var pending = options.status == {{ SalesOrderStatus.PENDING }}; |  | ||||||
|  |  | ||||||
|     // Table columns to display |     // Table columns to display | ||||||
|     var columns = [ |     var columns = [ | ||||||
|         { |         { | ||||||
| @@ -4402,7 +4394,6 @@ function loadSalesOrderExtraLineTable(table, options={}) { | |||||||
|         title: '{% trans "Notes" %}', |         title: '{% trans "Notes" %}', | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     if (pending) { |  | ||||||
|     columns.push({ |     columns.push({ | ||||||
|         field: 'buttons', |         field: 'buttons', | ||||||
|         switchable: false, |         switchable: false, | ||||||
| @@ -4421,7 +4412,6 @@ function loadSalesOrderExtraLineTable(table, options={}) { | |||||||
|             return html; |             return html; | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
|     } |  | ||||||
|  |  | ||||||
|     function reloadTable() { |     function reloadTable() { | ||||||
|         $(table).bootstrapTable('refresh'); |         $(table).bootstrapTable('refresh'); | ||||||
|   | |||||||
| @@ -15,4 +15,4 @@ INVENTREE_DB_USER=pguser | |||||||
| INVENTREE_DB_PASSWORD=pgpassword | INVENTREE_DB_PASSWORD=pgpassword | ||||||
|  |  | ||||||
| # Enable plugins? | # Enable plugins? | ||||||
| INVENTREE_PLUGINS_ENABLED=True | INVENTREE_PLUGINS_ENABLED=False | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user