This commit is contained in:
Shubhankar45
2026-10-27 12:03:31 +00:00
parent 2ed3945b5d
commit 4e5e95775d
104 changed files with 5210 additions and 606 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ from sqlalchemy.exc import IntegrityError
from sqlalchemy.ext.asyncio import AsyncSession
from app.audit.service import AuditService
from app.common.enums import AuditAction, EntityType, Role
from app.common.enums import AuditAction, EntityType, Role, FIELD_ROLES
from app.common.exceptions import ConflictError, NotFoundError
from app.common.utils import snapshot
from app.products.models import Product
@@ -27,7 +27,7 @@ class ProductService:
async def list_for(self, actor: User) -> list[Product]:
stmt = select(Product).where(Product.company_id == actor.company_id).order_by(Product.name)
if actor.role == Role.MR:
if actor.role in FIELD_ROLES:
stmt = stmt.where(Product.is_active.is_(True))
return list((await self.db.execute(stmt)).scalars().all())