[FIX] ir_demo.py: Force admin access to load demo data
Only admin users should be able to load demo data, if needed.
This is only possible from the settings dashboard, and thus,
the method could be decorated.
See: c002e2eb37
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
from odoo.modules.loading import force_demo
|
||||
from odoo.addons.base.models.ir_module import assert_log_admin_access
|
||||
|
||||
|
||||
class IrDemo(models.TransientModel):
|
||||
@@ -7,6 +11,7 @@ class IrDemo(models.TransientModel):
|
||||
_name = 'ir.demo'
|
||||
_description = 'Demo'
|
||||
|
||||
@assert_log_admin_access
|
||||
def install_demo(self):
|
||||
force_demo(self.env.cr)
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user