This commit is contained in:
2026-11-08 20:08:53 +08:00
parent 7526a5fe4d
commit 9b924747c5
2692 changed files with 394867 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="ai_agent_audit_critic" model="ai.agent">
<field name="name">Audit Reviewer</field>
<field name="subtitle">Independently reviews one audit check's evidence and conclusion.</field>
<field name="system_prompt"><![CDATA[
You are the independent Audit Reviewer. Load your assigned skills together
before reviewing the check.
Review the assigned check's objective, evidence and proposed conclusion.
Independently investigate the claims that determine the result. Check whether
the population and time basis answer the actual question, follow relevant
record links and look for evidence that could overturn the conclusion.
Verify quoted period amounts against native period columns or an explicitly
dated ai_tool_read_group aggregation with the same scope. Check debit and
credit separately; a matching net movement does not validate both totals.
Verify why the evidence establishes the proposed exception under the configured
workflow. Resolve apparent contradictions using field help, configuration and
record links. If the interpretation remains uncertain, return incomplete rather
than confirming an anomaly.
Choose your own verification procedures. Avoid repeating work that cannot
resolve a gap or adding requirements unrelated to the check. Batch independent
reads. Use your own working-file selection and report references.
Return audit_id, check_code and a verdict (confirmed, challenged or incomplete),
evidence supporting it, concrete objections and what could resolve them.
Agreement that evidence is missing does not clear the check. Respond to focused
follow-ups when new evidence arrives. Keep the conclusion factual and neutral;
do not save findings or delegate.
]]></field>
<field name="skill_ids" eval="[(6, 0, [
ref('ai.ai_skill_information_retrieval_query'),
ref('ai_account_reports.ai_skill_accounting_report_analysis'),
ref('ai_account_reports.ai_skill_audit_evidence'),
])]"/>
<field name="allowed_agent_ids" eval="[(6, 0, [])]"/>
</record>
<record id="ai_agent_auditor" model="ai.agent">
<field name="name">Auditor</field>
<field name="subtitle">Investigates one audit check and returns independently reviewed findings.</field>
<field name="system_prompt"><![CDATA[
You are the Auditor. Load your assigned skills together, then investigate your
assigned check with curiosity and professional judgment.
Concentrate on the assigned check. Read its native instructions and determine
what must be established. Choose and adapt your procedures using the available
records, reports and documents. Follow relevant leads, investigate
contradictions and seek evidence that could disprove your initial explanation.
Continue while an available investigation could materially change the
conclusion. Stop when the evidence supports it or completing the investigation
requires unavailable evidence. A verified empty population supports a scoped
absence; a failed query or missing document is a gap. Do not invent policies,
legal requirements or facts. Finding an anomaly is not required.
Gather evidence before starting an Audit Reviewer. Supply the exact audit_id,
cycle code and check_code, plus the objective, scope, procedures, reproducible
queries/report settings, evidence and proposed conclusion. Report references
are session-local. Address substantive objections and continue the same
Reviewer when new evidence could resolve them.
Issue independent reads together; wait for results needed by dependent work.
Return audit_id, check_code, proposed result (reviewed, anomaly or todo),
neutral draft notes, and the review verdict, objections and their resolution.
Include the Reviewer session_id for follow-up.
Reviewed requires supported clearance; anomaly requires an evidenced exception;
todo records incomplete work. Return findings to the caller without saving them.
For the draft note, write a short, plain-language conclusion, normally two or
three sentences. State what is established, what is wrong, or what remains
unresolved. Include only the decisive facts or amounts and any necessary next
action.
Do not repeat the check description, company, period or procedures unless
needed to understand the conclusion. Avoid headings such as Scope, Procedures
and Evidence. Preserve limitations that change what can be concluded. Use
neutral language without mentioning agents.
]]></field>
<field name="skill_ids" eval="[(6, 0, [
ref('ai.ai_skill_information_retrieval_query'),
ref('ai_account_reports.ai_skill_accounting_report_analysis'),
ref('ai_account_reports.ai_skill_audit_evidence'),
])]"/>
<field name="allowed_agent_ids" eval="[(6, 0, [ref('ai_account_reports.ai_agent_audit_critic')])]"/>
</record>
<record id="ai.ai_default_agent" model="ai.agent">
<field name="skill_ids" eval="[
(4, ref('ai_account_reports.ai_skill_accounting')),
(4, ref('ai_account_reports.ai_skill_accounting_report_analysis')),
]"/>
<field name="allowed_agent_ids" eval="[(4, ref('ai_account_reports.ai_agent_auditor'))]"/>
</record>
</odoo>

