Feat: Fields
This commit is contained in:
parent
f5ccc9af45
commit
0663b9ef84
@ -78,15 +78,22 @@ def categories(request, pool):
|
||||
@don_confiao_application
|
||||
def products(request, pool):
|
||||
Product = pool.get('product.product')
|
||||
products = Product.search_read([
|
||||
('salable', '=', True)
|
||||
], order=[
|
||||
('id', 'ASC')
|
||||
], fields_names=[
|
||||
'id',
|
||||
'name'
|
||||
])
|
||||
return products
|
||||
with Transaction().set_context(
|
||||
{'company': 1, 'locations': [3]}):
|
||||
products = Product.search_read([
|
||||
('salable', '=', True)
|
||||
], order=[
|
||||
('id', 'ASC')
|
||||
], fields_names=[
|
||||
'id',
|
||||
'name',
|
||||
'template.list_price',
|
||||
'default_uom.name',
|
||||
'description',
|
||||
'quantity',
|
||||
])
|
||||
|
||||
return products
|
||||
|
||||
|
||||
@app.route(
|
||||
@ -108,6 +115,7 @@ def search_products(request, pool, product_name: str):
|
||||
'id',
|
||||
'name',
|
||||
'template.list_price',
|
||||
'default_uom.name',
|
||||
'description',
|
||||
'quantity',
|
||||
])
|
||||
|
@ -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'
|
||||
@ -15,7 +15,7 @@ response_parties = requests.get(
|
||||
})
|
||||
|
||||
response_party = requests.get(
|
||||
base_url+'/party/2753',
|
||||
base_url + '/party/2753',
|
||||
headers={
|
||||
'Authorization': f'bearer {key}',
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user