Skip to content

fix: allow portal doc-event trigger lookup#266

Draft
esafwan wants to merge 1 commit into
developfrom
fix/agent-header-stats-alignment
Draft

fix: allow portal doc-event trigger lookup#266
esafwan wants to merge 1 commit into
developfrom
fix/agent-header-stats-alignment

Conversation

@esafwan
Copy link
Copy Markdown
Contributor

@esafwan esafwan commented May 18, 2026

Summary

  • Allow HUF doc-event trigger lookup to read Agent Trigger rows without using the current portal user's permissions.
  • Prevent Supplier portal actions, such as RFQ quote submission and Purchase Invoice creation/review, from failing with Insufficient Permission for Agent Trigger.

Root Cause

HUF registers doc-event hooks globally. When a website Supplier user created or updated a procurement document through the ERPNext portal, the hook attempted to read Agent Trigger with that Supplier user's permissions. Supplier users should not have access to AI trigger configuration, so the document action failed before the portal workflow could complete.

Validation

  • Ran python3 -m py_compile huf/ai/agent_hooks.py.
  • Migrated and restarted property.localhost bench.
  • Verified vendor RFQ quote submission in browser created a Supplier Quotation without the Agent Trigger permission error.
  • Verified vendor Purchase Invoice portal page loads without permission errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant