mirror of https://github.com/OCA/web.git
[IMP] web_widget_x2many_2d_matrix: Check is aggregatable
parent
0a680a210f
commit
2272f6e807
|
@ -116,6 +116,12 @@ export class X2Many2DMatrixRenderer extends Component {
|
||||||
.reduce((aggr, y) => aggr + y);
|
.reduce((aggr, y) => aggr + y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_canAggregate() {
|
||||||
|
return ["integer", "float", "monetary"].includes(
|
||||||
|
this.list.fields[this.matrixFields.value].type
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
update(x, y, value) {
|
update(x, y, value) {
|
||||||
this.matrix[y][x].value = value;
|
this.matrix[y][x].value = value;
|
||||||
const xFieldValue = this.columns[x].value;
|
const xFieldValue = this.columns[x].value;
|
||||||
|
|
|
@ -30,7 +30,10 @@
|
||||||
t-props="getValueFieldProps(column.value, row.value)"
|
t-props="getValueFieldProps(column.value, row.value)"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td t-if="props.showRowTotals" class="row-total">
|
<td
|
||||||
|
t-if="props.showRowTotals and _canAggregate()"
|
||||||
|
class="row-total"
|
||||||
|
>
|
||||||
<t
|
<t
|
||||||
t-component="ValueFieldComponent"
|
t-component="ValueFieldComponent"
|
||||||
readonly="true"
|
readonly="true"
|
||||||
|
@ -40,7 +43,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr t-if="props.showColumnTotals">
|
<tr t-if="props.showColumnTotals and _canAggregate()">
|
||||||
<th />
|
<th />
|
||||||
<th t-foreach="columns" t-as="column" t-key="column.value">
|
<th t-foreach="columns" t-as="column" t-key="column.value">
|
||||||
<t
|
<t
|
||||||
|
|
Loading…
Reference in New Issue