From d33f4656e189e6c68dd585d0c0a951fdb5fd6985 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 17 Jul 2015 16:43:09 +0200 Subject: [PATCH 1/3] [PORT][WIP] move web_widget_float_formula from 'unported' folder; --- .../__init__.py | 0 .../__openerp__.py | 0 .../static/src/img/icon.png | Bin .../static/src/js/models.js | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {__unported__/web_widget_float_formula => web_widget_float_formula}/__init__.py (100%) rename {__unported__/web_widget_float_formula => web_widget_float_formula}/__openerp__.py (100%) rename {__unported__/web_widget_float_formula => web_widget_float_formula}/static/src/img/icon.png (100%) rename {__unported__/web_widget_float_formula => web_widget_float_formula}/static/src/js/models.js (100%) diff --git a/__unported__/web_widget_float_formula/__init__.py b/web_widget_float_formula/__init__.py similarity index 100% rename from __unported__/web_widget_float_formula/__init__.py rename to web_widget_float_formula/__init__.py diff --git a/__unported__/web_widget_float_formula/__openerp__.py b/web_widget_float_formula/__openerp__.py similarity index 100% rename from __unported__/web_widget_float_formula/__openerp__.py rename to web_widget_float_formula/__openerp__.py diff --git a/__unported__/web_widget_float_formula/static/src/img/icon.png b/web_widget_float_formula/static/src/img/icon.png similarity index 100% rename from __unported__/web_widget_float_formula/static/src/img/icon.png rename to web_widget_float_formula/static/src/img/icon.png diff --git a/__unported__/web_widget_float_formula/static/src/js/models.js b/web_widget_float_formula/static/src/js/models.js similarity index 100% rename from __unported__/web_widget_float_formula/static/src/js/models.js rename to web_widget_float_formula/static/src/js/models.js From 6977562d36edc8d9320d2f4838df8a5aa677be61 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 17 Jul 2015 16:45:13 +0200 Subject: [PATCH 2/3] [PORT][WIP] 'web_widget_float_formula' : recover last changes from 7.0 branch; --- web_widget_float_formula/__init__.py | 4 ++-- web_widget_float_formula/__openerp__.py | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/web_widget_float_formula/__init__.py b/web_widget_float_formula/__init__.py index 97833ca3..41a41f91 100644 --- a/web_widget_float_formula/__init__.py +++ b/web_widget_float_formula/__init__.py @@ -1,4 +1,4 @@ # -*- encoding: utf-8 -*- -################################################################################ +############################################################################### # See __openerp__.py file for Copyright and Licence Informations. -################################################################################ +############################################################################### diff --git a/web_widget_float_formula/__openerp__.py b/web_widget_float_formula/__openerp__.py index 9f004bbd..ba90a4b5 100644 --- a/web_widget_float_formula/__openerp__.py +++ b/web_widget_float_formula/__openerp__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- -################################################################################ +############################################################################### # See Copyright and Licence Informations undermentioned. -################################################################################ +############################################################################### { 'name': 'Web Widget - Formulas in Float fields', 'version': '1.0', @@ -22,9 +22,11 @@ Documentations: Technical informations: ------------------------ - * Overloads "instance.web.form.FieldFloat"; (so works for fields.integer & fields.float); + * 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[...]"); + * 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: @@ -33,7 +35,8 @@ Limits: Copyright and Licence: ----------------------- - * 2013, Groupement Régional Alimentaire de Proximité (http://www.grap.coop/) + * 2013, Groupement Régional Alimentaire de Proximité + (http://www.grap.coop/) * Licence: AGPL-3 (http://www.gnu.org/licenses/) Contacts : @@ -46,7 +49,7 @@ Contacts : 'license': 'AGPL-3', 'depends': [ 'web', - ], + ], 'data': [], 'demo': [], 'js': [ @@ -57,7 +60,7 @@ Contacts : 'images': [], 'post_load': '', 'application': False, - 'installable': False, + 'installable': True, 'auto_install': False, 'images': [], } From ffda79ad79f7896a900916ec5913af9b0b2f562f Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 17 Jul 2015 17:10:40 +0200 Subject: [PATCH 3/3] [PORT][REF] icon in description folder; move module description into readme file; use qweb file to include js file; --- web_widget_float_formula/README.rst | 55 ++++++++++++++++++ web_widget_float_formula/__openerp__.py | 54 +---------------- .../static/{src/img => description}/icon.png | Bin web_widget_float_formula/views/qweb.xml | 9 +++ 4 files changed, 67 insertions(+), 51 deletions(-) create mode 100644 web_widget_float_formula/README.rst rename web_widget_float_formula/static/{src/img => description}/icon.png (100%) create mode 100644 web_widget_float_formula/views/qweb.xml diff --git a/web_widget_float_formula/README.rst b/web_widget_float_formula/README.rst new file mode 100644 index 00000000..83b7c132 --- /dev/null +++ b/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 `_. +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 `_. + +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. + diff --git a/web_widget_float_formula/__openerp__.py b/web_widget_float_formula/__openerp__.py index ba90a4b5..8009976e 100644 --- a/web_widget_float_formula/__openerp__.py +++ b/web_widget_float_formula/__openerp__.py @@ -6,61 +6,13 @@ '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); - * for any help or question about this module. - """, - 'author': "GRAP,Odoo Community Association (OCA)", + 'author': 'GRAP,Odoo Community Association (OCA)', 'website': 'http://www.grap.coop', 'license': 'AGPL-3', 'depends': [ 'web', ], - 'data': [], - 'demo': [], - 'js': [ - 'static/src/js/models.js', + 'data': [ + 'views/qweb.xml', ], - 'css': [], - 'qweb': [], - 'images': [], - 'post_load': '', - 'application': False, - 'installable': True, - 'auto_install': False, - 'images': [], } diff --git a/web_widget_float_formula/static/src/img/icon.png b/web_widget_float_formula/static/description/icon.png similarity index 100% rename from web_widget_float_formula/static/src/img/icon.png rename to web_widget_float_formula/static/description/icon.png diff --git a/web_widget_float_formula/views/qweb.xml b/web_widget_float_formula/views/qweb.xml new file mode 100644 index 00000000..b7467559 --- /dev/null +++ b/web_widget_float_formula/views/qweb.xml @@ -0,0 +1,9 @@ + + + + +