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.

78 lines
2.1 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :alt: License: AGPL-3
  3. Raise warning when saving
  4. =========================
  5. This module was written to extend the functionality of saving a record in the web interface.
  6. /!\\/!\\/!\\
  7. In no way this module stops the save of the record. You must consider this as a warning displayed
  8. to the user AFTER save completed.
  9. /!\\/!\\/!\\
  10. If you don't want OpenERP to save the record, you should use constraints.
  11. Usage
  12. =====
  13. To use this module, you need to:
  14. * write a method called 'check_warning_on_save' which will make some checks and return a string
  15. example :
  16. .. code:: python
  17. def check_warning_on_save(self, cr, uid, id, context=None):
  18. """
  19. @param: int: record_id
  20. @return: string: message that should be displayed to the user
  21. """
  22. res = ""
  23. record = self.browse(cr, uid, id, context=context)
  24. # ... make some checks
  25. return res
  26. For further information, please visit:
  27. * https://www.odoo.com/forum/help-1
  28. Bug Tracker
  29. ===========
  30. Bugs are tracked on `GitHub Issues <https://github.com/OCA/{project_repo}/issues>`_.
  31. In case of trouble, please check there if your issue has already been reported.
  32. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  33. `here <https://github.com/OCA/web/issues/new?body=module:%20web_warning_on_save%0Aversion:%207.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  34. Credits
  35. =======
  36. Contributors
  37. ------------
  38. * Damien Crier <damien.crier@camptocamp.com>
  39. * Vincent Renaville <vincent.renaville@camptocamp.com>
  40. Maintainer
  41. ----------
  42. .. image:: https://odoo-community.org/logo.png
  43. :alt: Odoo Community Association
  44. :target: https://odoo-community.org
  45. This module is maintained by the OCA.
  46. OCA, or the Odoo Community Association, is a nonprofit organization whose
  47. mission is to support the collaborative development of Odoo features and
  48. promote its widespread use.
  49. To contribute to this module, please visit http://odoo-community.org.