ir_demo.py 542 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import models
  4. from odoo.modules.loading import force_demo
  5. from odoo.addons.base.models.ir_module import assert_log_admin_access
  6. class IrDemo(models.TransientModel):
  7. _name = 'ir.demo'
  8. _description = 'Demo'
  9. @assert_log_admin_access
  10. def install_demo(self):
  11. force_demo(self.env.cr)
  12. return {
  13. 'type': 'ir.actions.act_url',
  14. 'target': 'self',
  15. 'url': '/web',
  16. }