View File

@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="ai_skill_accounting_report_analysis" model="ai.skill">
<field name="name">Accounting Report Analysis</field>
<field name="description"><![CDATA[
Read-only report analysis for balances, performance, cash flow, ledgers, aging,
taxes and comparisons. Provides discovery, values and drill-down.
]]></field>
<field name="instructions"><![CDATA[
Use native report values for report figures; do not rebuild report totals from
record queries. Use searches and aggregations for supporting evidence.
Keep the requested period and filters. Use custom dates for exact ranges or
cutoffs, and month/quarter/year only for whole periods. A single-cutoff report
needs date_to; a custom range also needs date_from.
Find the report with accounting_report_list, then describe its action_report_id
with the intended options. In the result, report_config.options contains
native settings and choices. Choose an ID from its available_variants using
choice={kind: "variant", id: ...}, then from its sections using kind: "section"
if needed. A section is a whole subreport, not a line. To change settings,
select its selected_section_id if present, otherwise selected_variant_id.
Read values using the returned report_config_ref and at least one expression_label
from report_config.options.columns. Each label includes all matching periods and
groups; line expansions retain that selection. Follow pagination.next_offset
until you have the rows needed for the question. References belong to this
session and retain their report settings. Use the tool descriptions for option
details. report_config.options is a subset of the saved native settings.
Only date and names in available_option_overrides can be overridden.
An empty line catalog does not mean an empty report. Use row_type to distinguish
data, totals and load_more summaries. Initial Balance is an opening summary.
Do not count totals, opening balances or continuation rows as journal items.
General Ledger account debit and credit totals include opening amounts. For
activity within the requested period, use Trial Balance's period columns or
subtract the corresponding Initial Balance amounts under the same filters.
For journal details behind a balance, read General Ledger and expand the
relevant account's line_ref. Expand returned children for deeper detail.
Expanding load_more returns its branch again and can repeat earlier rows;
do not double-count them. It does not expand those rows' children.
A row's name is a display description, not a separate journal or raw label
field. Use report_config.options.columns and the returned cells; state when a
requested dimension is unavailable instead of inventing it.
Base conclusions on the returned report_config, currencies and warnings.
Distinguish zero from unavailable evidence. Attribute figures to the selected
report or section; do not present them as figures from another report.
Use column.no_format for calculations and column.name when quoting figures.
Write calculations using plain text and normal currency symbols. Odoo chat
does not render LaTeX; avoid mathematical delimiters and commands.
The report tools do not accept aging_interval. For a 60-day aging question, use
equivalent returned buckets or at-date residual queries with open_on and
residual_at_date. Bank Reconciliation's journal selector is also unavailable:
verify its actual journal before using its figures, or use scoped ledger and
statement records. State any evidence that remains unavailable.
For other companies, ask the user to change Odoo's company selector.
After a selection change, describe the report again.
]]></field>
<field name="tool_ids" eval="[(6, 0, [
ref('ai_account_reports.ir_actions_server_accounting_report_list'),
ref('ai_account_reports.ir_actions_server_accounting_report_describe'),
ref('ai_account_reports.ir_actions_server_accounting_report_select'),
ref('ai_account_reports.ir_actions_server_accounting_report_get_values'),
ref('ai_account_reports.ir_actions_server_accounting_report_expand_line'),
ref('ai_account_reports.ir_actions_server_accounting_report_open'),
])]"/>
</record>
<record id="ai_skill_accounting" model="ai.skill">
<field name="name">Accounting</field>
<field name="description"><![CDATA[
Entry point for user-facing accounting questions, reports and audit working
files. Report figures also require Accounting Report Analysis; supporting
record queries require Search Database.
]]></field>
<field name="instructions"><![CDATA[
You own the accounting request and the user-facing answer. Answer methodology
questions without inventing company facts or rules.
Follow the user's requested scope. A focused audit question need not complete
a check or change its status.
Explain results in accounting terms. In user-facing answers, translate tool
metadata into its business meaning; omit internal field names, raw objects and
configuration references. Preserve relevant accounting terminology, report
labels and statutory codes.
For ordinary report answers, open the main supporting report before answering
the user. Internal audit investigations do not require opening reports.
For an audit, read the working-file scope and all requested checks. Create a
file only when requested. For a full cycle, include every non-file check, even
if native logic already marks it reviewed; that status does not establish that
its instructions were investigated. Start one Auditor per check, issuing
independent assignments together. Supply the exact audit_id, cycle code,
check_code, objective and relevant user context. The Auditor retrieves the
instructions and chooses the investigation. Keep file checks as manual evidence
requirements.
After the batch returns, reconcile findings and review objections. Continue the
same Auditor for a concrete unresolved question; do not redispatch work blocked
on unavailable documents. Account for every assigned check before reporting
the investigation complete. Save authorized findings in cycle batches. Keep
unsupported conclusions todo; leave formal completion and supervision to the
user.
Preserve the Auditor's concise conclusions when saving notes.
After saving, briefly summarize the overall outcome, progress and main
unresolved actions, and link the working file. Leave individual check details
there unless requested.
Base the summary on the saved findings and save result. Preserve their scope,
uncertainty and limitations. Check that each factual statement is supported,
without strengthening conclusions or adding new claims.
Use check names in user-facing summaries. Keep agent names, delegation and
reviewer history out of saved notes and user-facing answers.
For other companies, ask the user to change Odoo's company selector.
]]></field>
<field name="tool_ids" eval="[(6, 0, [
ref('ai_account_reports.ir_actions_server_accounting_report_open'),
ref('ai_account_reports.ir_actions_server_accounting_audit_create'),
ref('ai_account_reports.ir_actions_server_accounting_audit_get_checks'),
ref('ai_account_reports.ir_actions_server_accounting_audit_update_checks'),
])]"/>
</record>
<record id="ai_skill_audit_evidence" model="ai.skill">
<field name="name">Accounting Audit Evidence</field>
<field name="description"><![CDATA[
Read native audit instructions and action hints, select this session's working
file and interpret Odoo accounting evidence.
]]></field>
<field name="instructions"><![CDATA[
Use the exact assigned audit_id. If it is missing, return that gap to the
caller; do not guess from matching file names or dates. Read
accounting_audit_get_checks for that file and cycle, locating the assigned
check_code and its full instructions. Inspect its action details as
investigation hints. An absent action does not mean absent evidence.
Native check statuses may be assigned automatically. "Reviewed" does not
establish human review or sign-off. Before reporting a control failure,
establish that the control applies and that evidence demonstrates its failure.
Otherwise, describe the evidence gap and leave the check todo.
Select your assigned working file before querying audit-computed fields.
Its companies and main company must match Odoo's company selector. Keep date
and posting scope explicit in ordinary queries; report figures follow their
selected report options.
For income, expense and equity_unaffected accounts, audit_debit/audit_credit are
period activity; for other accounts they accumulate through the cutoff. Use
dated ledger queries for annual movements. Current balances, residuals and stock
quantities are not automatically historical evidence.
Use ai_tool_get_fields with include_description=true to read field help before
interpreting unfamiliar statuses or amounts. Check the account and journal
configuration; a field label alone does not establish its accounting meaning.
Payments posted directly to the journal's default bank/cash account can have
is_matched=true without a bank statement. A journal item's residual or
reconciled=false on an account with reconcile=false does not establish an
unsettled receipt. Trace the payment and counterpart entries; these flags alone
prove neither external settlement nor non-settlement.
]]></field>
<field name="tool_ids" eval="[(6, 0, [
ref('ai_account_reports.ir_actions_server_accounting_audit_get_checks'),
ref('ai_account_reports.ir_actions_server_accounting_audit_get_check_action_detail'),
ref('ai_account_reports.ir_actions_server_accounting_audit_set_working_file'),
])]"/>
</record>
</odoo>

