diff --git a/README.md b/README.md index fd98dc6d9b98..d59d32653c7f 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ addon | version | maintainers | summary [web_widget_plotly_chart](web_widget_plotly_chart/) | 17.0.1.0.0 | [![robyf70](https://github.com/robyf70.png?size=30px)](https://github.com/robyf70) | Allow to draw plotly charts. [web_widget_product_label_section_and_note](web_widget_product_label_section_and_note/) | 17.0.1.0.0 | | unify the product and name into a single column [web_widget_url_advanced](web_widget_url_advanced/) | 17.0.1.0.0 | | This module extends URL widget for displaying anchors with custom labels. -[web_widget_x2many_2d_matrix](web_widget_x2many_2d_matrix/) | 17.0.1.1.1 | [![JasminSForgeFlow](https://github.com/JasminSForgeFlow.png?size=30px)](https://github.com/JasminSForgeFlow) | Show list fields as a matrix +[web_widget_x2many_2d_matrix](web_widget_x2many_2d_matrix/) | 17.0.1.1.2 | [![JasminSForgeFlow](https://github.com/JasminSForgeFlow.png?size=30px)](https://github.com/JasminSForgeFlow) | Show list fields as a matrix [//]: # (end addons) diff --git a/web_widget_x2many_2d_matrix/README.rst b/web_widget_x2many_2d_matrix/README.rst index 8010103111d0..2a51d61fab65 100644 --- a/web_widget_x2many_2d_matrix/README.rst +++ b/web_widget_x2many_2d_matrix/README.rst @@ -7,7 +7,7 @@ !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:ad6c8b54e886ded668c273eb0d4453550b709e574a2c7cd89d9aadd988ad79a9 + !! source digest: sha256:d278525cf24b05fd5205403f649914262f35525b6c3244924d74adada150df07 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png diff --git a/web_widget_x2many_2d_matrix/__manifest__.py b/web_widget_x2many_2d_matrix/__manifest__.py index 6482cdb58b0f..4414017c69f8 100644 --- a/web_widget_x2many_2d_matrix/__manifest__.py +++ b/web_widget_x2many_2d_matrix/__manifest__.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "2D matrix for x2many fields", - "version": "17.0.1.1.1", + "version": "17.0.1.1.2", "maintainers": ["JasminSForgeFlow"], "development_status": "Production/Stable", "author": ( diff --git a/web_widget_x2many_2d_matrix/static/description/index.html b/web_widget_x2many_2d_matrix/static/description/index.html index 99ea8f595758..7835ce3e621b 100644 --- a/web_widget_x2many_2d_matrix/static/description/index.html +++ b/web_widget_x2many_2d_matrix/static/description/index.html @@ -367,7 +367,7 @@

2D matrix for x2many fields

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:ad6c8b54e886ded668c273eb0d4453550b709e574a2c7cd89d9aadd988ad79a9 +!! source digest: sha256:d278525cf24b05fd5205403f649914262f35525b6c3244924d74adada150df07 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Production/Stable License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This module allows to show an x2many field with 3-tuples ($x_value, diff --git a/web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_renderer/x2many_2d_matrix_renderer.esm.js b/web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_renderer/x2many_2d_matrix_renderer.esm.js index 2f4d1c06c500..77d8c635c3b7 100644 --- a/web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_renderer/x2many_2d_matrix_renderer.esm.js +++ b/web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_renderer/x2many_2d_matrix_renderer.esm.js @@ -144,6 +144,11 @@ export class X2Many2DMatrixRenderer extends Component { ); } + // More options can be included in the future, here are only added the ones tested initially. + _canOptions() { + return ["many2one"].includes(this.list.fields[this.matrixFields.value].type); + } + getValueFieldProps(column, row) { const x = this.columns.findIndex((c) => c.value === column); const y = this.rows.findIndex((r) => r.value === row); @@ -163,11 +168,13 @@ export class X2Many2DMatrixRenderer extends Component { readonly: this.props.readonly, record: record, name: this.matrixFields.value, - canCreate: this.props.canCreate, - canOpen: this.props.canOpen, - canWrite: this.props.canWrite, - canQuickCreate: this.props.canQuickCreate, - canCreateEdit: this.props.canCreateEdit, + ...(this._canOptions() && { + canCreate: this.props.canCreate, + canOpen: this.props.canOpen, + canWrite: this.props.canWrite, + canQuickCreate: this.props.canQuickCreate, + canCreateEdit: this.props.canCreateEdit, + }), }; const domain = record.fields[this.matrixFields.value].domain; if (domain) {