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