Browse Source

Add method to BaseModel only on addon installation

pull/318/head
Guewen Baconnier 9 years ago
parent
commit
f48c502480
  1. 9
      web_access_rule_buttons/models.py

9
web_access_rule_buttons/models.py

@ -28,4 +28,11 @@ def check_access_rule_all(self, operations=None):
return result
models.BaseModel.check_access_rule_all = check_access_rule_all
# Could be any model, we just use a core model to have a 'register_hook'
class IrModel(models.Model):
_inherit = 'ir.model'
def _register_hook(self, cr):
# Add method check_access_rule_all for all models
models.BaseModel.check_access_rule_all = check_access_rule_all
return super(IrModel, self)._register_hook(cr)
Loading…
Cancel
Save