Browse Source

Merge pull request #182 from grap/8.0_PORT_web_widget_float_formula

[PORT][8.0] port web_widget_float_formula
pull/181/merge
Sylvain LE GAL 9 years ago
parent
commit
e2636e1949
  1. 63
      __unported__/web_widget_float_formula/__openerp__.py
  2. 55
      web_widget_float_formula/README.rst
  3. 4
      web_widget_float_formula/__init__.py
  4. 18
      web_widget_float_formula/__openerp__.py
  5. 0
      web_widget_float_formula/static/description/icon.png
  6. 0
      web_widget_float_formula/static/src/js/models.js
  7. 9
      web_widget_float_formula/views/qweb.xml

63
__unported__/web_widget_float_formula/__openerp__.py

@ -1,63 +0,0 @@
# -*- encoding: utf-8 -*-
################################################################################
# See Copyright and Licence Informations undermentioned.
################################################################################
{
'name': 'Web Widget - Formulas in Float fields',
'version': '1.0',
'category': 'web',
'description': """
Allow to write simple mathematic formulas in Integer / Float fields
===================================================================
Functionnalities:
------------------
* Possibility to tip a text like "=45 + 4/3 - 5 * (2 +1)";
* if the formula is correct, The result will be computed and displayed;
* if the formula is not correct, the initial text is displayed;
Documentations:
------------------
* Video: http://www.youtube.com/watch?v=jQGdD34WYrA&hd=1
Technical informations:
------------------------
* Overloads "instance.web.form.FieldFloat"; (so works for fields.integer & fields.float);
* To compute, the module simply use the eval() javascript function;
* Rounding computation is not done by this module (The module has the same behaviour if the user tips "=1/3" or if he tips "0.33[...]");
* avoid code injonction by regexpr test: "=alert('security')" is not valid;
Limits:
--------
* Only supports the four operators: "+" "-" "*" "/" and parenthesis;
Copyright and Licence:
-----------------------
* 2013, Groupement Régional Alimentaire de Proximité (http://www.grap.coop/)
* Licence: AGPL-3 (http://www.gnu.org/licenses/)
Contacts :
----------
* Sylvain LE GAL (https://twitter.com/legalsylvain);
* <informatique@grap.coop> for any help or question about this module.
""",
'author': "GRAP,Odoo Community Association (OCA)",
'website': 'http://www.grap.coop',
'license': 'AGPL-3',
'depends': [
'web',
],
'data': [],
'demo': [],
'js': [
'static/src/js/models.js',
],
'css': [],
'qweb': [],
'images': [],
'post_load': '',
'application': False,
'installable': False,
'auto_install': False,
'images': [],
}

55
web_widget_float_formula/README.rst

@ -0,0 +1,55 @@
Allow to write simple mathematic formulas in Integer / Float fields
===================================================================
* Possibility to tip a text like "=45 + 4/3 - 5 * (2 +1)";
* if the formula is correct, The result will be computed and displayed;
* if the formula is not correct, the initial text is displayed;
Technical informations
----------------------
* Overloads "instance.web.form.FieldFloat"; (so works for fields.integer &
fields.float);
* To compute, the module simply use the eval() javascript function;
* Rounding computation is not done by this module (The module has the same
behaviour if the user tips "=1/3" or if he tips "0.33[...]");
* avoid code injonction by regexpr test: "=alert('security')" is not valid;
Usage
=====
See demo here Video: http://www.youtube.com/watch?v=jQGdD34WYrA&hd=1
Roadmap / Limit
===============
* Only supports the four operators: "+" "-" "*" "/" and parenthesis;
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
`here <https://github.com/OCA/web/issues/new?body=module:%20web_widget_float_formula%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Sylvain Le Gal (https://twitter.com/legalsylvain)
Maintainer
----------
.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
This module is maintained by the OCA.
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.
To contribute to this module, please visit http://odoo-community.org.

4
__unported__/web_widget_float_formula/__init__.py → web_widget_float_formula/__init__.py

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
################################################################################
###############################################################################
# See __openerp__.py file for Copyright and Licence Informations.
################################################################################
###############################################################################

18
web_widget_float_formula/__openerp__.py

@ -0,0 +1,18 @@
# -*- encoding: utf-8 -*-
###############################################################################
# See Copyright and Licence Informations undermentioned.
###############################################################################
{
'name': 'Web Widget - Formulas in Float fields',
'version': '1.0',
'category': 'web',
'author': 'GRAP,Odoo Community Association (OCA)',
'website': 'http://www.grap.coop',
'license': 'AGPL-3',
'depends': [
'web',
],
'data': [
'views/qweb.xml',
],
}

0
__unported__/web_widget_float_formula/static/src/img/icon.png → web_widget_float_formula/static/description/icon.png

Before

Width: 128  |  Height: 128  |  Size: 3.0 KiB

After

Width: 128  |  Height: 128  |  Size: 3.0 KiB

0
__unported__/web_widget_float_formula/static/src/js/models.js → web_widget_float_formula/static/src/js/models.js

9
web_widget_float_formula/views/qweb.xml

@ -0,0 +1,9 @@
<openerp>
<data>
<template id="assets_backend" name="web_widget_float_formula assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_widget_float_formula/static/src/js/models.js"></script>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save