Viindoo AI - Workflow & Heartbeat Routines (P-OPS-3, base)
The Community-functional base of the P-OPS-3 operating-layer adapter. It ships
the recurring heartbeat routines that let the AI operate a controlled cadence
("AI điều hành doanh nghiệp, không chỉ chat") instead of only reacting to chat.
Key model
- AI Work Routine (viin.ai.work.routine) - the heartbeat carrier. One
record per built-in routine. Each routine scans a target model with a
safe_eval domain on a cadence, runs an analytical agent, and (where a
side-effect is warranted) creates a governed viin.ai.action.proposal.
Shipped routines (config data, noupdate="1")
- ar_overdue_review_daily - overdue unpaid customer invoices (daily).
- stock_anomaly_daily - negative on-hand quantity at internal locations (daily).
- cashflow_summary_weekly - net in/out window digest (weekly, digest-only).
- dunning_weekly - overdue AR, side-effecting: drafts a governed proposal
routed through approval (weekly, generic - VN-specific wording is a future
localization concern).
Scheduled Agent UI (Phase 7.2)
- Prompt template (messages_template) - an admin-authored prompt
rendered via the sandboxed mail.render.mixin inline_template engine
(never raw Jinja/eval); empty is byte-identical to the hard-coded default.
- Cron-builder UX - a read-only next_run_preview and a generic
"Run Now" button (action_run_now) over the single shared heartbeat
cron - no per-routine ir.cron is ever created.
- Cost-cap gate - a scheduled run never bypasses the run principal's
daily cost cap; over-cap is a graceful skip, not a failure.
- Failure alerting - consecutive_failure_count / last_error and a
throttled bus.bus alert to base.group_system once
viin_ai_workflow.routine_failure_alert_threshold consecutive failures
are reached.
- Generic proposal mode (proposal_mode) - a data-driven, per-routine
switch between digest-only and side-effecting (drafts a governed proposal),
with zero per-routine Python override required.
Routine runner discipline
The routine ir.cron relies on the ir.cron row lock for non-concurrency
(NO manual cr.commit); each routine runs inside its own cr.savepoint()
so one routine's failure never poisons the others. Each routine runs
with_company(routine.company_id) so company-scoped provider / BYOK key
resolution is correct in a multi-company database.
Supported Editions
- Community Edition
- Enterprise Edition
This software and associated files (the "Software") may only be
used
(executed, modified, executed after modifications) if you have
purchased a
valid license from the authors, typically via Odoo Apps,
or if you
have
received a written agreement from the authors of the
Software (see the
COPYRIGHT file).
You may develop Odoo modules that use the Software as a library
(typically
by depending on it, importing it and using its
resources), but
without
copying any source code or material from the
Software. You may distribute
those modules under the license of your
choice, provided that this
license
is compatible with the terms of
the Odoo Proprietary License (For
example:
LGPL, MIT, or proprietary
licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell
copies of the
Software or modified copies of the Software.
The above copyright notice and this permission notice must be
included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT
SHALL THE
AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE
SOFTWARE.