From de6f0cf3a4d4c6bd588bb8870f54ba95b0766322 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 10 Nov 2016 16:27:06 +0100 Subject: [PATCH] FIX when have a "dead" model that is still in DB --- base_optional_quick_create/models/ir_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base_optional_quick_create/models/ir_model.py b/base_optional_quick_create/models/ir_model.py index 53df25dee..8bbd3e584 100644 --- a/base_optional_quick_create/models/ir_model.py +++ b/base_optional_quick_create/models/ir_model.py @@ -25,7 +25,9 @@ class IrModel(models.Model): if model.avoid_quick_create: model_name = model.model model_obj = self.env.get(model_name) - if model_name and not hasattr(model_obj, 'check_quick_create'): + if ( + not isinstance(model_obj, type(None)) and + not hasattr(model_obj, 'check_quick_create')): model_obj._patch_method('name_create', _wrap_name_create()) model_obj.check_quick_create = True return True