Skip to content

Commit cb06722

Browse files
committed
[FIX] web_widget_x2many_2d_matrix: Handle no record for cell to prevent errors
1 parent d899453 commit cb06722

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_renderer/x2many_2d_matrix_renderer.esm.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,16 @@ export class X2Many2DMatrixRenderer extends Component {
164164
record: record,
165165
name: this.matrixFields.value,
166166
};
167-
const domain = record.fields[this.matrixFields.value].domain;
168-
if ((Array.isArray(domain) || typeof domain === "string") && domain.length) {
167+
const domain = record ? record.fields[this.matrixFields.value].domain : "[]";
168+
if (
169+
record &&
170+
(Array.isArray(domain) || typeof domain === "string") &&
171+
domain.length
172+
) {
169173
result.domain = new Domain(
170174
evaluateExpr(domain, record.evalContext)
171175
).toList();
172176
}
173-
if (value === null) {
174-
result.readonly = true;
175-
}
176177
return result;
177178
}
178179
}

web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_renderer/x2many_2d_matrix_renderer.xml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
</td>
2727
<td t-foreach="columns" t-as="column" t-key="column.value">
2828
<t
29+
t-if="!!getValueFieldProps(column.value, row.value).record"
2930
t-component="ValueFieldComponent"
3031
t-props="getValueFieldProps(column.value, row.value)"
3132
record="getValueFieldProps(column.value, row.value).record"

0 commit comments

Comments
 (0)