From a5dfee75b67e525c36a0d159e05ee869becc2d84 Mon Sep 17 00:00:00 2001 From: Damien Crier Date: Mon, 8 Jun 2015 09:07:15 +0200 Subject: [PATCH] [FIX] fix according to review --- web_warning_on_save/README.rst | 20 ++----------------- web_warning_on_save/__init__.py | 2 +- web_warning_on_save/__openerp__.py | 31 +++++++++++++++++++++++++++++- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/web_warning_on_save/README.rst b/web_warning_on_save/README.rst index 60333530..b35968aa 100644 --- a/web_warning_on_save/README.rst +++ b/web_warning_on_save/README.rst @@ -1,26 +1,13 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg :alt: License: AGPL-3 -Module name +web_warning_on_save =========== This module was written to extend the functionality of saving a record in the web interface. /!\/!\/!\ In no way this module stops the save of the record. You must consider this as a warning displayed to the user AFTER save completed. /!\/!\/!\ - -Installation -============ - -To install this module, you need to: - -* install it - -Configuration -============= - -To configure this module, you need to: - -* nothing +If you don't want OpenERP to save the record, you should use constraints. Usage ===== @@ -47,9 +34,6 @@ For further information, please visit: * https://www.odoo.com/forum/help-1 -Known issues / Roadmap -====================== - Bug Tracker =========== diff --git a/web_warning_on_save/__init__.py b/web_warning_on_save/__init__.py index 4fe5a6e6..7c5f67fb 100644 --- a/web_warning_on_save/__init__.py +++ b/web_warning_on_save/__init__.py @@ -19,4 +19,4 @@ # ############################################################################## -import controller +from . import controller diff --git a/web_warning_on_save/__openerp__.py b/web_warning_on_save/__openerp__.py index 7fcedcd8..60e538d3 100644 --- a/web_warning_on_save/__openerp__.py +++ b/web_warning_on_save/__openerp__.py @@ -25,6 +25,36 @@ "author": "Camptocamp,Odoo Community Association (OCA)", 'license': 'AGPL-3', 'website': 'http://www.camptocamp.com', + 'description': """ + This module was written to extend the functionality of + saving a record in the web interface. + /!\/!\/!\ In no way this module stops the save of the record. + You must consider this as a warning displayed + to the user AFTER save completed. /!\/!\/!\ + If you don't want OpenERP to save the record, you should use constraints. + + Usage + ===== + + To use this module, you need to: + + * write a method called 'check_warning_on_save' which will make some checks + and return a string + + example : + + def check_warning_on_save(self, cr, uid, id, context=None): + ''' + @param: int: record_id + @return: string: message that should be displayed to the user + ''' + res = "" + + record = self.browse(cr, uid, id, context=context) + # ... make some checks + + return res + """, 'data': [ ], 'js': [ @@ -37,4 +67,3 @@ 'installable': True, 'auto_install': False, } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: