@ -35,7 +35,7 @@ class BaseAutomation(models.Model):
def create_refresh_rules(self, model_name):
model = self.env['ir.model'].search(
[('model', '=', model_name)], limit=1)
if model_name in self.env and len(model):
if model_name in self.env and model:
triggers = [
('on_create', 'Creation'),
('on_write', 'Update'),