9 lines
328 B
Python
9 lines
328 B
Python
# from odoo import http
|
|
# from odoo.http import request
|
|
#
|
|
# class MyAPI(http.Controller):
|
|
#
|
|
# @http.route('/api/products', type='json', auth='user', methods=['GET'])
|
|
# def get_products(self):
|
|
# products = request.env['product.product'].search([])
|
|
# return [{"id": p.id, "name": p.name} for p in products] |