Skip to content

Commit

Permalink
Merge PR OCA#2561 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by yajo
  • Loading branch information
OCA-git-bot committed Feb 14, 2024
2 parents e6d59b7 + 35cf84c commit a8d0766
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions web_widget_x2many_2d_matrix/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
},
});

0 comments on commit a8d0766

Please sign in to comment.