From 9d94126250baca4b9b50e03cd83ec89cced6ec8e Mon Sep 17 00:00:00 2001 From: JasminSForgeFlow Date: Mon, 17 Feb 2025 16:17:11 +0530 Subject: [PATCH] [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 05a455df1..99007dc9b 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 4a8c40b57..89ffba1fc 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 abfc17c88..416bde8ac 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 e377ba99b..dabb6566f 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 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { 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.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -574,17 +575,20 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
  • 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 c6b02aea6..b075f9305 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 56cb698dd..2264e5573 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}, };