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