View File

@@ -0,0 +1,589 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="ir_actions_server_accounting_report_list" model="ir.actions.server">
<field name="name">AI Tool: List Accounting Reports</field>
<field name="ai_tool_name">accounting_report_list</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Finding accessible accounting reports</field>
<field name="ai_tool_description"><![CDATA[
Lists accessible report entry points from account_report client actions.
Use action_report_id to describe an entry; report.report_id identifies its
native default selection. Returns report names, default variant/section IDs,
filter_date_range and pagination. An empty list means no matching entries.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_report_list(offset=offset, limit=limit)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"offset": {"type": "integer", "minimum": 0},
"limit": {"type": "integer", "minimum": 1, "description": "Page size from 1 to 200; defaults to 60."}
},
"required": []
}
]]></field>
</record>
<record id="ir_actions_server_accounting_report_describe" model="ir.actions.server">
<field name="name">AI Tool: Describe Accounting Report</field>
<field name="ai_tool_name">accounting_report_describe</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Inspecting the accounting report</field>
<field name="ai_tool_description"><![CDATA[
Builds reusable configuration from action_report_id returned by
accounting_report_list, using the companies currently selected in Odoo.
A matching current browser report supplies its native options and source
action; otherwise native defaults apply.
Returns report_config, currencies, available_option_overrides, a paginated
line_catalog and report_config_ref. report_config contains action_report_id
and options. options.companies lists the companies included by native reporting,
which may be fewer than the current selection.
Its options retain native settings and choices, including report_id and
columns. report_config.options.columns contains all native column definitions
in order; expression_label can repeat across groups. Match report_id to
available_variants or sections for the selected report name. Currency details
are listed separately by ID.
Returned options are a subset of the saved settings. aging_based_on is
base_on_invoice_date for invoice dates or base_on_maturity_date for due dates.
Use native names in option_overrides. journals and account_type accept
{id, selected} objects. In resolved native options, no selected entries means
all listed entries apply. Use accounting_report_select to change identity or
options. If the user changes the company selection, describe the report again
to obtain a new reference.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_report_describe(tool_context=ai, action_report_id=action_report_id, option_overrides=option_overrides, offset=offset, limit=limit)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"action_report_id": {
"type": "integer",
"minimum": 1,
"description": "action_report_id returned by accounting_report_list. This identifies the report referenced by the client action; do not substitute report_config.options.report_id or a variant/section ID."
},
"option_overrides": {
"type": "object",
"description": "Optional intentional changes keyed by option name. Apart from date, use only names in available_option_overrides. These are native Odoo option names. Omit defaults; false and empty lists are intentional values.",
"properties": {
"date": {
"type": "object",
"description": "Named periods and single-date reports use date_to only; a custom range also needs date_from.",
"properties": {
"period_type": {"type": "string", "enum": ["today", "month", "quarter", "year", "custom"]},
"date_from": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},
"date_to": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}
},
"required": ["period_type", "date_to"]
},
"comparison": {
"type": "object",
"description": "Use only fields belonging to the selected comparison form.",
"properties": {
"filter": {"type": "string", "enum": ["no_comparison", "previous_period", "same_last_year", "custom"]},
"number_period": {"type": "integer", "minimum": 1},
"date_from": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},
"date_to": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}
},
"required": ["filter"]
},
"journals": {
"type": "array",
"items": {
"type": "object",
"properties": {"id": {"type": "integer"}, "selected": {"type": "boolean"}},
"required": ["id", "selected"]
}
},
"analytic_accounts_groupby": {"type": "array", "items": {"type": "integer"}},
"partner_ids": {"type": "array", "items": {"type": "integer"}},
"partner_categories": {"type": "array", "items": {"type": "integer"}},
"account_type": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {"type": "string", "enum": ["trade_receivable", "non_trade_receivable", "trade_payable", "non_trade_payable"]},
"selected": {"type": "boolean"}
},
"required": ["id", "selected"]
}
},
"all_entries": {"type": "boolean"},
"unreconciled": {"type": "boolean"},
"hierarchy": {"type": "boolean"},
"tax_unit": {"type": "integer", "minimum": 1},
"selected_horizontal_group_id": {"type": "integer", "minimum": 1}
},
"required": []
},
"offset": {"type": "integer", "minimum": 0},
"limit": {"type": "integer", "minimum": 1, "description": "Page size from 1 to 200; defaults to 60."}
},
"required": ["action_report_id"]
}
]]></field>
</record>
<record id="ir_actions_server_accounting_report_select" model="ir.actions.server">
<field name="name">AI Tool: Select Accounting Report Identity</field>
<field name="ai_tool_name">accounting_report_select</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Selecting the accounting report</field>
<field name="ai_tool_description"><![CDATA[
Selects a variant or section from an exact report_config_ref.
Use choice={kind: "variant", id: ...} with an ID from
report_config.options.available_variants, or kind: "section" with an ID from
report_config.options.sections. These lists belong to the supplied
configuration. A report can serve different roles in different lists; use the
matching kind. Returns the same description as describe.
Optional option_overrides uses native option names and selection objects.
Checks reference ownership, selected companies and report access.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_report_select(tool_context=ai, report_config_ref=report_config_ref, choice=choice, option_overrides=option_overrides, offset=offset, limit=limit)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"report_config_ref": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{24}$",
"description": "Required exact configuration returned by the describe or select result that exposed this choice. It binds the current user, source action, top-level report entry, selected companies, native options, and selected identity. A stale or mismatched configuration fails closed."
},
"choice": {
"type": "object",
"description": "Use kind variant with an ID from report_config.options.available_variants, or kind section with an ID from report_config.options.sections in the supplied configuration.",
"properties": {
"kind": {"type": "string", "enum": ["variant", "section"]},
"id": {"type": "integer", "minimum": 1}
},
"required": ["kind", "id"]
},
"option_overrides": {
"type": "object",
"description": "Optional intentional changes keyed by option name. Apart from date, use only names in available_option_overrides. These are native Odoo option names. Omit defaults; false and empty lists are intentional values.",
"properties": {
"date": {
"type": "object",
"description": "Named periods and single-date reports use date_to only; a custom range also needs date_from.",
"properties": {
"period_type": {"type": "string", "enum": ["today", "month", "quarter", "year", "custom"]},
"date_from": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},
"date_to": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}
},
"required": ["period_type", "date_to"]
},
"comparison": {
"type": "object",
"description": "Use only fields belonging to the selected comparison form.",
"properties": {
"filter": {"type": "string", "enum": ["no_comparison", "previous_period", "same_last_year", "custom"]},
"number_period": {"type": "integer", "minimum": 1},
"date_from": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},
"date_to": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}
},
"required": ["filter"]
},
"journals": {
"type": "array",
"items": {
"type": "object",
"properties": {"id": {"type": "integer"}, "selected": {"type": "boolean"}},
"required": ["id", "selected"]
}
},
"analytic_accounts_groupby": {"type": "array", "items": {"type": "integer"}},
"partner_ids": {"type": "array", "items": {"type": "integer"}},
"partner_categories": {"type": "array", "items": {"type": "integer"}},
"account_type": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {"type": "string", "enum": ["trade_receivable", "non_trade_receivable", "trade_payable", "non_trade_payable"]},
"selected": {"type": "boolean"}
},
"required": ["id", "selected"]
}
},
"all_entries": {"type": "boolean"},
"unreconciled": {"type": "boolean"},
"hierarchy": {"type": "boolean"},
"tax_unit": {"type": "integer", "minimum": 1},
"selected_horizontal_group_id": {"type": "integer", "minimum": 1}
},
"required": []
},
"offset": {"type": "integer", "minimum": 0},
"limit": {"type": "integer", "minimum": 1, "description": "Page size from 1 to 200; defaults to 60."}
},
"required": ["report_config_ref", "choice"]
}
]]></field>
</record>
<record id="ir_actions_server_accounting_report_get_values" model="ir.actions.server">
<field name="name">AI Tool: Get Accounting Report Values</field>
<field name="ai_tool_name">accounting_report_get_values</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Computing selected accounting figures</field>
<field name="ai_tool_description"><![CDATA[
Computes native report values from report_config_ref returned by describe or
select. Returns report_config, currencies, column_groups, paginated lines,
native warnings and the same report_config_ref.
An empty warnings object means the report returned no warnings. It does not
establish that the accounts are correct, reconciled or compliant. Consider any
line-level warning_text as well.
report_config.options.columns keeps all native column definitions. Provide at
least one expression_label in columns. These labels select row cells across all
periods and groups without changing the config. Pagination limits rows,
regardless of the number of columns.
Each line contains native columns: expression_label, column_group_index,
no_format (raw value) and name (formatted value). column_group_index indexes
column_groups; forced_options.date identifies that group's period when present,
otherwise use report_config.options.date. A configured date range does not mean
every value is activity within that range: General Ledger account debit and
credit totals include opening amounts. line_ref permits expansion.
row_type distinguishes data, totals and load_more summaries. Lines retain
native warning_text when present.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_report_get_values(tool_context=ai, report_config_ref=report_config_ref, columns=columns, line_codes=line_codes, offset=offset, limit=limit)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"report_config_ref": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{24}$",
"description": "Required exact configuration returned by accounting_report_describe or accounting_report_select. It already binds the catalog report entry, selected identity, configuration, current user, and selected companies. Do not substitute null or a configuration built for different companies."
},
"columns": {
"type": "array",
"items": {"type": "string"},
"description": "Required nonempty list of expression labels from report_config.options.columns returned by accounting_report_describe or accounting_report_select. Each label selects all matching columns across all periods and groups. To read every column, provide every expression label."
},
"line_codes": {
"type": "array",
"items": {"type": "string"},
"description": "Stable static line codes returned by describing that exact identity. If nonempty, reuse that describe result's report_config_ref; identity selectors are not accepted by this tool. Omit for normal rendered-row order."
},
"offset": {"type": "integer", "minimum": 0},
"limit": {"type": "integer", "minimum": 1, "description": "Page size from 1 to 200; defaults to 60."}
},
"required": ["report_config_ref", "columns"]
}
]]></field>
</record>
<record id="ir_actions_server_accounting_report_expand_line" model="ir.actions.server">
<field name="name">AI Tool: Expand Accounting Report Line</field>
<field name="ai_tool_name">accounting_report_expand_line</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Drilling into the accounting report</field>
<field name="ai_tool_description"><![CDATA[
Expands a line_ref issued by get_values or expand_line using its exact saved
configuration and column selection. Returns the same report_config, currencies,
lines, column_groups and pagination as get_values. Follow returned line_ref
values for deeper detail. A load_more reference reloads its parent branch and
may repeat earlier lines; do not double-count them.
Rows represent report lines, not necessarily accounting records. Initial Balance
is an opening summary. Row names are display descriptions; do not infer
dimensions absent from the returned data. Lines retain native warning_text
when present.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_report_expand_line(tool_context=ai, line_ref=line_ref, offset=offset, limit=limit)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"line_ref": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{24}$",
"description": "Required exact opaque reference returned by a dynamic or load-more row. It binds the saved report configuration, selected column labels, and current user."
},
"offset": {"type": "integer", "minimum": 0},
"limit": {"type": "integer", "minimum": 1, "description": "Page size from 1 to 200; defaults to 60."}
},
"required": ["line_ref"]
}
]]></field>
</record>
<record id="ir_actions_server_accounting_report_open" model="ir.actions.server">
<field name="name">AI Tool: Open Accounting Report</field>
<field name="ai_tool_name">accounting_report_open</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Opening the supporting accounting report</field>
<field name="ai_tool_description"><![CDATA[
Opens the exact saved report_config_ref using its source action and full
native options. Returns opened, report_config, currencies and the reference.
If that exact configuration is already displayed, opened is false and reason
explains why. Otherwise a client action opens it. Call this tool alone and wait
for its result before answering.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_report_open(tool_context=ai, report_config_ref=report_config_ref)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"report_config_ref": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{24}$",
"description": "Required exact configuration returned by the get-values call supporting the answer. It already binds the catalog report entry, selected identity, configuration, current user, and selected companies; do not substitute null or add overrides."
}
},
"required": ["report_config_ref"]
}
]]></field>
</record>
<record id="ir_actions_server_accounting_audit_set_working_file" model="ir.actions.server">
<field name="name">AI Tool: Set Working Audit File</field>
<field name="ai_tool_name">accounting_audit_set_working_file</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Setting Working Audit File</field>
<field name="ai_tool_description"><![CDATA[
Set the working audit file for this session's context-dependent accounting
fields, or pass null to clear it. Select the assigned file before querying audit
fields with search/read-group. Wait for the setter result before issuing those
queries. Clear it before unrelated work or select the new file when the
assignment changes. Parent and child sessions keep separate working-file
selections. The file's companies and main company must match Odoo's company
selector.
Returns the active file, company and period, or audit_context=null when cleared.
This does not add company/date domains to ordinary searches, select report
options or modify the working file's findings.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_audit_set_working_file(tool_context=ai, audit_id=audit_id)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"audit_id": {
"anyOf": [
{"type": "integer", "minimum": 1},
{"type": "null"}
],
"description": "Working audit-file ID, or null to clear this session's selection."
}
},
"required": ["audit_id"]
}
]]></field>
</record>
<record id="ir_actions_server_accounting_audit_create" model="ir.actions.server">
<field name="name">AI Tool: Create Audit Working File</field>
<field name="ai_tool_name">accounting_audit_create</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Create Audit Working File</field>
<field name="ai_tool_description"><![CDATA[
Create a native audit working file for the currently selected company and
exact dates, using the native local audit type and configured cycles. Select
one company in Odoo before calling this tool. Requires confirmation. For branch
structures, ask the user to create the file manually in the Accounting
application and provide its ID. Returns the file scope, URL and native check
progress.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_audit_create(tool_context=ai, date_from=date_from, date_to=date_to)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"date_from": {
"type": "string",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
},
"date_to": {
"type": "string",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
}
},
"required": [
"date_from",
"date_to"
]
}
]]></field>
</record>
<record id="ir_actions_server_accounting_audit_get_checks" model="ir.actions.server">
<field name="name">AI Tool: Read Audit Checks</field>
<field name="ai_tool_name">accounting_audit_get_checks</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Read Audit Checks</field>
<field name="ai_tool_description"><![CDATA[
Read the native working file, complete check instructions and notes, company and
dates, live cycle progress, and paginated checks. Pass cycle to read the
assigned cycle, or omit it to discover all cycles. File checks require manual
evidence. Native record count is only a capped hint; it is not a complete
evidence count. Progress summarizes native statuses and refresh flags, not a
record of agent investigations.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_audit_get_checks(audit_id=audit_id, cycle=cycle, offset=offset, limit=limit)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"audit_id": {
"type": "integer",
"minimum": 1,
"description": "Native audit working-file ID."
},
"cycle": {
"type": "string",
"description": "Copy the native cycle code from accounting_audit_get_checks."
},
"offset": {
"type": "integer",
"minimum": 0
},
"limit": {
"type": "integer",
"minimum": 1,
"description": "Page size from 1 to 200; defaults to 60."
}
},
"required": [
"audit_id"
]
}
]]></field>
</record>
<record id="ir_actions_server_accounting_audit_get_check_action_detail" model="ir.actions.server">
<field name="name">AI Tool: Get Audit Check Action Detail</field>
<field name="ai_tool_name">accounting_audit_get_check_action_detail</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Inspecting the audit check action</field>
<field name="ai_tool_description"><![CDATA[
Return a check's native action in action_detail as an investigation hint, with
search and main view XML for record actions. Interpret its domain, active search
defaults and search-panel selections using the XML, including filter grouping.
Group-by defaults suggest grouping rather than record restrictions. Choose
fields and explicit domains for search/read-group, or use accounting-report
tools for report actions. Native report IDs and options remain in the action.
No records or report_config_ref are returned. Action context is metadata for
interpreting the action; it does not configure subsequent tools.
If no action is available, investigate from the check instructions and attached
documents. Other executable actions are returned without being run.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_audit_get_check_action_detail(audit_id=audit_id, check_code=check_code)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"audit_id": {
"type": "integer",
"minimum": 1,
"description": "Native audit working-file ID."
},
"check_code": {
"type": "string"
}
},
"required": [
"audit_id",
"check_code"
]
}
]]></field>
</record>
<record id="ir_actions_server_accounting_audit_update_checks" model="ir.actions.server">
<field name="name">AI Tool: Save Audit Cycle Findings</field>
<field name="ai_tool_name">accounting_audit_update_checks</field>
<field name="state">code</field>
<field name="use_in_ai" eval="True"/>
<field name="model_id" ref="ai.model_ai_tool"/>
<field name="ai_tool_thinking_text">Save Audit Cycle Findings</field>
<field name="ai_tool_description"><![CDATA[
Preview and save a validated batch of findings for one assigned cycle, under
native access and review rules. Only non-file checks may be updated. Use
reviewed for supported clearance, anomaly for evidenced exceptions, and todo for
incomplete or blocked checks. Never formally completes or supervises the
working file. Requires confirmation. After saving, returns the updated check
codes, native check progress and working-file URL.
For each saved audit note, write a short, plain-language conclusion, normally
two or three sentences. State what is established, what is wrong, or what
remains unresolved. Include only the decisive facts or amounts and any
necessary next action.
Do not repeat the check description, company, period or procedures unless
needed to understand the conclusion. Avoid headings such as Scope, Procedures
and Evidence. Preserve limitations that change what can be concluded. Use
neutral language without mentioning agents.
]]></field>
<field name="code">ai['result'] = record._ai_tool_accounting_audit_update_checks(tool_context=ai, audit_id=audit_id, cycle=cycle, updates=updates)</field>
<field name="ai_tool_schema"><![CDATA[
{
"type": "object",
"properties": {
"audit_id": {
"type": "integer",
"minimum": 1,
"description": "Native audit working-file ID."
},
"cycle": {
"type": "string",
"description": "Copy the native cycle code from accounting_audit_get_checks."
},
"updates": {
"type": "array",
"description": "Between 1 and 100 findings for distinct non-file checks in this cycle.",
"items": {
"type": "object",
"properties": {
"check_code": {
"type": "string"
},
"notes": {
"type": "string",
"description": "Plain text, without Markdown or HTML."
},
"result": {
"type": "string",
"enum": [
"todo",
"reviewed",
"anomaly"
]
}
},
"required": [
"check_code",
"notes",
"result"
]
}
}
},
"required": [
"audit_id",
"cycle",
"updates"
]
}
]]></field>
</record>
</odoo>