From 2f58db74e5c02f04dac600575212e7a5da37f538 Mon Sep 17 00:00:00 2001 From: Laurent Mignon Date: Fri, 31 Oct 2014 08:48:11 +0100 Subject: [PATCH] [FIX] This fixes #73 Check if the model still exists in the registry before registring the 'check_quick_create' hook --- base_optional_quick_create/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_optional_quick_create/model.py b/base_optional_quick_create/model.py index 20345dadb..00862f0c7 100644 --- a/base_optional_quick_create/model.py +++ b/base_optional_quick_create/model.py @@ -44,7 +44,7 @@ class ir_model(orm.Model): if model.avoid_quick_create: model_name = model.model model_obj = self.pool.get(model_name) - if not hasattr(model_obj, 'check_quick_create'): + if model_obj and not hasattr(model_obj, 'check_quick_create'): model_obj.name_create = self._wrap_name_create( model_obj.name_create, model_name) model_obj.check_quick_create = True