产品类别过滤缺陷
This commit is contained in:
@@ -22,3 +22,11 @@ class ProductCategory(models.Model):
|
|||||||
|
|
||||||
# 调用父类的 name_search 方法
|
# 调用父类的 name_search 方法
|
||||||
return super(ProductCategory, self).name_search(name, args=args, operator=operator, limit=limit)
|
return super(ProductCategory, self).name_search(name, args=args, operator=operator, limit=limit)
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def search(self, args, limit=100, offset=0, order=None, count=False):
|
||||||
|
# 添加过滤条件,确保只返回名称不在指定列表中的记录
|
||||||
|
args += [('name', 'not in', ['Saleable', 'Expenses', 'Deliveries'])]
|
||||||
|
|
||||||
|
# 调用父类的 search 方法
|
||||||
|
return super(ProductCategory, self).search(args, limit=limit, offset=offset, order=order, count=count)
|
||||||
Reference in New Issue
Block a user