Web Widget - Formulas in Float Fields

Technical Name:
web_widget_float_formula
License:
Author:
GRAP
https://odoo-community.org/web/image/product.template/2833/image_1920?unique=a659a3a
  • Odoo Version

Terms and Conditions 

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;

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;

Contacts :

This is a preview of the recently viewed products by the user.
Once the user has seen at least one product this snippet will be visible.

Recently viewed Products