[MIG] web_pivot_computed_measure: Migration to 13.0

pull/2755/head
Ernesto Tejeda 2020-11-17 15:40:28 -05:00 committed by Carlos Roca
parent d1a044b374
commit 833aea97d0
8 changed files with 192 additions and 216 deletions

View File

@ -14,13 +14,13 @@ Web Pivot Computed Measure
: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/12.0/web_pivot_computed_measure :target: https://github.com/OCA/web/tree/13.0/web_pivot_computed_measure
: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-12-0/web-12-0-web_pivot_computed_measure :target: https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_pivot_computed_measure
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/12.0 :target: https://runbot.odoo-community.org/runbot/162/13.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -72,7 +72,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 smashing it by providing a detailed and welcomed If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_pivot_computed_measure%0Aversion:%2012.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_pivot_computed_measure%0Aversion:%2013.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.
@ -91,6 +91,7 @@ Contributors
* Alexandre D. Díaz * Alexandre D. Díaz
* Pedro M. Baeza * Pedro M. Baeza
* Ernesto Tejeda
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~
@ -105,6 +106,6 @@ 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. promote its widespread use.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.0/web_pivot_computed_measure>`_ project on GitHub. This module is part of the `OCA/web <https://github.com/OCA/web/tree/13.0/web_pivot_computed_measure>`_ 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

@ -4,13 +4,13 @@
{ {
"name": "Web Pivot Computed Measure", "name": "Web Pivot Computed Measure",
"category": "web", "category": "web",
"version": "12.0.1.0.2", "version": "13.0.1.0.0",
"author": "Tecnativa, " "Odoo Community Association (OCA)", "author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3", "license": "AGPL-3",
"website": "https://github.com/OCA/web", "website": "https://github.com/OCA/web",
"depends": ["web"], "depends": ["web"],
"data": ["view/assets.xml"], "data": ["view/assets.xml"],
"qweb": ["static/src/xml/web_pivot_computed_measure.xml",], "qweb": ["static/src/xml/web_pivot_computed_measure.xml"],
"auto_install": False, "auto_install": False,
"installable": True, "installable": True,
} }

View File

@ -1,6 +1,6 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * web_pivot_computed_measure # * web_pivot_computed_measure
# #
msgid "" msgid ""
msgstr "" msgstr ""
@ -18,135 +18,137 @@ msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:96 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Add" msgid "Add"
msgstr "Añadir" msgstr "Añadir"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:87 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Can be empty" msgid "Can be empty"
msgstr "Puede estar vacío" msgstr "Puede estar vacío"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:47 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Computed Measure" msgid "Computed Measure"
msgstr "Medida computada" msgstr "Medida computada"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:24 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Custom" msgid "Custom"
msgstr "Customizado" msgstr "Customizado"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:18 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Div (m1 / m2)" msgid "Div (m1 / m2)"
msgstr "Div (m1 / m2)" msgstr "Div (m1 / m2)"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:33 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Float" msgid "Float"
msgstr "Flotador" msgstr "Flotador"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:90 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Format" msgid "Format"
msgstr "Formato" msgstr "Formato"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:82 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Formula" msgid "Formula"
msgstr "Fórmula" msgstr "Fórmula"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:30 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Integer" msgid "Integer"
msgstr "Entero" msgstr "Entero"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:56 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Measure 1" msgid "Measure 1"
msgstr "Medida 1" msgstr "Medida 1"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:66 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Measure 2" msgid "Measure 2"
msgstr "Medida 2" msgstr "Medida 2"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:15 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Mult (m1 * m2)" msgid "Mult (m1 * m2)"
msgstr "Mult (m1 * m2)" msgstr "Mult (m1 * m2)"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:86 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Name" msgid "Name"
msgstr "Nombre" msgstr "Nombre"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:76 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Operation" msgid "Operation"
msgstr "Operación" msgstr "Operación"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:21 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Perc (m1 * 100 / m2)" msgid "Perc (m1 * 100 / m2)"
msgstr "Perc (m1 * 100 / m2)" msgstr "Perc (m1 * 100 / m2)"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:36 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Percentage" msgid "Percentage"
msgstr "Porcentaje" msgstr "Porcentaje"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:12 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Sub (m1 - m2)" msgid "Sub (m1 - m2)"
msgstr "Sub (m1 - m2)" msgstr "Sub (m1 - m2)"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:9 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Sum (m1 + m2)" msgid "Sum (m1 + m2)"
msgstr "Sum (m1 + m2)" msgstr "Sum (m1 + m2)"
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/js/pivot_model.js:275 #: code:addons/web_pivot_computed_measure/static/src/js/pivot_model.js:0
#, python-format #, python-format
msgid "This measure is currently used by a 'computed measure'. Please, disable the computed measure first." msgid ""
"This measure is currently used by a 'computed measure'. Please, disable the "
"computed measure first."
msgstr "" msgstr ""
"Esta medida está utilizada por una 'medida computada'. Por favor, desabilita " "Esta medida está utilizada por una 'medida computada'. Por favor, desabilita "
"la medida computada primero." "la medida computada primero."

