Fix not all related fields populated when adding record from related record list
This commit is contained in:
@@ -406,11 +406,11 @@ export default {
|
||||
} else {
|
||||
if (this.refRecord) {
|
||||
// Record create form called from a related records block,
|
||||
// we'll try to find an appropriate field and cross-link this new record to ref
|
||||
const recRefField = this.module.fields.find(f => f.kind === 'Record' && f.options.moduleID === this.refRecord.moduleID)
|
||||
if (recRefField) {
|
||||
this.values[recRefField.name] = this.refRecord.recordID
|
||||
}
|
||||
// we'll try to find an appropriate fields and cross-link this new record to ref
|
||||
|
||||
this.module.fields.filter(f => f.kind === 'Record' && f.options.moduleID === this.refRecord.moduleID).forEach(f => {
|
||||
this.values[f.name] = this.refRecord.recordID
|
||||
})
|
||||
}
|
||||
|
||||
return new compose.Record(module, { values: this.values })
|
||||
|
||||
Reference in New Issue
Block a user