Browse Source

[FIX] base_optional_quick_create: don't break when we have a nonexisting model (#50)

pull/54/head
Holger Brunn 6 years ago
committed by Pedro M. Baeza
parent
commit
77868bdedb
  1. 2
      base_optional_quick_create/models/ir_model.py

2
base_optional_quick_create/models/ir_model.py

@ -26,6 +26,8 @@ class IrModel(models.Model):
method_name = 'name_create' method_name = 'name_create'
for model in self: for model in self:
model_obj = self.env.get(model.model) model_obj = self.env.get(model.model)
if not isinstance(model_obj, models.BaseModel):
continue
if model.avoid_quick_create: if model.avoid_quick_create:
model_obj._patch_method(method_name, _wrap_name_create()) model_obj._patch_method(method_name, _wrap_name_create())
else: else:

Loading…
Cancel
Save