Skip to content

Commit

Permalink
Merge PR #1547 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by Yajo
  • Loading branch information
OCA-git-bot committed Mar 23, 2020
2 parents a432e73 + 48a69be commit 9f295f5
Show file tree
Hide file tree
Showing 12 changed files with 1,152 additions and 0 deletions.
110 changes: 110 additions & 0 deletions web_pivot_computed_measure/README.rst
@@ -0,0 +1,110 @@
==========================
Web Pivot Computed Measure
==========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/12.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-12-0/web-12-0-web_pivot_computed_measure
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/12.0
:alt: Try me on Runbot

|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)

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 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**>`_.

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

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.

This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.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.
21 changes: 21 additions & 0 deletions web_pivot_computed_measure/__manifest__.py
@@ -0,0 +1,21 @@
# 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': "12.0.1.0.0",
'author': "Tecnativa, "
"Odoo Community Association (OCA)",
'license': 'AGPL-3',
'website': 'https://github.com/OCA/web',
'depends': ['web'],
'data': [
'view/assets.xml'
],
'qweb': [
'static/src/xml/web_pivot_computed_measure.xml',
],
'auto_install': False,
'installable': True,
}
4 changes: 4 additions & 0 deletions web_pivot_computed_measure/readme/CONTRIBUTORS.rst
@@ -0,0 +1,4 @@
* `Tecnativa <https://www.tecnativa.com/>`_:

* Alexandre D. Díaz
* Pedro M. Baeza
1 change: 1 addition & 0 deletions web_pivot_computed_measure/readme/DESCRIPTION.rst
@@ -0,0 +1 @@
Adds support for computed measures on the pivot view
1 change: 1 addition & 0 deletions web_pivot_computed_measure/readme/ROADMAP.rst
@@ -0,0 +1 @@
#. Add support to define a style for a computed measure (ex. colored)
25 changes: 25 additions & 0 deletions web_pivot_computed_measure/readme/USAGE.rst
@@ -0,0 +1,25 @@
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'.

0 comments on commit 9f295f5

Please sign in to comment.