[FIX]: web_widget_x2many_2d_matrix: Editable boolean

pull/3048/head
Ethan Hildick 2023-07-11 11:16:00 +02:00 committed by Maksym Yankin
parent 15edf5608e
commit 49b1241639
3 changed files with 17 additions and 0 deletions

View File

@ -35,6 +35,7 @@
"x2many_2d_matrix_field.xml",
"web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_field/"
"x2many_2d_matrix_field.scss",
"web_widget_x2many_2d_matrix/static/src/views/fields/boolean/boolean_field.esm.js",
],
},
}

View File

@ -144,6 +144,9 @@ export class X2Many2DMatrixRenderer extends Component {
record = this.matrix[y][x].records[0];
value = this.matrix[y][x].value;
}
if (this.list.fields[this.matrixFields.value].type === "boolean") {
record.bypass_readonly = true;
}
value =
!this._canAggregate() && record
? record.data[this.matrixFields.value]

View File

@ -0,0 +1,13 @@
/** @odoo-module **/
import {patch} from "@web/core/utils/patch";
import {BooleanField} from "@web/views/fields/boolean/boolean_field";
patch(BooleanField.prototype, "web_widget_x2many_2d_matrix", {
get isReadonly() {
if (this.props.record.bypass_readonly) {
return false;
}
return this._super(...arguments);
},
});