Skip to main content
Glama

odoo_stock_initial_import

Import opening stock balances via SQL INSERT, bypassing ORM overrides. Creates stock moves, lines, quants, and valuation layers with version-aware logic and UTC conversion. Use dry_run first.

Instructions

Import opening stock balances (initial inventory) via direct SQL INSERT, bypassing ORM overrides (e.g. custom modules that null out stock.move.name). Version-aware: v14-v18 creates stock.move + stock.move.line + stock.valuation.layer + stock.quant; v19 creates stock.move (with value/price_unit/remaining_qty/remaining_value/is_valued=true/is_in=true fields — SVL does not exist) + stock.move.line + stock.quant. All datetimes anchored at 23:59:59 in the caller's timezone, converted to UTC before INSERT. Writes a JSON snapshot to /backups// before execution. ALWAYS use dry_run=true first to preview the plan and catch category/location/product errors. For real_time valuation, follow up with odoo_stock_initial_opening_journal to book the account entry (SQL INSERT does NOT create account.move).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionNodefault
company_idYesTarget company for the opening balance
accounting_dateYesYYYY-MM-DD — accounting date (usually last day of prior fiscal year, e.g. '2025-12-31')
tzYesIANA timezone of the caller (e.g. 'Europe/Sofia', 'UTC'). 23:59:59 in this tz is converted to UTC for INSERT.
itemsYesOpening balance rows. One entry per (product, location, lot).
reference_prefixNoPrefix for stock.move name/reference. Final form: '<prefix> [Accounted on YYYY-MM-DD]'.Product Quantity Updated
dry_runNoIf true, only preview + pre-flight checks. Set false to execute.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses version-specific behavior (v14-18 vs v19), timezone handling with UTC conversion, backup creation, and the fact that it does NOT create account moves. All behavioral aspects are clearly explained.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense single paragraph effectively covers all key points without unnecessary verbosity. Could benefit from bullet points for readability, but remains clear and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter import tool with no output schema, the description thoroughly explains the operation, prerequisites, version differences, and post-import steps, making it complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 86% schema coverage, description adds meaningful context for parameters like accounting_date format, tz, items structure, and reference_prefix, enhancing understanding beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it imports opening stock balances via direct SQL INSERT, bypassing ORM overrides. It distinguishes from siblings like odoo_stock_initial_delete and odoo_stock_initial_opening_journal.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs to use dry_run=true first, and for real_time valuation to follow up with odoo_stock_initial_opening_journal. Provides context for when to use this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rosenvladimirov/odoo-claude-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server