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