You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.4 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ========================
  5. Formulas in Float Fields
  6. ========================
  7. This module allows the use of simple math formulas in integer/float fields
  8. (e.g. "=45 + 4/3 - 5 * (2 + 1)").
  9. * Only supports parentheses, decimal points, thousands separators, and the
  10. operators "+", "-", "*", and "/"
  11. * Will use the decimal point and thousands separator characters associated
  12. with your language
  13. * If the formula is valid, the result will be computed and displayed, and the
  14. formula will be stored for editing
  15. * If the formula is not valid, it's retained in the field as text
  16. **Technical Details**
  17. * Overloads web.form_widgets.FieldFloat (so it works for fields.integer &
  18. fields.float)
  19. * Uses the eval() JS function to evaluate the formula
  20. * Does not do any rounding (this is handled elsewhere)
  21. * Avoids code injection by applying strict regex to formula prior to eval()
  22. (e.g. "=alert('security')" would not get evaluated)
  23. Installation
  24. ============
  25. To install this module, simply follow the standard install process.
  26. Configuration
  27. =============
  28. No configuration is needed or possible.
  29. Usage
  30. =====
  31. Install and enjoy. A short demo video can be found at
  32. http://www.youtube.com/watch?v=jQGdD34WYrA.
  33. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  34. :alt: Try me on Runbot
  35. :target: https://runbot.odoo-community.org/runbot/162/10.0
  36. Known Issues / Roadmap
  37. ======================
  38. Bug Tracker
  39. ===========
  40. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
  41. In case of trouble, please check there if your issue has already been reported.
  42. If you spotted it first, help us smash it by providing detailed and welcomed
  43. feedback.
  44. Credits
  45. =======
  46. Contributors
  47. ------------
  48. * Sylvain Le Gal (https://twitter.com/legalsylvain)
  49. * Oleg Bulkin <o.bulkin@gmail.com>
  50. Maintainer
  51. ----------
  52. .. image:: http://odoo-community.org/logo.png
  53. :alt: Odoo Community Association
  54. :target: http://odoo-community.org
  55. This module is maintained by the OCA.
  56. OCA, or the Odoo Community Association, is a nonprofit organization whose
  57. mission is to support the collaborative development of Odoo features and
  58. promote its widespread use.
  59. To contribute to this module, please visit http://odoo-community.org.