feat(mail): add Mail tab with Send test mail action #22
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #22"
general
weight: 0.35
xaviedoanhduy
Summary
Adds a Mail tab to the database pane, a Send test mail action, and a
mail_auditMCP tool, so outbound mail config can be checked and diagnosed without leaving the TUI — and by an agent, not just a human at the screen.Mail tab
Mailtab (mshortcut) runsodoo-db mail <db>, which answers one nested object (neutralization status, config parameters, per-company alias domains, addresses, outgoing mail servers, relevant modules) instead of a flat row list. Because the sections don't share columns,panes/mail.pydoesn't route through the generic DataTable like every other db tab — it renders each non-empty section as its own Rich table into the log body, outgoing mail servers first (whether mail leaves the box at all is the most important question), with a neutralized-database banner leading everything else.active=False) rows are excluded from every summary since they swallow nothing.credsfoldssmtp_user/smtp_passinto one cell andencryption/authfoldssmtp_encryption/smtp_authentication, since the wider layout truncatedhost:port— the column the audit is actually for — at an 80-column terminal.ir_model_dataexternal ids on the odoo-db side rather than a hardcoded partner id orlogin = 'admin'/'__system__'— matching on login silently dropped the admin row once that login was renamed, the normal state on odoo.sh. A row that can't be resolved is still shown, as(record missing), never silently dropped.(not set — normal for a clean 17+ install)unless legacy pre-17 ICP config is still present, in which case it reads asNOT SET despite legacy ICP config still present — stuck v16-to-17 migration!— a barealias_domain_id IS NULLflags nearly every real Odoo 17+ database on its own, so it's not a useful signal by itself.PromptScreen(a new text-input sibling toConfirmScreen) and sends one realmail.mailviaodoo_activity/scripts/send_test_mail.py, from the connecting user's own company address, withforce_always_sendso it sends synchronously instead of waiting on the mail queue cron.run_odooly_scriptnow accepts extra positional args (--to <address>) so scripts beyond--envcan take parameters.stringifyrendersNonecells as blank instead of the literal string"None"— caught live against a real host, where every unsetconfig_parametersrow read "None".MCP server (
oa-mcp)mail_audittool exposes the same mail-config bundle to an MCP client/agent. Kept out ofdb_query's scoped command set rather than added there: odoo-db'smailanswers one nested object, not the flat row list everydb_querycommand shares — the same reason the TUI renders it through its ownpanes/mail.pyinstead of the generic table pane.smtp_user/smtp_passfollow the same launch-time-only masking rule asdb_query'sparams.mcp_server.pycommit) wheremcp dev's Inspector crashed withNameError: name 'Worker' is not definedbefore listing any tool:from __future__ import annotationspostpones every annotation to a string, andmcp devloads this file viaimportlib.util.spec_from_file_locationwithout registering it insys.modules, sotyping.get_type_hints()can't re-resolve those strings against the file's own globals. Removed the future import — every type used in an annotation here is already defined before it's referenced, so evaluating eagerly costs nothing and sidesteps the dynamic-loader gap.import odoo_activity.mcp_server(howoa-mcpitself starts) was never affected, onlymcp dev.Result
<img width="1865" height="590" alt="image" src="https://github.com/user-attachments/assets/fbe7e5dc-2afa-4412-bfe6-d4700da20581" />
mail_auditverified end-to-end through the real MCP protocol (MCP Inspector,mcp dev odoo_activity/mcp_server.py) against localodoo_db, returning the expected bundle shape.Test plan
tests/test_tui.py—render_mail(per-section tables, empty bundle, test-catcher/known-relay/neutralization-stub warnings naming the affected server(s), archived-row exclusion,(record missing)/clean-install-vs-stuck-migration wording, tolerance of an olderodoo-dbmissing the newer flags), Mail tab wiring, Send test mail prompt/action flowtests/test_odooly.py—send_test_mail.py(including theRecord-vs-intcreate() regression),stringify(None)tests/test_mcp_server.py—mail_audit(launch-time-only masking, single-object unwrapping, non-JSON/odoo-db-missing fallbacks), smoke-tested end-to-endmtab and Send test mail against a real instance;mail_auditthrough MCP Inspector against localodoo_db