fix: 入库 search-base 物料选择加公司隔离,恢复半成品批号按本公司历史自动递增
This commit is contained in:
@ -55,6 +55,11 @@ class ServiceService:
|
||||
MaterialBase.spec_model.ilike(f'%{keyword}%'),
|
||||
)
|
||||
)
|
||||
# ★ 行级公司隔离:只能搜索/选择本公司的物料(超管/跨域不受限)
|
||||
from app.utils.decorators import get_current_company_filter
|
||||
company_limit = get_current_company_filter()
|
||||
if company_limit is not None:
|
||||
query = query.filter(MaterialBase.company_name == company_limit)
|
||||
query = query.order_by(MaterialBase.id.desc()).limit(20)
|
||||
|
||||
results = []
|
||||
|
||||
Reference in New Issue
Block a user