From 405d33e80d5c9bae8f78dba0890d9a37a25e7e0f Mon Sep 17 00:00:00 2001 From: Dave Lasley Date: Fri, 4 Nov 2016 16:35:24 -0700 Subject: [PATCH] [FIX] base_multi_image: Fix hook example * Add uninstall hook import to Readme example * Only except for ImportError * Fix note regarding need of hook use --- base_multi_image/README.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/base_multi_image/README.rst b/base_multi_image/README.rst index 8e05f046e..8e8217106 100644 --- a/base_multi_image/README.rst +++ b/base_multi_image/README.rst @@ -41,7 +41,8 @@ To develop a module based on this one: _name = "my.model.name" _inherit = ["my.model.name", "base_multi_image.owner"] - # If you need this, you will need ``post_init_hook_for_submodules`` + # If you need this, you will need ``pre_init_hook_for_submodules`` and + ``uninstall_hook_for_submodules`` as detailed below. old_image_field = fields.Binary(related="image_main", store=False) * Somewhere in the owner view, add:: @@ -62,9 +63,11 @@ To develop a module based on this one: ``product_multi_image`` module does:: try: - from openerp.addons.base_multi_image.hooks import \ - pre_init_hook_for_submodules - except: + from openerp.addons.base_multi_image.hooks import ( + pre_init_hook_for_submodules, + uninstall_hook_for_submodules, + ) + except ImportError: pass