[MIG] web_widget_x2many_2d_matrix: Migration to 18.0

pull/3048/head
Maksym Yankin 2025-01-07 14:51:01 +02:00
parent 45e725fbba
commit 4f2d0966d7
7 changed files with 43 additions and 42 deletions

View File

@ -17,13 +17,13 @@
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/17.0/web_widget_x2many_2d_matrix :target: https://github.com/OCA/web/tree/18.0/web_widget_x2many_2d_matrix
:alt: OCA/web :alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_widget_x2many_2d_matrix :target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_widget_x2many_2d_matrix
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=17.0 :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0
:alt: Try me on Runboat :alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -73,12 +73,12 @@ attributes:
.. code:: xml .. code:: xml
<field name="my_field" widget="x2many_2d_matrix" field_x_axis="my_field1" field_y_axis="my_field2" field_value="my_field3"> <field name="my_field" widget="x2many_2d_matrix" field_x_axis="my_field1" field_y_axis="my_field2" field_value="my_field3">
<tree> <list>
<field name="my_field"/> <field name="my_field"/>
<field name="my_field1"/> <field name="my_field1"/>
<field name="my_field2"/> <field name="my_field2"/>
<field name="my_field3"/> <field name="my_field3"/>
</tree> </list>
</field> </field>
You can pass the following parameters: You can pass the following parameters:
@ -142,12 +142,12 @@ Now in our wizard, we can use:
.. code:: xml .. code:: xml
<field name="task_ids" widget="x2many_2d_matrix" field_x_axis="project_id" field_y_axis="user_id" field_value="planned_hours"> <field name="task_ids" widget="x2many_2d_matrix" field_x_axis="project_id" field_y_axis="user_id" field_value="planned_hours">
<tree> <list>
<field name="task_ids"/> <field name="task_ids"/>
<field name="project_id"/> <field name="project_id"/>
<field name="user_id"/> <field name="user_id"/>
<field name="planned_hours"/> <field name="planned_hours"/>
</tree> </list>
</field> </field>
Known issues / Roadmap Known issues / Roadmap
@ -187,7 +187,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported. In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_x2many_2d_matrix%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_x2many_2d_matrix%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@ -242,6 +242,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-ChrisOForgeFlow| |maintainer-ChrisOForgeFlow|
This module is part of the `OCA/web <https://github.com/OCA/web/tree/17.0/web_widget_x2many_2d_matrix>`_ project on GitHub. This module is part of the `OCA/web <https://github.com/OCA/web/tree/18.0/web_widget_x2many_2d_matrix>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -5,7 +5,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
"name": "2D matrix for x2many fields", "name": "2D matrix for x2many fields",
"version": "17.0.1.0.0", "version": "18.0.1.0.0",
"maintainers": ["ChrisOForgeFlow"], "maintainers": ["ChrisOForgeFlow"],
"development_status": "Production/Stable", "development_status": "Production/Stable",
"author": ( "author": (

View File

@ -8,12 +8,12 @@ attributes:
``` xml ``` xml
<field name="my_field" widget="x2many_2d_matrix" field_x_axis="my_field1" field_y_axis="my_field2" field_value="my_field3"> <field name="my_field" widget="x2many_2d_matrix" field_x_axis="my_field1" field_y_axis="my_field2" field_value="my_field3">
<tree> <list>
<field name="my_field"/> <field name="my_field"/>
<field name="my_field1"/> <field name="my_field1"/>
<field name="my_field2"/> <field name="my_field2"/>
<field name="my_field3"/> <field name="my_field3"/>
</tree> </list>
</field> </field>
``` ```
@ -81,11 +81,11 @@ Now in our wizard, we can use:
``` xml ``` xml
<field name="task_ids" widget="x2many_2d_matrix" field_x_axis="project_id" field_y_axis="user_id" field_value="planned_hours"> <field name="task_ids" widget="x2many_2d_matrix" field_x_axis="project_id" field_y_axis="user_id" field_value="planned_hours">
<tree> <list>
<field name="task_ids"/> <field name="task_ids"/>
<field name="project_id"/> <field name="project_id"/>
<field name="user_id"/> <field name="user_id"/>
<field name="planned_hours"/> <field name="planned_hours"/>
</tree> </list>
</field> </field>
``` ```

View File

@ -8,10 +8,11 @@
/* /*
:Author: David Goodger (goodger@python.org) :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. :Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils. 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 See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet. customize this style sheet.
@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ; margin-left: 2em ;
margin-right: 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, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 } pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@ -300,7 +301,7 @@ span.option {
span.pre { span.pre {
white-space: pre } white-space: pre }
span.problematic { span.problematic, pre.problematic {
color: red } color: red }
span.section-subtitle { span.section-subtitle {
@ -368,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:23139cf061fc7a4ccb3f53579ad76f2d4737df131199206e85d7a262a094a20d !! source digest: sha256:23139cf061fc7a4ccb3f53579ad76f2d4737df131199206e85d7a262a094a20d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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><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/18.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-18-0/web-18-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=18.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, <p>This module allows to show an x2many field with 3-tuples ($x_value,
$y_value, $value) in a table</p> $y_value, $value) in a table</p>
<table border="1" class="docutils"> <table border="1" class="docutils">
@ -435,12 +436,12 @@ value. If your fields are named differently, pass the correct names as
attributes:</p> attributes:</p>
<pre class="code xml literal-block"> <pre class="code xml literal-block">
<span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;my_field&quot;</span><span class="w"> </span><span class="na">widget=</span><span class="s">&quot;x2many_2d_matrix&quot;</span><span class="w"> </span><span class="na">field_x_axis=</span><span class="s">&quot;my_field1&quot;</span><span class="w"> </span><span class="na">field_y_axis=</span><span class="s">&quot;my_field2&quot;</span><span class="w"> </span><span class="na">field_value=</span><span class="s">&quot;my_field3&quot;</span><span class="nt">&gt;</span><span class="w"> <span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;my_field&quot;</span><span class="w"> </span><span class="na">widget=</span><span class="s">&quot;x2many_2d_matrix&quot;</span><span class="w"> </span><span class="na">field_x_axis=</span><span class="s">&quot;my_field1&quot;</span><span class="w"> </span><span class="na">field_y_axis=</span><span class="s">&quot;my_field2&quot;</span><span class="w"> </span><span class="na">field_value=</span><span class="s">&quot;my_field3&quot;</span><span class="nt">&gt;</span><span class="w">
</span><span class="nt">&lt;tree&gt;</span><span class="w"> </span><span class="nt">&lt;list&gt;</span><span class="w">
</span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;my_field&quot;</span><span class="nt">/&gt;</span><span class="w"> </span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;my_field&quot;</span><span class="nt">/&gt;</span><span class="w">
</span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;my_field1&quot;</span><span class="nt">/&gt;</span><span class="w"> </span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;my_field1&quot;</span><span class="nt">/&gt;</span><span class="w">
</span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;my_field2&quot;</span><span class="nt">/&gt;</span><span class="w"> </span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;my_field2&quot;</span><span class="nt">/&gt;</span><span class="w">
</span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;my_field3&quot;</span><span class="nt">/&gt;</span><span class="w"> </span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;my_field3&quot;</span><span class="nt">/&gt;</span><span class="w">
</span><span class="nt">&lt;/tree&gt;</span><span class="w"> </span><span class="nt">&lt;/list&gt;</span><span class="w">
</span><span class="nt">&lt;/field&gt;</span> </span><span class="nt">&lt;/field&gt;</span>
</pre> </pre>
<p>You can pass the following parameters:</p> <p>You can pass the following parameters:</p>
@ -459,12 +460,12 @@ hours for one task per project per user. In this case, we can use
<tt class="docutils literal">project.task</tt> as our data model and point to it from our wizard. The <tt class="docutils literal">project.task</tt> as our data model and point to it from our wizard. The
crucial part is that we fill the field in the default function:</p> crucial part is that we fill the field in the default function:</p>
<pre class="code python literal-block"> <pre class="code python literal-block">
<span class="kn">from</span> <span class="nn">odoo</span> <span class="kn">import</span> <span class="n">fields</span><span class="p">,</span> <span class="n">models</span><span class="w"> <span class="kn">from</span><span class="w"> </span><span class="nn">odoo</span><span class="w"> </span><span class="kn">import</span> <span class="n">fields</span><span class="p">,</span> <span class="n">models</span><span class="w">
</span><span class="k">class</span> <span class="nc">MyWizard</span><span class="p">(</span><span class="n">models</span><span class="o">.</span><span class="n">TransientModel</span><span class="p">):</span><span class="w"> </span><span class="k">class</span><span class="w"> </span><span class="nc">MyWizard</span><span class="p">(</span><span class="n">models</span><span class="o">.</span><span class="n">TransientModel</span><span class="p">):</span><span class="w">
</span> <span class="n">_name</span> <span class="o">=</span> <span class="s1">'my.wizard'</span><span class="w"> </span> <span class="n">_name</span> <span class="o">=</span> <span class="s1">'my.wizard'</span><span class="w">
</span> <span class="k">def</span> <span class="nf">_default_task_ids</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span><span class="w"> </span> <span class="k">def</span><span class="w"> </span><span class="nf">_default_task_ids</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span><span class="w">
</span> <span class="c1"># your list of project should come from the context, some selection</span><span class="w"> </span> <span class="c1"># your list of project should come from the context, some selection</span><span class="w">
</span> <span class="c1"># in a previous wizard or wherever else</span><span class="w"> </span> <span class="c1"># in a previous wizard or wherever else</span><span class="w">
</span> <span class="n">projects</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'project.project'</span><span class="p">]</span><span class="o">.</span><span class="n">browse</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span><span class="w"> </span> <span class="n">projects</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">env</span><span class="p">[</span><span class="s1">'project.project'</span><span class="p">]</span><span class="o">.</span><span class="n">browse</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span><span class="w">
@ -493,12 +494,12 @@ crucial part is that we fill the field in the default function:</p>
<p>Now in our wizard, we can use:</p> <p>Now in our wizard, we can use:</p>
<pre class="code xml literal-block"> <pre class="code xml literal-block">
<span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;task_ids&quot;</span><span class="w"> </span><span class="na">widget=</span><span class="s">&quot;x2many_2d_matrix&quot;</span><span class="w"> </span><span class="na">field_x_axis=</span><span class="s">&quot;project_id&quot;</span><span class="w"> </span><span class="na">field_y_axis=</span><span class="s">&quot;user_id&quot;</span><span class="w"> </span><span class="na">field_value=</span><span class="s">&quot;planned_hours&quot;</span><span class="nt">&gt;</span><span class="w"> <span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;task_ids&quot;</span><span class="w"> </span><span class="na">widget=</span><span class="s">&quot;x2many_2d_matrix&quot;</span><span class="w"> </span><span class="na">field_x_axis=</span><span class="s">&quot;project_id&quot;</span><span class="w"> </span><span class="na">field_y_axis=</span><span class="s">&quot;user_id&quot;</span><span class="w"> </span><span class="na">field_value=</span><span class="s">&quot;planned_hours&quot;</span><span class="nt">&gt;</span><span class="w">
</span><span class="nt">&lt;tree&gt;</span><span class="w"> </span><span class="nt">&lt;list&gt;</span><span class="w">
</span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;task_ids&quot;</span><span class="nt">/&gt;</span><span class="w"> </span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;task_ids&quot;</span><span class="nt">/&gt;</span><span class="w">
</span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;project_id&quot;</span><span class="nt">/&gt;</span><span class="w"> </span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;project_id&quot;</span><span class="nt">/&gt;</span><span class="w">
</span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;user_id&quot;</span><span class="nt">/&gt;</span><span class="w"> </span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;user_id&quot;</span><span class="nt">/&gt;</span><span class="w">
</span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;planned_hours&quot;</span><span class="nt">/&gt;</span><span class="w"> </span><span class="nt">&lt;field</span><span class="w"> </span><span class="na">name=</span><span class="s">&quot;planned_hours&quot;</span><span class="nt">/&gt;</span><span class="w">
</span><span class="nt">&lt;/tree&gt;</span><span class="w"> </span><span class="nt">&lt;/list&gt;</span><span class="w">
</span><span class="nt">&lt;/field&gt;</span> </span><span class="nt">&lt;/field&gt;</span>
</pre> </pre>
</div> </div>
@ -542,7 +543,7 @@ keyboard will enter into the 1st cell until
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_x2many_2d_matrix%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_x2many_2d_matrix%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@ -579,13 +580,15 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h2> <h2><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p> <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 <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</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/ChrisOForgeFlow"><img alt="ChrisOForgeFlow" src="https://github.com/ChrisOForgeFlow.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>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/18.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> <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> </div>
</div> </div>

View File

@ -1,8 +1,6 @@
/** @odoo-module **/
import {Component} from "@odoo/owl"; import {Component} from "@odoo/owl";
import {X2Many2DMatrixRenderer} from "@web_widget_x2many_2d_matrix/components/x2many_2d_matrix_renderer/x2many_2d_matrix_renderer.esm"; import {X2Many2DMatrixRenderer} from "@web_widget_x2many_2d_matrix/components/x2many_2d_matrix_renderer/x2many_2d_matrix_renderer.esm";
import {archParseBoolean} from "@web/views/utils"; import {exprToBoolean} from "@web/core/utils/strings";
import {registry} from "@web/core/registry"; import {registry} from "@web/core/registry";
import {standardFieldProps} from "@web/views/fields/standard_field_props"; import {standardFieldProps} from "@web/views/fields/standard_field_props";
@ -41,15 +39,15 @@ export const x2Many2DMatrixField = {
x: attrs.field_x_axis, x: attrs.field_x_axis,
y: attrs.field_y_axis, y: attrs.field_y_axis,
}, },
isXClickable: archParseBoolean(attrs.x_axis_clickable), isXClickable: exprToBoolean(attrs.x_axis_clickable),
isYClickable: archParseBoolean(attrs.y_axis_clickable), isYClickable: exprToBoolean(attrs.y_axis_clickable),
showRowTotals: showRowTotals:
"show_row_totals" in attrs "show_row_totals" in attrs
? archParseBoolean(attrs.show_row_totals) ? exprToBoolean(attrs.show_row_totals)
: true, : true,
showColumnTotals: showColumnTotals:
"show_column_totals" in attrs "show_column_totals" in attrs
? archParseBoolean(attrs.show_column_totals) ? exprToBoolean(attrs.show_column_totals)
: true, : true,
}; };
}, },

View File

@ -1,5 +1,3 @@
/** @odoo-module **/
import {Component, onWillUpdateProps} from "@odoo/owl"; import {Component, onWillUpdateProps} from "@odoo/owl";
import {registry} from "@web/core/registry"; import {registry} from "@web/core/registry";
const fieldRegistry = registry.category("fields"); const fieldRegistry = registry.category("fields");

View File

@ -25,11 +25,13 @@
<t t-esc="row.text" /> <t t-esc="row.text" />
</td> </td>
<td t-foreach="columns" t-as="column" t-key="column.value"> <td t-foreach="columns" t-as="column" t-key="column.value">
<t t-if="getValueFieldProps(column.value, row.value).record">
<t <t
t-component="ValueFieldComponent" t-component="ValueFieldComponent"
t-props="getValueFieldProps(column.value, row.value)" t-props="getValueFieldProps(column.value, row.value)"
record="getValueFieldProps(column.value, row.value).record" record="getValueFieldProps(column.value, row.value).record"
/> />
</t>
</td> </td>
<td <td
t-if="props.showRowTotals and _canAggregate()" t-if="props.showRowTotals and _canAggregate()"