Is there a way when you make a call to the xml rpc webservice to have the obtained records sorted in ascending/descending order?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Use the order argument:
order="date" (if not specified, defaults to be ASC)
order="name DESC"
Model.search (domain[, offset=0][, limit=None][, order=None][, count=False])[source]
Searches for records based on the domain search domain.
Parameters
domain – A search domain. Use an empty list to match all records.
offset (int) – number of results to ignore (default: none)
limit (int) – maximum number of records to return (default: all)
order (str) – sort string
count (bool) – if True, only counts and returns the number of matching records (default: False)
Returns: at most limit records matching the search criteria
Raises: AccessError – if user is not allowed to access requested information
Hello Olivier Biltris,
Please find code in comment.
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
You can use bellow example
In the search record for a partner, you can add orders like order id desc or asc.
models.execute_kw(db, uid, password,
'res.partner', 'search_read',
[[['is_company', '=', True], ['customer', '=', True]]],
{'fields': ['name', 'country_id', 'comment'], 'order': 'id desc'})
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký