Skip to content

Commit

Permalink
Merge pull request #1454 from OCA/17.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/web (17.0)
  • Loading branch information
bt-admin authored Feb 23, 2025
2 parents 627a011 + 9a011c9 commit 54fa1a9
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
67 changes: 34 additions & 33 deletions web_widget_x2many_2d_matrix/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -153,33 +153,33 @@ 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
=========

12.0.1.0.1 (2018-12-07)
-----------------------

- [FIX] Cells are unable to render property.
(`#1126 <https://github.com/OCA/web/issues/1126>`__)
- [FIX] Cells are unable to render property.
(`#1126 <https://github.com/OCA/web/issues/1126>`__)

12.0.1.0.0 (2018-11-20)
-----------------------

- [12.0][MIG] web_widget_x2many_2d_matrix
(`#1101 <https://github.com/OCA/web/issues/1101>`__)
- [12.0][MIG] web_widget_x2many_2d_matrix
(`#1101 <https://github.com/OCA/web/issues/1101>`__)

Bug Tracker
===========
Expand All @@ -206,20 +206,21 @@ Authors
Contributors
------------

- Holger Brunn <[email protected]>
- Pedro M. Baeza <[email protected]>
- Artem Kostyuk <[email protected]>
- Simone Orsi <[email protected]>
- Timon Tschanz <[email protected]>
- Jairo Llopis <[email protected]>
- Dennis Sluijk <[email protected]>
- `CorporateHub <https://corporatehub.eu/>`__
- Holger Brunn <[email protected]>
- Pedro M. Baeza <[email protected]>
- Artem Kostyuk <[email protected]>
- Simone Orsi <[email protected]>
- Timon Tschanz <[email protected]>
- Jairo Llopis <[email protected]>
- Dennis Sluijk <[email protected]>
- `CorporateHub <https://corporatehub.eu/>`__

- Alexey Pelykh <[email protected]>
- Alexey Pelykh <[email protected]>

- Adrià Gil Sorribes <[email protected]>
- Christopher Ormaza <[email protected]>
- SodexisTeam <[email protected]>
- Adrià Gil Sorribes <[email protected]>
- Christopher Ormaza <[email protected]>
- SodexisTeam <[email protected]>
- Jasmin Solanki <[email protected]>

Maintainers
-----------
Expand All @@ -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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ChrisOForgeFlow|
|maintainer-JasminSForgeFlow|

This module is part of the `OCA/web <https://github.com/OCA/web/tree/17.0/web_widget_x2many_2d_matrix>`_ project on GitHub.

Expand Down
4 changes: 2 additions & 2 deletions web_widget_x2many_2d_matrix/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "2D matrix for x2many fields",
"version": "17.0.1.0.0",
"maintainers": ["ChrisOForgeFlow"],
"version": "17.0.1.0.1",
"maintainers": ["JasminSForgeFlow"],
"development_status": "Production/Stable",
"author": (
"Therp BV, "
Expand Down
1 change: 1 addition & 0 deletions web_widget_x2many_2d_matrix/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
- Adrià Gil Sorribes \<<[email protected]>\>
- Christopher Ormaza \<<[email protected]>\>
- SodexisTeam \<<[email protected]>\>
- Jasmin Solanki \<<[email protected]>\>
20 changes: 12 additions & 8 deletions web_widget_x2many_2d_matrix/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
: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.
Expand Down Expand Up @@ -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 }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -366,7 +367,7 @@ <h1 class="title">2D matrix for x2many fields</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:23139cf061fc7a4ccb3f53579ad76f2d4737df131199206e85d7a262a094a20d
!! source digest: sha256:33c92b1d55d3fbee64f745403e67fb7b2062161535a4c4387284fd0f4220c505
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/17.0/web_widget_x2many_2d_matrix"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_widget_x2many_2d_matrix"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to show an x2many field with 3-tuples ($x_value,
Expand Down Expand Up @@ -508,8 +509,8 @@ <h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>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.</li>
instance. The readonly case will also give the ability to click on m2o
to open related records.</li>
<li>Support limit total records in the matrix. Ref:
<a class="reference external" href="https://github.com/OCA/web/issues/901">https://github.com/OCA/web/issues/901</a></li>
<li>Support cell traversal through keyboard arrows.</li>
Expand Down Expand Up @@ -574,17 +575,20 @@ <h2><a class="toc-backref" href="#toc-entry-10">Contributors</a></h2>
<li>Adrià Gil Sorribes &lt;<a class="reference external" href="mailto:adria.gil&#64;forgeflow.com">adria.gil&#64;forgeflow.com</a>&gt;</li>
<li>Christopher Ormaza &lt;<a class="reference external" href="mailto:chris.ormaza&#64;forgeflow.com">chris.ormaza&#64;forgeflow.com</a>&gt;</li>
<li>SodexisTeam &lt;<a class="reference external" href="mailto:dev&#64;sodexis.com">dev&#64;sodexis.com</a>&gt;</li>
<li>Jasmin Solanki &lt;<a class="reference external" href="mailto:jasmin.solanki&#64;forgeflow.com">jasmin.solanki&#64;forgeflow.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/ChrisOForgeFlow"><img alt="ChrisOForgeFlow" src="https://github.com/ChrisOForgeFlow.png?size=40px" /></a></p>
<p><a class="reference external image-reference" href="https://github.com/JasminSForgeFlow"><img alt="JasminSForgeFlow" src="https://github.com/JasminSForgeFlow.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/17.0/web_widget_x2many_2d_matrix">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
showRowTotals="props.showRowTotals"
showColumnTotals="props.showColumnTotals"
readonly="props.readonly"
domain="props.domain"
/>
</div>
</t>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
Expand All @@ -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},
};

0 comments on commit 54fa1a9

Please sign in to comment.