mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Fix supplier-part-table for Part view
This commit is contained in:
		@@ -66,58 +66,18 @@
 | 
				
			|||||||
        });
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $("#supplier-table").inventreeTable({
 | 
					    loadSupplierPartTable(
 | 
				
			||||||
        formatNoMatches: function() { return "No supplier parts available for {{ part.full_name }}"; },
 | 
					        "#supplier-table",
 | 
				
			||||||
        queryParams: function(p) {
 | 
					        "{% url 'api-supplier-part-list' %}",
 | 
				
			||||||
            return {
 | 
					 | 
				
			||||||
                part: {{ part.id }}
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        columns: [
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
                checkbox: true,
 | 
					            params: {
 | 
				
			||||||
            },
 | 
					                part: {{ part.id }},
 | 
				
			||||||
            {
 | 
					                part_detail: true,
 | 
				
			||||||
                sortable: true,
 | 
					                supplier_detail: true,
 | 
				
			||||||
                field: 'supplier_name',
 | 
					                manufacturer_detail: true,
 | 
				
			||||||
                title: 'Supplier',
 | 
					 | 
				
			||||||
                formatter: function(value, row, index, field) {
 | 
					 | 
				
			||||||
                    return imageHoverIcon(row.supplier_logo) + renderLink(value, '/company/' + row.supplier + '/');
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                sortable: true,
 | 
					 | 
				
			||||||
                field: 'SKU',
 | 
					 | 
				
			||||||
                title: 'SKU',
 | 
					 | 
				
			||||||
                formatter: function(value, row, index, field) {
 | 
					 | 
				
			||||||
                    return renderLink(value, row.url);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                sortable: true,
 | 
					 | 
				
			||||||
                field: 'manufacturer',
 | 
					 | 
				
			||||||
                title: 'Manufacturer',
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                sortable: true,
 | 
					 | 
				
			||||||
                field: 'MPN',
 | 
					 | 
				
			||||||
                title: 'MPN',
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                sortable: true,
 | 
					 | 
				
			||||||
                field: 'pricing',
 | 
					 | 
				
			||||||
                title: 'Price',
 | 
					 | 
				
			||||||
                formatter: function(value, row, index, field) {
 | 
					 | 
				
			||||||
                    if (value) {
 | 
					 | 
				
			||||||
                        return value;
 | 
					 | 
				
			||||||
                    } else {
 | 
					 | 
				
			||||||
                        return "<span class='warning-msg'><i>No pricing available</i></span>";
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        ],
 | 
					    );
 | 
				
			||||||
        url: "{% url 'api-part-supplier-list' %}"
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    linkButtonsToSelection($("#supplier-table"), ['#supplier-part-options'])
 | 
					    linkButtonsToSelection($("#supplier-table"), ['#supplier-part-options'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user