mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Only include "in stocK" field if the sales order is pending
This commit is contained in:
		@@ -1455,6 +1455,10 @@ function loadSalesOrderLineItemTable(table, options={}) {
 | 
				
			|||||||
                return formatter.format(total);
 | 
					                return formatter.format(total);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					    ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (pending) {
 | 
				
			||||||
 | 
					        columns.push(
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                field: 'stock',
 | 
					                field: 'stock',
 | 
				
			||||||
                title: '{% trans "In Stock" %}',
 | 
					                title: '{% trans "In Stock" %}',
 | 
				
			||||||
@@ -1462,6 +1466,10 @@ function loadSalesOrderLineItemTable(table, options={}) {
 | 
				
			|||||||
                    return row.part_detail.stock;
 | 
					                    return row.part_detail.stock;
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    columns.push(
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            field: 'allocated',
 | 
					            field: 'allocated',
 | 
				
			||||||
            title: pending ? '{% trans "Allocated" %}' : '{% trans "Fulfilled" %}',
 | 
					            title: pending ? '{% trans "Allocated" %}' : '{% trans "Fulfilled" %}',
 | 
				
			||||||
@@ -1492,6 +1500,8 @@ function loadSalesOrderLineItemTable(table, options={}) {
 | 
				
			|||||||
            field: 'notes',
 | 
					            field: 'notes',
 | 
				
			||||||
            title: '{% trans "Notes" %}',
 | 
					            title: '{% trans "Notes" %}',
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // TODO: Re-introduce the "PO" field, once it is fixed
 | 
					    // TODO: Re-introduce the "PO" field, once it is fixed
 | 
				
			||||||
        /*
 | 
					        /*
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -1514,7 +1524,6 @@ function loadSalesOrderLineItemTable(table, options={}) {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        */
 | 
					        */
 | 
				
			||||||
    ];
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (pending) {
 | 
					    if (pending) {
 | 
				
			||||||
        columns.push({
 | 
					        columns.push({
 | 
				
			||||||
@@ -1553,9 +1562,6 @@ function loadSalesOrderLineItemTable(table, options={}) {
 | 
				
			|||||||
                return html;
 | 
					                return html;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
        // Remove the "in stock" column
 | 
					 | 
				
			||||||
        delete columns['stock'];
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function reloadTable() {
 | 
					    function reloadTable() {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user