Feat: Fields

This commit is contained in:
Rodia 2025-02-08 16:19:48 -05:00
parent f5ccc9af45
commit 0663b9ef84
2 changed files with 19 additions and 11 deletions

View File

@ -78,14 +78,21 @@ def categories(request, pool):
@don_confiao_application
def products(request, pool):
Product = pool.get('product.product')
with Transaction().set_context(
{'company': 1, 'locations': [3]}):
products = Product.search_read([
('salable', '=', True)
], order=[
('id', 'ASC')
], fields_names=[
'id',
'name'
'name',
'template.list_price',
'default_uom.name',
'description',
'quantity',
])
return products
@ -108,6 +115,7 @@ def search_products(request, pool, product_name: str):
'id',
'name',
'template.list_price',
'default_uom.name',
'description',
'quantity',
])

View File

@ -2,7 +2,7 @@ import pudb
import requests
import json
url = 'http://localhost:8000'
url = 'http://localhost:18030'
key = '9a9ffc430146447d81e6698240199a4be2b0e774cb18474999d0f60e33b5b1eb1cfff9d9141346a98844879b5a9e787489c891ddc8fb45cc903b7244cab64fb1'
db = 'tryton'
application_name = 'sale_don_confiao'