View File

@ -1,12 +1,12 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * web_pivot_computed_measure # * web_pivot_computed_measure
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 12.0\n" "Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@ -15,134 +15,135 @@ msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:96 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Add" msgid "Add"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:87 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Can be empty" msgid "Can be empty"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:47 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Computed Measure" msgid "Computed Measure"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:24 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Custom" msgid "Custom"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:18 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Div (m1 / m2)" msgid "Div (m1 / m2)"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:33 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Float" msgid "Float"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:90 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Format" msgid "Format"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:82 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Formula" msgid "Formula"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:30 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Integer" msgid "Integer"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:56 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Measure 1" msgid "Measure 1"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:66 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Measure 2" msgid "Measure 2"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:15 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Mult (m1 * m2)" msgid "Mult (m1 * m2)"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:86 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Name" msgid "Name"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:76 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Operation" msgid "Operation"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:21 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Perc (m1 * 100 / m2)" msgid "Perc (m1 * 100 / m2)"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:36 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Percentage" msgid "Percentage"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:12 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Sub (m1 - m2)" msgid "Sub (m1 - m2)"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:9 #: code:addons/web_pivot_computed_measure/static/src/xml/web_pivot_computed_measure.xml:0
#, python-format #, python-format
msgid "Sum (m1 + m2)" msgid "Sum (m1 + m2)"
msgstr "" msgstr ""
#. module: web_pivot_computed_measure #. module: web_pivot_computed_measure
#. openerp-web #. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/js/pivot_model.js:275 #: code:addons/web_pivot_computed_measure/static/src/js/pivot_model.js:0
#, python-format #, python-format
msgid "This measure is currently used by a 'computed measure'. Please, disable the computed measure first." msgid ""
"This measure is currently used by a 'computed measure'. Please, disable the "
"computed measure first."
msgstr "" msgstr ""

View File

@ -2,3 +2,4 @@
* Alexandre D. Díaz * Alexandre D. Díaz
* Pedro M. Baeza * Pedro M. Baeza
* Ernesto Tejeda

View File

@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/web/tree/12.0/web_pivot_computed_measure"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_pivot_computed_measure"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/web/tree/13.0/web_pivot_computed_measure"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_pivot_computed_measure"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Adds support for computed measures on the pivot view.</p> <p>Adds support for computed measures on the pivot view.</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
@ -439,7 +439,7 @@ cant be deactivated until you have deactivate the computed measure.</p>
<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 smashing it by providing a detailed and welcomed If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_pivot_computed_measure%0Aversion:%2012.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_pivot_computed_measure%0Aversion:%2013.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">
@ -456,6 +456,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li><a class="reference external" href="https://www.tecnativa.com/">Tecnativa</a>:<ul> <li><a class="reference external" href="https://www.tecnativa.com/">Tecnativa</a>:<ul>
<li>Alexandre D. Díaz</li> <li>Alexandre D. Díaz</li>
<li>Pedro M. Baeza</li> <li>Pedro M. Baeza</li>
<li>Ernesto Tejeda</li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -467,7 +468,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<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>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_pivot_computed_measure">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/13.0/web_pivot_computed_measure">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

