From 9d94126250baca4b9b50e03cd83ec89cced6ec8e Mon Sep 17 00:00:00 2001 From: JasminSForgeFlow Date: Mon, 17 Feb 2025 16:17:11 +0530 Subject: [PATCH 1/2] [IMP] web_widget_x2many_2d_matrix: Fix domain issue --- web_widget_x2many_2d_matrix/README.rst | 9 +++++---- web_widget_x2many_2d_matrix/__manifest__.py | 2 +- web_widget_x2many_2d_matrix/readme/CONTRIBUTORS.md | 1 + .../static/description/index.html | 14 +++++++++----- .../x2many_2d_matrix_field.xml | 1 + .../x2many_2d_matrix_renderer.esm.js | 9 +++++++++ 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/web_widget_x2many_2d_matrix/README.rst b/web_widget_x2many_2d_matrix/README.rst index 05a455df1e6b..99007dc9b52d 100644 --- a/web_widget_x2many_2d_matrix/README.rst +++ b/web_widget_x2many_2d_matrix/README.rst @@ -220,6 +220,7 @@ Contributors - Adrià Gil Sorribes - Christopher Ormaza - SodexisTeam +- Jasmin Solanki Maintainers ----------- @@ -234,13 +235,13 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -.. |maintainer-ChrisOForgeFlow| image:: https://github.com/ChrisOForgeFlow.png?size=40px - :target: https://github.com/ChrisOForgeFlow - :alt: ChrisOForgeFlow +.. |maintainer-JasminSForgeFlow| image:: https://github.com/JasminSForgeFlow.png?size=40px + :target: https://github.com/JasminSForgeFlow + :alt: JasminSForgeFlow Current `maintainer `__: -|maintainer-ChrisOForgeFlow| +|maintainer-JasminSForgeFlow| This module is part of the `OCA/web `_ project on GitHub. diff --git a/web_widget_x2many_2d_matrix/__manifest__.py b/web_widget_x2many_2d_matrix/__manifest__.py index 4a8c40b578d2..89ffba1fcd0a 100644 --- a/web_widget_x2many_2d_matrix/__manifest__.py +++ b/web_widget_x2many_2d_matrix/__manifest__.py @@ -6,7 +6,7 @@ { "name": "2D matrix for x2many fields", "version": "17.0.1.0.0", - "maintainers": ["ChrisOForgeFlow"], + "maintainers": ["JasminSForgeFlow"], "development_status": "Production/Stable", "author": ( "Therp BV, " diff --git a/web_widget_x2many_2d_matrix/readme/CONTRIBUTORS.md b/web_widget_x2many_2d_matrix/readme/CONTRIBUTORS.md index abfc17c881fb..416bde8ac53b 100644 --- a/web_widget_x2many_2d_matrix/readme/CONTRIBUTORS.md +++ b/web_widget_x2many_2d_matrix/readme/CONTRIBUTORS.md @@ -10,3 +10,4 @@ - Adrià Gil Sorribes \<\> - Christopher Ormaza \<\> - SodexisTeam \<\> +- Jasmin Solanki \<\> \ No newline at end of file diff --git a/web_widget_x2many_2d_matrix/static/description/index.html b/web_widget_x2many_2d_matrix/static/description/index.html index e377ba99b23b..dabb6566f192 100644 --- a/web_widget_x2many_2d_matrix/static/description/index.html +++ b/web_widget_x2many_2d_matrix/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -574,17 +575,20 @@

