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.

73 lines
2.2 KiB

  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # Author: Damien Crier
  5. # Copyright 2015 Camptocamp SA
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as
  9. # published by the Free Software Foundation, either version 3 of the
  10. # License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. ##############################################################################
  21. {
  22. "name": "Web warning on save",
  23. "version": "1.0",
  24. "depends": ['web'],
  25. "author": "Camptocamp,Odoo Community Association (OCA)",
  26. 'license': 'AGPL-3',
  27. 'website': 'http://www.camptocamp.com',
  28. 'description': """
  29. This module was written to extend the functionality of
  30. saving a record in the web interface.
  31. .. warning::
  32. In no way this module stops the save of the record.
  33. You must consider this as a warning displayed
  34. to the user AFTER save completed.
  35. If you don't want OpenERP to save the record, you should use constraints.
  36. Usage
  37. =====
  38. To use this module, you need to:
  39. * write a method called 'check_warning_on_save' which will make some checks
  40. and return a string
  41. example :
  42. def check_warning_on_save(self, cr, uid, id, context=None):
  43. '''
  44. @param: int: record_id
  45. @return: string: message that should be displayed to the user
  46. '''
  47. res = ""
  48. record = self.browse(cr, uid, id, context=context)
  49. # ... make some checks
  50. return res
  51. """,
  52. 'data': [
  53. ],
  54. 'js': [
  55. 'static/src/js/web_warning_on_save.js',
  56. ],
  57. 'css': [
  58. ],
  59. 'qweb': [
  60. ],
  61. 'installable': True,
  62. 'auto_install': False,
  63. }