@ -4,11 +4,11 @@
odoo.define("web_pivot_computed_measure.PivotController", function(require) { odoo.define("web_pivot_computed_measure.PivotController", function(require) {
"use strict"; "use strict";
var core = require("web.core"); const core = require("web.core");
var config = require("web.config"); const config = require("web.config");
var PivotController = require("web.PivotController"); const PivotController = require("web.PivotController");
var QWeb = core.qweb; const QWeb = core.qweb;
PivotController.include({ PivotController.include({
custom_events: _.extend({}, PivotController.prototype.custom_events, { custom_events: _.extend({}, PivotController.prototype.custom_events, {
@ -24,10 +24,10 @@ odoo.define("web_pivot_computed_measure.PivotController", function(require) {
* *
* @override * @override
*/ */
getContext: function() { getOwnedQueryParams: function() {
var res = this._super.apply(this, arguments); const res = this._super.apply(this, arguments);
var state = this.model.get(); const state = this.model.get({raw: true});
res.pivot_computed_measures = state.computed_measures; res.context.pivot_computed_measures = state.computed_measures;
return res; return res;
}, },
@ -47,9 +47,9 @@ odoo.define("web_pivot_computed_measure.PivotController", function(require) {
* @override * @override
*/ */
_onButtonClick: function(event) { _onButtonClick: function(event) {
var $target = $(event.target); const $target = $(event.target);
if ($target.parents("div[data-id='__computed__']").length) { if ($target.parents("div[data-id='__computed__']").length) {
var hideMenu = false; let hideMenu = false;
event.preventDefault(); event.preventDefault();
if ( if (
@ -60,13 +60,13 @@ odoo.define("web_pivot_computed_measure.PivotController", function(require) {
this._renderComputedMeasures(); this._renderComputedMeasures();
} else if ($target.hasClass("o_add_computed_measure")) { } else if ($target.hasClass("o_add_computed_measure")) {
hideMenu = true; hideMenu = true;
var field1 = this.$buttons_measures_ex const field1 = this.$buttons_measures_ex
.find("#computed_measure_field_1") .find("#computed_measure_field_1")
.val(); .val();
var field2 = this.$buttons_measures_ex const field2 = this.$buttons_measures_ex
.find("#computed_measure_field_2") .find("#computed_measure_field_2")
.val(); .val();
var oper = this.$buttons_measures_ex let oper = this.$buttons_measures_ex
.find("#computed_measure_operation") .find("#computed_measure_operation")
.val(); .val();
if (oper === "custom") { if (oper === "custom") {
@ -74,13 +74,13 @@ odoo.define("web_pivot_computed_measure.PivotController", function(require) {
.find("#computed_measure_operation_custom") .find("#computed_measure_operation_custom")
.val(); .val();
} }
var name = this.$buttons_measures_ex const name = this.$buttons_measures_ex
.find("#computed_measure_name") .find("#computed_measure_name")
.val(); .val();
var format = this.$buttons_measures_ex const format = this.$buttons_measures_ex
.find("#computed_measure_format") .find("#computed_measure_format")
.val(); .val();
var uniqueId = new Date().getTime(); const uniqueId = new Date().getTime();
this.model this.model
.createComputedMeasure( .createComputedMeasure(
uniqueId, uniqueId,
@ -105,29 +105,28 @@ odoo.define("web_pivot_computed_measure.PivotController", function(require) {
/** /**
* Render computed measures menu * Render computed measures menu
*
* @private
*/ */
_renderComputedMeasures: function() { _renderComputedMeasures: function() {
if (this.$buttons_measures_ex && this.$buttons_measures_ex.length) { if (this.$buttons_measures_ex && this.$buttons_measures_ex.length) {
this.$buttons_measures_ex.remove(); this.$buttons_measures_ex.remove();
} }
var self = this; const measures = _.sortBy(_.pairs(_.omit(this.measures, "__count")), x => {
var measures = _.sortBy(_.pairs(_.omit(this.measures, "__count")), function(
x
) {
return x[1].string.toLowerCase(); return x[1].string.toLowerCase();
}); });
this.$buttons_measures_ex = $( this.$buttons_measures_ex = $(
QWeb.render("web_pivot_computed_measure.ExtendedMenu", { QWeb.render("web_pivot_computed_measure.ExtendedMenu", {
isOpen: this.computed_measures_open, isOpen: this.computed_measures_open,
debug: config.debug, debug: config.isDebug(),
measures: measures, measures: measures,
computed_measures: _.map( computed_measures: _.map(
_.reject(measures, function(item) { _.reject(measures, item => {
return !item[1].__computed_id; return !item[1].__computed_id;
}), }),
function(item) { item => {
item[1].active = _.contains( item[1].active = _.contains(
self.model.data.measures, this.model.data.measures,
item[0] item[0]
); );
return item; return item;
@ -138,14 +137,16 @@ odoo.define("web_pivot_computed_measure.PivotController", function(require) {
this.$buttons_measures_ex this.$buttons_measures_ex
.find("#computed_measure_operation") .find("#computed_measure_operation")
.on("change", this._onChangeComputedMeasureOperation.bind(this)); .on("change", this._onChangeComputedMeasureOperation.bind(this));
this.$buttons if (this.$buttons)
.find(".o_pivot_measures_list") this.$buttons
.append(this.$buttons_measures_ex); .find(".o_pivot_measures_list")
.append(this.$buttons_measures_ex);
}, },
/** /**
* Custom event to add a new measure * Custom event to add a new measure
* *
* @private
* @param {CustomEvent} ev * @param {CustomEvent} ev
*/ */
_onAddMeasure: function(ev) { _onAddMeasure: function(ev) {
@ -156,6 +157,7 @@ odoo.define("web_pivot_computed_measure.PivotController", function(require) {
/** /**
* Custom event to remove a measure * Custom event to remove a measure
* *
* @private
* @param {CustomEvent} ev * @param {CustomEvent} ev
*/ */
_onRemoveMeasure: function(ev) { _onRemoveMeasure: function(ev) {
@ -166,16 +168,17 @@ odoo.define("web_pivot_computed_measure.PivotController", function(require) {
/** /**
* Set default values related with the selected operation * Set default values related with the selected operation
* *
* @private
* @param {ChangeEvent} ev * @param {ChangeEvent} ev
*/ */
_onChangeComputedMeasureOperation: function(ev) { _onChangeComputedMeasureOperation: function(ev) {
var $option = $(ev.target.options[ev.target.selectedIndex]); const $option = $(ev.target.options[ev.target.selectedIndex]);
if ($(ev.target).val() === "custom") { if ($(ev.target).val() === "custom") {
this.$buttons_measures_ex this.$buttons_measures_ex
.find("#container_computed_measure_operation_custom") .find("#container_computed_measure_operation_custom")
.removeClass("d-none"); .removeClass("d-none");
} else { } else {
var format = $option.data("format"); const format = $option.data("format");
if (format) { if (format) {
this.$buttons_measures_ex this.$buttons_measures_ex
.find("#computed_measure_format") .find("#computed_measure_format")

View File

@ -4,11 +4,10 @@
odoo.define("web_pivot_computed_measure.PivotModel", function(require) { odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
"use strict"; "use strict";
var core = require("web.core"); const core = require("web.core");
var PivotModel = require("web.PivotModel"); const PivotModel = require("web.PivotModel");
var ComparisonUtils = require("web.dataComparisonUtils");
var _t = core._t; const _t = core._t;
PivotModel.include({ PivotModel.include({
_computed_measures: [], _computed_measures: [],
@ -22,9 +21,10 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
* @param {String} operation * @param {String} operation
* @param {String} name * @param {String} name
* @param {String} format * @param {String} format
* @returns a promise
*/ */
createComputedMeasure: function(id, field1, field2, operation, name, format) { createComputedMeasure: function(id, field1, field2, operation, name, format) {
var measure = _.find(this._computed_measures, function(item) { const measure = _.find(this._computed_measures, item => {
return ( return (
item.field1 === field1 && item.field1 === field1 &&
item.field2 === field2 && item.field2 === field2 &&
@ -32,15 +32,13 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
); );
}); });
if (measure) { if (measure) {
return $.Deferred(function(d) { return Promise.resolve();
d.resolve();
});
} }
var fieldM1 = this.fields[field1]; const fieldM1 = this.fields[field1];
var fieldM2 = this.fields[field2]; const fieldM2 = this.fields[field2];
var cmId = "__computed_" + id; const cmId = "__computed_" + id;
var oper = operation.replace(/m1/g, field1).replace(/m2/g, field2); const oper = operation.replace(/m1/g, field1).replace(/m2/g, field2);
var oper_human = operation const oper_human = operation
.replace( .replace(
/m1/g, /m1/g,
fieldM1.__computed_id ? "(" + fieldM1.string + ")" : fieldM1.string fieldM1.__computed_id ? "(" + fieldM1.string + ")" : fieldM1.string
@ -49,7 +47,7 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
/m2/g, /m2/g,
fieldM2.__computed_id ? "(" + fieldM2.string + ")" : fieldM2.string fieldM2.__computed_id ? "(" + fieldM2.string + ")" : fieldM2.string
); );
var cmTotal = this._computed_measures.push({ const cmTotal = this._computed_measures.push({
field1: field1, field1: field1,
field2: field2, field2: field2,
operation: oper, operation: oper,
@ -64,16 +62,21 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
/** /**
* Create and enable a measure based on a 'fake' field * Create and enable a measure based on a 'fake' field
* *
* @private
* @param {Object} cmDef * @param {Object} cmDef
* @param {List} fields *Optional* * @param {List} fields *Optional*
* @returns a promise
*/ */
_createVirtualMeasure: function(cmDef, fields) { _createVirtualMeasure: function(cmDef, fields) {
var arrFields = fields || this.fields; const arrFields = fields || this.fields;
// This is a minimal 'fake' field info // This is a minimal 'fake' field info
arrFields[cmDef.id] = { arrFields[cmDef.id] = {
type: cmDef.format, // Used to format the value // Used to format the value
string: cmDef.name, // Used to print the header name type: cmDef.format,
__computed_id: cmDef.id, // Used to know if is a computed measure field // Used to print the header name
string: cmDef.name,
// Used to know if is a computed measure field
__computed_id: cmDef.id,
}; };
this.trigger_up("add_measure", { this.trigger_up("add_measure", {
id: cmDef.id, id: cmDef.id,
@ -82,14 +85,13 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
return this._activeMeasures([cmDef.field1, cmDef.field2, cmDef.id]); return this._activeMeasures([cmDef.field1, cmDef.field2, cmDef.id]);
}, },
/** /*
* @private
* @param {List of Strings} fields * @param {List of Strings} fields
*/ */
_activeMeasures: function(fields) { _activeMeasures: function(fields) {
var needLoad = false; let needLoad = false;
var l = fields.length; for (const field of fields) {
for (var x = 0; x < l; ++x) {
var field = fields[x];
if (!this._isMeasureEnabled(field)) { if (!this._isMeasureEnabled(field)) {
this.data.measures.push(field); this.data.measures.push(field);
needLoad = true; needLoad = true;
@ -98,12 +100,11 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
if (needLoad) { if (needLoad) {
return this._loadData(); return this._loadData();
} }
return $.Deferred(function(d) { return Promise.resolve();
d.resolve();
});
}, },
/** /*
* @private
* @param {String} field * @param {String} field
*/ */
_isMeasureEnabled: function(field) { _isMeasureEnabled: function(field) {
@ -111,81 +112,56 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
}, },
/** /**
* Helper function to add computed measure fields data into 'dataPoint' * Helper function to add computed measure fields data into a 'subGroupData'
* *
* @param {Object} dataPoint * @private
* @param {Object} dataPointComp * @param {Object} subGroupData
*/ */
_fillComputedMeasuresData: function(dataPoint, dataPointComp) { _fillComputedMeasuresData: function(subGroupData) {
var self = this; for (const cm of this._computed_measures) {
_.each(this._computed_measures, function(cm) { if (!this._isMeasureEnabled(cm.id)) return;
if (!self._isMeasureEnabled(cm.id)) { if (subGroupData.__count === 0) {
return; subGroupData[cm.id] = false;
}
if (dataPointComp) {
var resData = py.eval(cm.operation, dataPointComp.data);
var resComparison = py.eval(cm.operation, dataPointComp.comparison);
dataPoint[cm.id] = {
data: resData,
comparisonData: resComparison,
variation: ComparisonUtils.computeVariation(
resData,
resComparison
),
};
} else { } else {
dataPoint[cm.id] = py.eval(cm.operation, dataPoint); // eslint-disable-next-line no-undef
subGroupData[cm.id] = py.eval(cm.operation, subGroupData);
} }
}); }
}, },
/** /**
* Fill the dataPoints with the computed measures values * Fill the groupSubdivisions with the computed measures and their values
* *
* @override * @override
*/ */
_mergeData: function(data, comparisonData, groupBys) { _prepareData: function(group, groupSubdivisions) {
var res = this._super.apply(this, arguments); for (const groupSubdivision of groupSubdivisions) {
var len = groupBys.length; // Cached loop (This is not python! hehe) for (const subGroup of groupSubdivision.subGroups) {
for (var index = 0; index < len; ++index) { this._fillComputedMeasuresData(subGroup);
if (res.length) {
var len2 = res[index].length;
for (var k = 0; k < len2; ++k) {
var dataPoint = res[index][k];
if (_.isEmpty(dataPoint)) {
break;
}
if ("__comparisonDomain" in dataPoint) {
// Transform comparison dataPoint object to be compatible
var pairsDataPoint = _.pairs(dataPoint);
var dataPointComp = {
data: _.object(
_.map(pairsDataPoint, item => {
return [item[0], item[1] && item[1].data];
})
),
comparison: _.object(
_.map(pairsDataPoint, item => {
return [
item[0],
item[1] && item[1].comparisonData,
];
})
),
};
// Update datas. Required by computed measures that uses
// other computed measures to work
this._fillComputedMeasuresData(dataPointComp.data);
this._fillComputedMeasuresData(dataPointComp.comparison);
// Update comparison dataPoint
this._fillComputedMeasuresData(dataPoint, dataPointComp);
} else {
// Update standard dataPoint
this._fillComputedMeasuresData(dataPoint);
}
}
} }
} }
this._super.apply(this, arguments);
},
/**
* _getGroupSubdivision method invokes the read_group method of the
* model via rpc and the passed 'fields' argument is the list of
* measure names that is in this.data.measures, so we remove the
* computed measures form this.data.measures before calling _super
* to prevent an exception
*
* @override
*/
_getGroupSubdivision: function() {
const computed_measures = [];
for (let i = 0; i < this.data.measures.length; i++)
if (this.data.measures[i].startsWith("__computed_")) {
computed_measures.push(this.data.measures[i]);
this.data.measures.splice(i, 1);
i--;
}
const res = this._super.apply(this, arguments);
$.merge(this.data.measures, computed_measures);
return res; return res;
}, },
@ -195,15 +171,12 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
* @override * @override
*/ */
load: function(params) { load: function(params) {
var self = this;
this._computed_measures = this._computed_measures =
params.context.pivot_computed_measures || params.context.pivot_computed_measures ||
params.computed_measures || params.computed_measures ||
[]; [];
var toActive = []; const toActive = [];
var l = this._computed_measures.length; for (const cmDef of this._computed_measures) {
for (var x = 0; x < l; ++x) {
var cmDef = this._computed_measures[x];
params.fields[cmDef.id] = { params.fields[cmDef.id] = {
type: cmDef.format, type: cmDef.format,
string: cmDef.name, string: cmDef.name,
@ -211,17 +184,16 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
}; };
toActive.push(cmDef.field1, cmDef.field2, cmDef.id); toActive.push(cmDef.field1, cmDef.field2, cmDef.id);
} }
return this._super(params).then(function() { return this._super(params).then(() => {
_.defer(function() { _.defer(() => {
for (var x = 0; x < l; ++x) { for (const cmDef of this._computed_measures) {
var cmDef = self._computed_measures[x]; this.trigger_up("add_measure", {
self.trigger_up("add_measure", {
id: cmDef.id, id: cmDef.id,
def: self.fields[cmDef.id], def: this.fields[cmDef.id],
}); });
} }
}); });
self._activeMeasures(toActive); this._activeMeasures(toActive);
}); });
}, },
@ -237,24 +209,21 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
params.computed_measures || params.computed_measures ||
[]; [];
} }
var l = this._computed_measures.length; for (const cmDef of this._computed_measures) {
for (var x = 0; x < l; ++x) { this._createVirtualMeasure(cmDef);
this._createVirtualMeasure(this._computed_measures[x]);
} }
// Clean unused 'fake' fields const fieldNames = Object.keys(this.fields);
var fieldNames = Object.keys(this.fields); for (const fieldName of fieldNames) {
for (var x = 0; x < fieldNames.length; ++x) { const field = this.fields[fieldName];
var field = this.fields[fieldNames[x]];
if (field.__computed_id) { if (field.__computed_id) {
var cm = _.find(this._computed_measures, {id: field.__computed_id}); const cm = _.find(this._computed_measures, {
id: field.__computed_id,
});
if (!cm) { if (!cm) {
delete this.fields[fieldNames[x]]; delete this.fields[fieldName];
this.data.measures = _.without( this.data.measures = _.without(this.data.measures, fieldName);
this.data.measures,
fieldNames[x]
);
this.trigger_up("remove_measure", { this.trigger_up("remove_measure", {
id: fieldNames[x], id: fieldName,
}); });
} }
} }
@ -268,7 +237,7 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
* @override * @override
*/ */
get: function() { get: function() {
var res = this._super.apply(this, arguments); const res = this._super.apply(this, arguments);
res.computed_measures = this._computed_measures; res.computed_measures = this._computed_measures;
return res; return res;
}, },
@ -282,31 +251,29 @@ odoo.define("web_pivot_computed_measure.PivotModel", function(require) {
toggleMeasure: function(field) { toggleMeasure: function(field) {
if (this._isMeasureEnabled(field)) { if (this._isMeasureEnabled(field)) {
// Measure is disabled // Measure is disabled
var umeasures = _.filter(this._computed_measures, function(item) { const umeasures = _.filter(this._computed_measures, item => {
return item.field1 === field || item.field2 === field; return item.field1 === field || item.field2 === field;
}); });
if (umeasures.length && this._isMeasureEnabled(umeasures[0].id)) { if (umeasures.length && this._isMeasureEnabled(umeasures[0].id)) {
return $.Deferred(function(d) { return Promise.reject(
d.reject( _t(
_t( "This measure is currently used by a 'computed measure'. Please, disable the computed measure first."
"This measure is currently used by a 'computed measure'. Please, disable the computed measure first." )
) );
);
});
} }
} else { } else {
// Mesaure is enabled // Mesaure is enabled
var toEnable = []; const toEnable = [];
var toAnalize = [field]; const toAnalize = [field];
while (toAnalize.length) { while (toAnalize.length) {
var afield = toAnalize.shift(); const afield = toAnalize.shift();
var fieldDef = this.fields[afield]; const fieldDef = this.fields[afield];
if (fieldDef.__computed_id) { if (fieldDef.__computed_id) {
var cm = _.find(this._computed_measures, { const cm = _.find(this._computed_measures, {
id: fieldDef.__computed_id, id: fieldDef.__computed_id,
}); });
toAnalize.push(cm.field1, cm.field2); toAnalize.push(cm.field1, cm.field2);
var toEnableFields = []; const toEnableFields = [];
if (!this.fields[cm.field1].__computed_id) { if (!this.fields[cm.field1].__computed_id) {
toEnableFields.push(cm.field1); toEnableFields.push(cm.field1);
} }