Browse Source

Merge pull request #318 from guewen/add-method-only-when-installed

Add method to BaseModel only on addon installation
pull/490/merge
Guewen Baconnier 8 years ago
committed by GitHub
parent
commit
f808240b89
  1. 9
      web_access_rule_buttons/models.py

9
web_access_rule_buttons/models.py

@ -34,4 +34,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