Fix for BOM import (#7515)

This commit is contained in:
Oliver 2024-06-26 12:48:03 +10:00 committed by GitHub
parent 937824dceb
commit e920165901
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2248,11 +2248,12 @@ function initializeRelatedField(field, fields, options={}) {
*/ */
function setRelatedFieldData(name, data, options={}) { function setRelatedFieldData(name, data, options={}) {
var select = getFormFieldElement(name, options); let select = getFormFieldElement(name, options);
const pkField = options?.fields[name]?.pk_field ?? 'pk'; let fields = options?.fields ?? {};
let pkField = fields[name]?.pk_field ?? 'pk';
var option = new Option(name, data[pkField], true, true); let option = new Option(name, data[pkField], true, true);
// Assign the JSON data to the 'instance' attribute, // Assign the JSON data to the 'instance' attribute,
// so we can access and render it later // so we can access and render it later