TypeError: 'bool' object has no attribute '__getitem__' Odoo

TypeError: 'bool' object has no attribute '__getitem__' Odoo

我的代码有什么问题?我试图在 product.pricelist 上进行搜索并找到所有选中了优先级布尔值的价目表。

class ProductPricelist(models.Model):
    _inherit = 'product.pricelist'

    priority = fields.Boolean('Priority')


pricelists = self.env['product.pricelist'].search(['priority', '=', True])

TypeError: 'bool' object has no attribute '__getitem__'

语法错误。您应该将搜索参数作为元组列表。

pricelists = self.env['product.pricelist'].search([('priority', '=', True)])