mirror of https://github.com/OCA/web.git
[FIX]: web_widget_x2many_2d_matrix: Editable boolean
parent
15edf5608e
commit
49b1241639
|
@ -35,6 +35,7 @@
|
||||||
"x2many_2d_matrix_field.xml",
|
"x2many_2d_matrix_field.xml",
|
||||||
"web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_field/"
|
"web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_field/"
|
||||||
"x2many_2d_matrix_field.scss",
|
"x2many_2d_matrix_field.scss",
|
||||||
|
"web_widget_x2many_2d_matrix/static/src/views/fields/boolean/boolean_field.esm.js",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,6 +144,9 @@ export class X2Many2DMatrixRenderer extends Component {
|
||||||
record = this.matrix[y][x].records[0];
|
record = this.matrix[y][x].records[0];
|
||||||
value = this.matrix[y][x].value;
|
value = this.matrix[y][x].value;
|
||||||
}
|
}
|
||||||
|
if (this.list.fields[this.matrixFields.value].type === "boolean") {
|
||||||
|
record.bypass_readonly = true;
|
||||||
|
}
|
||||||
value =
|
value =
|
||||||
!this._canAggregate() && record
|
!this._canAggregate() && record
|
||||||
? record.data[this.matrixFields.value]
|
? record.data[this.matrixFields.value]
|
||||||
|
|
|
@ -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);
|
||||||
|
},
|
||||||
|
});
|
Loading…
Reference in New Issue