Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/<database_name>/products', methods=['GET'])
- @with_pool
- @with_transaction()
- def products(request, pool):
- Product = pool.get('product.product')
- products = Product.search([
- ('active', '=', True),
- ])
- return [{
- 'code': p.code,
- 'name': p.template.name
- } for p in products]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement