Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing from upstream OCA/web (16.0) #1233

Merged
merged 24 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1cee9f4
[ADD] web_pivot_computed_measure
Tardo Mar 10, 2020
1dbdf5d
[IMP+FIX] web_pivot_computed_measure: Time Ranges Comparison + Change…
Tardo Apr 2, 2020
415ecfe
[FIX] web_pivot_computed_measure: Proper trailing line in RST
pedrobaeza Apr 23, 2020
5cde5a7
Added translation using Weblate (Spanish)
claudiagn Sep 16, 2020
d1a044b
[IMP] web_pivot_computed_measure: black, isort, prettier
Oct 9, 2020
833aea9
[MIG] web_pivot_computed_measure: Migration to 13.0
Nov 17, 2020
c120cb8
[IMP] web_pivot_computed_measure: Saving vertical space
Dec 2, 2020
ac22fa8
Added translation using Weblate (Catalan)
jabelchi Jul 5, 2021
bb8562d
[IMP] web_pivot_computed_measure: black, isort, prettier
CarlosRoca13 Nov 9, 2022
b481279
[MIG] web_pivot_computed_measure: Migration to 15.0
CarlosRoca13 Nov 22, 2022
56a9239
[UPD] Update web_pivot_computed_measure.pot
Mar 1, 2023
c743df7
[FIX] web_pivot_computed_measure: Error when using filter created wit…
CarlosRoca13 May 9, 2023
649e206
[FIX] web_pivot_computed_measure: Not found measures whan changing to…
CarlosRoca13 May 18, 2023
24a3669
[FIX] web_pivot_computed_measure: Use config instead of perform loadData
CarlosRoca13 May 22, 2023
12ddf19
[FIX] web_pivot_computed_measure: Error when computed measure takes I…
CarlosRoca13 Jun 7, 2023
89db60c
Update translation files
weblate Oct 9, 2023
6b5fbfb
Translated using Weblate (Spanish)
Ivorra78 Nov 19, 2023
c5f5c72
[FIX] web_pivot_computed_measure: Use js eval to avoid different type…
CarlosRoca13 Nov 21, 2023
1529a7b
[IMP] web_pivot_computed_measure: Function that eval operations
CarlosRoca13 Nov 27, 2023
1ea97cc
[IMP] web_pivot_computed_measure: pre-commit stuff
CarlosRoca13 Feb 26, 2024
8bf89cf
[MIG] web_pivot_computed_measure: Migration to 16.0
CarlosRoca13 Feb 27, 2024
65fa9a6
Merge PR #2755 into 16.0
OCA-git-bot Feb 28, 2024
ddb6586
[UPD] Update web_pivot_computed_measure.pot
Feb 28, 2024
e422de2
[BOT] post-merge updates
OCA-git-bot Feb 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ addon | version | maintainers | summary
[web_no_bubble](web_no_bubble/) | 16.0.1.0.0 | | Remove the bubbles from the web interface
[web_notify](web_notify/) | 16.0.1.0.1 | | Send notification messages to user
[web_notify_channel_message](web_notify_channel_message/) | 16.0.1.0.0 | | Send an instant notification to channel users when a new message is posted
[web_pivot_computed_measure](web_pivot_computed_measure/) | 16.0.1.0.0 | [![CarlosRoca13](https://github.com/CarlosRoca13.png?size=30px)](https://github.com/CarlosRoca13) | Web Pivot Computed Measure
[web_pwa_oca](web_pwa_oca/) | 16.0.1.0.0 | [![eLBati](https://github.com/eLBati.png?size=30px)](https://github.com/eLBati) | Make Odoo a PWA
[web_refresher](web_refresher/) | 16.0.2.0.1 | | Web Refresher
[web_remember_tree_column_width](web_remember_tree_column_width/) | 16.0.1.0.1 | [![frahikLV](https://github.com/frahikLV.png?size=30px)](https://github.com/frahikLV) [![luisg123v](https://github.com/luisg123v.png?size=30px)](https://github.com/luisg123v) [![cuongnmtm](https://github.com/cuongnmtm.png?size=30px)](https://github.com/cuongnmtm) | Remember the tree columns' widths across sessions.
Expand Down
2 changes: 1 addition & 1 deletion setup/_metapackage/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.0.20240227.0
16.0.20240228.0
1 change: 1 addition & 0 deletions setup/_metapackage/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'odoo-addon-web_no_bubble>=16.0dev,<16.1dev',
'odoo-addon-web_notify>=16.0dev,<16.1dev',
'odoo-addon-web_notify_channel_message>=16.0dev,<16.1dev',
'odoo-addon-web_pivot_computed_measure>=16.0dev,<16.1dev',
'odoo-addon-web_pwa_oca>=16.0dev,<16.1dev',
'odoo-addon-web_refresher>=16.0dev,<16.1dev',
'odoo-addon-web_remember_tree_column_width>=16.0dev,<16.1dev',
Expand Down
6 changes: 6 additions & 0 deletions setup/web_pivot_computed_measure/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
odoo-test-helper
124 changes: 124 additions & 0 deletions web_pivot_computed_measure/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
==========================
Web Pivot Computed Measure
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4cef60dd775467b756ccbacb8c215bba0bc74fd32e1917c8b15c3be9de6302a1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/16.0/web_pivot_computed_measure
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_pivot_computed_measure
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Adds support for computed measures on the pivot view.

**Table of contents**

.. contents::
:local:

Usage
=====

Go to pivot view and click on the "Measures" menu, you will see
a new option called 'Computed Measure'.

You have the follow options to create a 'computed measure':
- Measure 1: Used in 'operation formula' as 'm1'
- Measure 2: Used in 'operation formula' as 'm2'
- Operation: The formula
- Sum: m1 + m2
- Sub: m1 - m2
- Mult: m1 * m2
- Div: m1 / m2 (Format: Float)
- Perc m1 / m2 (Format: Percentage)
- Custom: Special option only visible in debug mode to write a custom formula.
- Name: The name of the new measure (emtpy = auto-generated)
- Format: How will the value be printed
- Integer
- Float
- Percentage (value * 100)
- Formula*: Custom operation formula
These formula is evaluated using 'PY.eval'

These computed measures can be mixed (You can reuse it to make new computed measures) and saved as favorites.

Notice that "measures/computed measures" involved in an active 'computed measure'
can't be deactivated until you have deactivate the 'computed measure'.

Known issues / Roadmap
======================

#. Add support to define a style for a computed measure (ex. colored)
#. Use t-model to data-binding instead of jquery selectors

Bug Tracker
===========

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.
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_pivot_computed_measure%0Aversion:%2016.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.

Credits
=======

Authors
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com/>`_:

* Alexandre D. Díaz
* Pedro M. Baeza
* Ernesto Tejeda
* Carlos Roca

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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-CarlosRoca13| image:: https://github.com/CarlosRoca13.png?size=40px
:target: https://github.com/CarlosRoca13
:alt: CarlosRoca13

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-CarlosRoca13|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Empty file.
25 changes: 25 additions & 0 deletions web_pivot_computed_measure/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2020 Tecnativa - Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{
"name": "Web Pivot Computed Measure",
"category": "web",
"version": "16.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/web",
"depends": ["web"],
"auto_install": False,
"installable": True,
"maintainers": ["CarlosRoca13"],
"assets": {
"web.assets_backend": [
"/web_pivot_computed_measure/static/src/**/*.esm.js",
"/web_pivot_computed_measure/static/src/**/*.scss",
("remove", "/web_pivot_computed_measure/static/src/test/*.esm.js"),
"/web_pivot_computed_measure/static/src/**/*.xml",
],
"web.assets_tests": [
"/web_pivot_computed_measure/static/src/test/test.esm.js",
],
},
}
161 changes: 161 additions & 0 deletions web_pivot_computed_measure/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_pivot_computed_measure
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-07-05 12:48+0000\n"
"Last-Translator: jabelchi <[email protected]>\n"
"Language-Team: none\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/view.xml:0
#, python-format
msgid "!measure.startsWith('__computed_')"
msgstr ""

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Add"
msgstr "Afegir"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Can be empty"
msgstr "Pot estar buit"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Computed Measure"
msgstr "Mesura calculada"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Custom"
msgstr "Personalitat"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Div (m1 / m2)"
msgstr "Div (m1 / m2)"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Float"
msgstr "Comma flotant"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Format"
msgstr "Format"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Formula"
msgstr "Fórmula"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Integer"
msgstr "Enter"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Measure 1"
msgstr "Mesura 1"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Measure 2"
msgstr "Mesura 2"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Mult (m1 * m2)"
msgstr "Mult (m1 * m2)"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Name"
msgstr "Nom"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Operation"
msgstr "Operació"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Perc (m1 * 100 / m2)"
msgstr "Perc (m1 * 100 / m2)"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Percentage"
msgstr "Percentatge"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Sub (m1 - m2)"
msgstr "Resta (m1 - m2)"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/dropdown_item_custom_measure/dropdown_item_custom_measure.xml:0
#, python-format
msgid "Sum (m1 + m2)"
msgstr "Suma (m1 + m2)"

#. module: web_pivot_computed_measure
#. openerp-web
#: code:addons/web_pivot_computed_measure/static/src/pivot/pivot_model.esm.js:0
#, python-format
msgid ""
"This measure is currently used by a 'computed measure'. Please, disable the "
"computed measure first."
msgstr ""
"Aquesta mesura s'usa actualment per una \"mesura calculada\". Si us plau, "
"inhabiliteu primer la mesura calculada."
Loading
Loading