[ADD] Add initial files
parent
abeb8aaaf8
commit
5c7aa13109
|
@ -1,24 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from odoo import http
|
||||
from odoo.addons.ospp_base.tools.cloud_auth import verified, RESPONSE
|
||||
# from odoo import http
|
||||
# from odoo.addons.ospp_base.tools.cloud_auth import verified, RESPONSE
|
||||
|
||||
|
||||
class OsppBase(http.Controller):
|
||||
|
||||
@verified(permission="Cloud Resources#read")
|
||||
@http.route('/instance/info', type='json', methods=['POST'], auth='public')
|
||||
def instance_info(self, *args, **kwargs):
|
||||
user_count = http.request.env['res.users'].sudo().search_count([('share', '!=', True)])
|
||||
sku_count = http.request.env['product.product'].sudo().search_count([]) if http.request.env.get('product.product') else 0
|
||||
data ={
|
||||
'user_count': user_count,
|
||||
'sku_count': sku_count
|
||||
}
|
||||
|
||||
response = RESPONSE.copy()
|
||||
response.update(
|
||||
{
|
||||
"data": data
|
||||
}
|
||||
)
|
||||
return response
|
||||
# class OsppBase(http.Controller):
|
||||
#
|
||||
# @verified(permission="Cloud Resources#read")
|
||||
# @http.route('/instance/info', type='json', methods=['POST'], auth='public')
|
||||
# def instance_info(self, *args, **kwargs):
|
||||
# user_count = http.request.env['res.users'].sudo().search_count([('share', '!=', True)])
|
||||
# sku_count = http.request.env['product.product'].sudo().search_count([]) if http.request.env.get('product.product') else 0
|
||||
# data ={
|
||||
# 'user_count': user_count,
|
||||
# 'sku_count': sku_count
|
||||
# }
|
||||
#
|
||||
# response = RESPONSE.copy()
|
||||
# response.update(
|
||||
# {
|
||||
# "data": data
|
||||
# }
|
||||
# )
|
||||
# return response
|
||||
|
|
Loading…
Reference in New Issue