mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG][12.0] web_dashboard_tile
- refactor tile category - improve description - add legalsylvain as maintainer - update code and translation
This commit is contained in:
1
web_dashboard_tile/controllers/__init__.py
Normal file
1
web_dashboard_tile/controllers/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import main
|
||||
15
web_dashboard_tile/controllers/main.py
Normal file
15
web_dashboard_tile/controllers/main.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright (C) 2019-Today: GTRAP (<http://www.grap.coop/>)
|
||||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo.http import Controller, route, request
|
||||
|
||||
|
||||
class WebDashboardTile(Controller):
|
||||
|
||||
@route('/web_dashboard_tile/create_tile', type='json', auth='user')
|
||||
def create_tile(self, model_name, *args, **kwargs):
|
||||
IrModel = request.env['ir.model']
|
||||
model = IrModel.search([('model', '=', model_name)])
|
||||
kwargs.update({'model_id': model.id})
|
||||
return request.env['tile.tile'].create(kwargs)
|
||||
Reference in New Issue
Block a user