Contributors

  • Adrià Gil Sorribes <adria.gil@forgeflow.com>
  • Christopher Ormaza <chris.ormaza@forgeflow.com>
  • SodexisTeam <dev@sodexis.com>
  • +
  • Jasmin Solanki <jasmin.solanki@forgeflow.com>
  • Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    Current maintainer:

    -

    ChrisOForgeFlow

    +

    JasminSForgeFlow

    This module is part of the OCA/web project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_field/x2many_2d_matrix_field.xml b/web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_field/x2many_2d_matrix_field.xml index c6b02aea6ba9..b075f93058cb 100644 --- a/web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_field/x2many_2d_matrix_field.xml +++ b/web_widget_x2many_2d_matrix/static/src/components/x2many_2d_matrix_field/x2many_2d_matrix_field.xml @@ -8,6 +8,7 @@ showRowTotals="props.showRowTotals" showColumnTotals="props.showColumnTotals" readonly="props.readonly" + domain="props.domain" /> 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 56cb698ddc43..2264e5573349 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 @@ -2,6 +2,8 @@ import {Component, onWillUpdateProps} from "@odoo/owl"; import {registry} from "@web/core/registry"; +import {Domain} from "@web/core/domain"; +import {evaluateExpr} from "@web/core/py_js/py"; const fieldRegistry = registry.category("fields"); export class X2Many2DMatrixRenderer extends Component { @@ -162,6 +164,12 @@ export class X2Many2DMatrixRenderer extends Component { record: record, name: this.matrixFields.value, }; + const domain = record.fields[this.matrixFields.value].domain; + if (domain) { + result.domain = new Domain( + evaluateExpr(domain, record.evalContext) + ).toList(); + } if (value === null) { result.readonly = true; } @@ -174,6 +182,7 @@ X2Many2DMatrixRenderer.props = { list: {type: Object, optional: true}, matrixFields: {type: Object, optional: true}, readonly: {type: Boolean, optional: true}, + domain: {type: [Array, Function], optional: true}, showRowTotals: {type: Boolean, optional: true}, showColumnTotals: {type: Boolean, optional: true}, }; From 9a011c9cf13015849013e75e98d31ddda17f24fd Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 22 Feb 2025 12:16:15 +0000 Subject: [PATCH 2/2] [BOT] post-merge updates --- README.md | 2 +- web_widget_x2many_2d_matrix/README.rst | 64 +++++++++---------- web_widget_x2many_2d_matrix/__manifest__.py | 2 +- .../static/description/index.html | 6 +- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index dd6199178d48..3081bc77ecc0 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ addon | version | maintainers | summary [web_widget_open_tab](web_widget_open_tab/) | 17.0.1.0.0 | | Allow to open record from trees on new tab from tree views [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_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.0.0 | [![ChrisOForgeFlow](https://github.com/ChrisOForgeFlow.png?size=30px)](https://github.com/ChrisOForgeFlow) | Show list fields as a matrix +[web_widget_x2many_2d_matrix](web_widget_x2many_2d_matrix/) | 17.0.1.0.1 | [![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 99007dc9b52d..4a969d9a353d 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:23139cf061fc7a4ccb3f53579ad76f2d4737df131199206e85d7a262a094a20d + !! source digest: sha256:33c92b1d55d3fbee64f745403e67fb7b2062161535a4c4387284fd0f4220c505 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png @@ -153,18 +153,18 @@ Now in our wizard, we can use: Known issues / Roadmap ====================== -- Support extra attributes on each field cell via field_extra_attrs - param. We could set a cell as not editable, required or readonly for - instance. The readonly case will also give the ability to click on - m2o to open related records. -- Support limit total records in the matrix. Ref: - https://github.com/OCA/web/issues/901 -- Support cell traversal through keyboard arrows. -- Entering the widget from behind by pressing ``Shift+TAB`` in your - keyboard will enter into the 1st cell until - https://github.com/odoo/odoo/pull/26490 is merged. -- Support extra invisible fields inside each cell. -- Support kanban mode. Current behaviour forces list mode. +- Support extra attributes on each field cell via field_extra_attrs + param. We could set a cell as not editable, required or readonly for + instance. The readonly case will also give the ability to click on m2o + to open related records. +- Support limit total records in the matrix. Ref: + https://github.com/OCA/web/issues/901 +- Support cell traversal through keyboard arrows. +- Entering the widget from behind by pressing ``Shift+TAB`` in your + keyboard will enter into the 1st cell until + https://github.com/odoo/odoo/pull/26490 is merged. +- Support extra invisible fields inside each cell. +- Support kanban mode. Current behaviour forces list mode. Changelog ========= @@ -172,14 +172,14 @@ Changelog 12.0.1.0.1 (2018-12-07) ----------------------- -- [FIX] Cells are unable to render property. - (`#1126 `__) +- [FIX] Cells are unable to render property. + (`#1126 `__) 12.0.1.0.0 (2018-11-20) ----------------------- -- [12.0][MIG] web_widget_x2many_2d_matrix - (`#1101 `__) +- [12.0][MIG] web_widget_x2many_2d_matrix + (`#1101 `__) Bug Tracker =========== @@ -206,21 +206,21 @@ Authors Contributors ------------ -- Holger Brunn -- Pedro M. Baeza -- Artem Kostyuk -- Simone Orsi -- Timon Tschanz -- Jairo Llopis -- Dennis Sluijk -- `CorporateHub `__ - - - Alexey Pelykh - -- Adrià Gil Sorribes -- Christopher Ormaza -- SodexisTeam -- Jasmin Solanki +- Holger Brunn +- Pedro M. Baeza +- Artem Kostyuk +- Simone Orsi +- Timon Tschanz +- Jairo Llopis +- Dennis Sluijk +- `CorporateHub `__ + + - Alexey Pelykh + +- Adrià Gil Sorribes +- Christopher Ormaza +- SodexisTeam +- Jasmin Solanki Maintainers ----------- diff --git a/web_widget_x2many_2d_matrix/__manifest__.py b/web_widget_x2many_2d_matrix/__manifest__.py index 89ffba1fcd0a..2c550d8a5b09 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.0.0", + "version": "17.0.1.0.1", "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 dabb6566f192..a4be52ac310d 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:23139cf061fc7a4ccb3f53579ad76f2d4737df131199206e85d7a262a094a20d +!! source digest: sha256:33c92b1d55d3fbee64f745403e67fb7b2062161535a4c4387284fd0f4220c505 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    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, @@ -509,8 +509,8 @@

    Known issues / Roadmap

    • Support extra attributes on each field cell via field_extra_attrs param. We could set a cell as not editable, required or readonly for -instance. The readonly case will also give the ability to click on -m2o to open related records.
    • +instance. The readonly case will also give the ability to click on m2o +to open related records.
    • Support limit total records in the matrix. Ref: https://github.com/OCA/web/issues/901
    • Support cell traversal through keyboard arrows.