Browse Source

publish muk_web_client_refresh - 12.0

pull/62/head
MuK IT GmbH 6 years ago
parent
commit
ab66ebe0e3
  1. 2
      muk_web_client_refresh/__manifest__.py
  2. 4
      muk_web_client_refresh/models/base_automation.py

2
muk_web_client_refresh/__manifest__.py

@ -20,7 +20,7 @@
{ {
"name": "MuK Web Refresh", "name": "MuK Web Refresh",
"summary": """Web Client Refresh""", "summary": """Web Client Refresh""",
"version": "12.0.2.2.1",
"version": "12.0.2.2.2",
"category": "Extra Tools", "category": "Extra Tools",
"license": "AGPL-3", "license": "AGPL-3",
"website": "http://www.mukit.at", "website": "http://www.mukit.at",

4
muk_web_client_refresh/models/base_automation.py

@ -35,7 +35,7 @@ class BaseAutomation(models.Model):
def create_refresh_rules(self, model_name): def create_refresh_rules(self, model_name):
model = self.env['ir.model'].search( model = self.env['ir.model'].search(
[('model', '=', model_name)], limit=1) [('model', '=', model_name)], limit=1)
if model_name in self.env and model.exists():
if model_name in self.env and len(model):
triggers = [ triggers = [
('on_create', 'Creation'), ('on_create', 'Creation'),
('on_write', 'Update'), ('on_write', 'Update'),
@ -46,7 +46,7 @@ class BaseAutomation(models.Model):
('model_id', '=', model.id), ('model_id', '=', model.id),
('trigger', '=', trigger[0]) ('trigger', '=', trigger[0])
], limit=1) ], limit=1)
if refresh_rules.exists():
if len(refresh_rules) > 0:
refresh_rules.write({ refresh_rules.write({
'active': True 'active': True
}) })

Loading…
Cancel
Save