我的代码是这样的
search_domain = [
'&',
('product_id', '=', 'Product_x'),
'&',
('lot_id', '=', 'AG:04/10/2023:UID520:6666'),
('on_hand', '=', True),
]
# Use the search domain to find the specific location
lookuplocationbasedonname = models.execute_kw(db, uid, password, 'stock.quant', 'search_read', [search_domain])
pprint(lookuplocationbasedonname)
搜索返回具有以下内容的 stock.quant 记录。
'on_hand': False,
我尝试了多种过滤方式,Odoo 文档并没有明确说明过滤方式。
域参数的正确数据类型应该是这样的。
search_domain = [[
'&',
('product_id', '=', 'Product_x'),
'&',
('lot_id', '=', 'AG:04/10/2023:UID520:6666'),
('on_hand', '=', True),
]]