[IMP] web_dashboard_tile: black, isort, prettier

This commit is contained in:
Sylvain LE GAL
2022-10-26 16:53:50 +02:00
parent ffe3f9f5f0
commit 0d15ce1df8
16 changed files with 293 additions and 212 deletions

View File

@@ -2,14 +2,13 @@
# @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
from odoo.http import Controller, request, route
class WebDashboardTile(Controller):
@route('/web_dashboard_tile/create_tile', type='json', auth='user')
@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)
IrModel = request.env["ir.model"]
model = IrModel.search([("model", "=", model_name)])
kwargs.update({"model_id": model.id})
return request.env["tile.tile"].create(kwargs)