Merge PR #2561 into 16.0

Signed-off-by yajo
This commit is contained in:
OCA-git-bot
2024-02-14 07:50:39 +00:00
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);
},
});