2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 05:46:34 +00:00

Only connect ManufacturerPart if a. it exists b. SupplierPart is not yet connected

This commit is contained in:
eeintech
2021-08-11 17:08:46 -04:00
parent a2590f1a3b
commit 91e314ddb5
3 changed files with 26 additions and 49 deletions

View File

@ -744,12 +744,12 @@ function loadSupplierPartTable(table, url, options) {
visible: params['manufacturer_detail'],
switchable: params['manufacturer_detail'],
sortable: true,
field: 'manufacturer',
field: 'manufacturer_detail.name',
title: '{% trans "Manufacturer" %}',
formatter: function(value, row, index, field) {
if (value && row.manufacturer_detail) {
var name = row.manufacturer_detail.name;
var url = `/company/${value}/`;
var name = value;
var url = `/company/${row.manufacturer_detail.pk}/`;
var html = imageHoverIcon(row.manufacturer_detail.image) + renderLink(name, url);
return html;
@ -762,7 +762,7 @@ function loadSupplierPartTable(table, url, options) {
visible: params['manufacturer_detail'],
switchable: params['manufacturer_detail'],
sortable: true,
field: 'MPN',
field: 'manufacturer_part_detail.MPN',
title: '{% trans "MPN" %}',
formatter: function(value, row, index, field) {
if (value && row.manufacturer_part) {