mirror of https://github.com/OCA/web.git
commit
b801538bf5
|
@ -133,16 +133,22 @@ export class X2Many2DMatrixRenderer extends Component {
|
||||||
getValueFieldProps(column, row) {
|
getValueFieldProps(column, row) {
|
||||||
const x = this.columns.findIndex((c) => c.value === column);
|
const x = this.columns.findIndex((c) => c.value === column);
|
||||||
const y = this.rows.findIndex((r) => r.value === row);
|
const y = this.rows.findIndex((r) => r.value === row);
|
||||||
const props = this.list.activeFields[this.matrixFields.value].props;
|
const {props, propsFromAttrs} = this.list.activeFields[this.matrixFields.value];
|
||||||
const propsFromAttrs =
|
let record = null;
|
||||||
this.list.activeFields[this.matrixFields.value].propsFromAttrs;
|
let value = null;
|
||||||
const record = this.matrix[y][x].records[0];
|
if (
|
||||||
let value = this.matrix[y][x].value;
|
this.matrix[y] &&
|
||||||
if (!this._canAggregate()) {
|
this.matrix[y][x] &&
|
||||||
value = record.data[this.matrixFields.value];
|
(record = this.matrix[y][x].records[0])
|
||||||
|
) {
|
||||||
|
record = this.matrix[y][x].records[0];
|
||||||
|
value = this.matrix[y][x].value;
|
||||||
}
|
}
|
||||||
|
value =
|
||||||
return {
|
!this._canAggregate() && record
|
||||||
|
? record.data[this.matrixFields.value]
|
||||||
|
: value;
|
||||||
|
const result = {
|
||||||
...props,
|
...props,
|
||||||
...propsFromAttrs,
|
...propsFromAttrs,
|
||||||
value: value,
|
value: value,
|
||||||
|
@ -151,6 +157,10 @@ export class X2Many2DMatrixRenderer extends Component {
|
||||||
record: record,
|
record: record,
|
||||||
name: this.matrixFields.value,
|
name: this.matrixFields.value,
|
||||||
};
|
};
|
||||||
|
if (value === null) {
|
||||||
|
result.readonly = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue