产品类别过滤缺陷

This commit is contained in:
liaodanlong
2024-10-25 14:02:37 +08:00
parent 8578a9a538
commit 06eaebd098

View File

@@ -22,3 +22,11 @@ class ProductCategory(models.Model):
# 调用父类的 name_search 方法
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)