Fix record list ref field handling when no record

This commit is contained in:
Jože Fortun
2024-10-15 12:45:22 +02:00
parent 26270f215f
commit 2a8682c234
@@ -1258,8 +1258,8 @@ export default {
const r = new compose.Record(this.recordListModule, {})
// Set record values that should be prefilled
if (this.record.recordID && this.options.refField) {
r.values[this.options.refField] = this.record.recordID
if ((this.record || {}).recordID && this.options.refField) {
r.values[this.options.refField] = (this.record || {}).recordID
}
this.items.unshift(this.wrapRecord(r))
@@ -1380,7 +1380,7 @@ export default {
filter.push(`(${pf})`)
}
if (refField && this.record.recordID) {
if (refField && (this.record || {}).recordID) {
filter.push(`(${refField} = ${this.record.recordID})`)
}