Skip to main content
Glama

odoo_stock_initial_opening_journal

Book a posted opening balance journal entry for initial stock, grouping debit lines by valuation account and crediting retained earnings. Includes duplicate guard and dry-run mode.

Instructions

Book the opening-balance journal entry for a previous SQL-inserted initial stock (complements odoo_stock_initial_import — SVL/stock.move written via raw SQL do NOT auto-create account.move even for real_time valuation). Creates ONE account.move (MISC journal, state=posted) with: DR lines grouped by category.property_stock_valuation_account_id (e.g. 302 Materials, 303 Products); CR contra account (default: code '122000' Retained earnings from prior years). Version-aware: v14-v18 reads stock.valuation.layer for the date; v19 reads stock.move (is_inventory=true, is_valued=true) for the same date — totals the 'value' column. DUPLICATE GUARD: before create, scans account.move.line for the same accounts on the same date — if any posted lines found, refuses and returns them (Alpinter lesson: comprehensive opening entries often already include the stock lines). ALWAYS use dry_run=true first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionNodefault
company_idYes
accounting_dateYesYYYY-MM-DD — date of the opening balance (matches the SQL-inserted stock records)
tzYesIANA timezone of the caller (used to bracket the date for UTC query).
contra_account_idNoContra account (CR side). If omitted, searches for account with code '122000' in this company.
journal_idNoJournal for the entry. If omitted, searches for first general-type journal (MISC) in this company.
refNoaccount.move.ref value. Default: 'Opening balance initial stock <date>'.
skip_if_exists_on_dateNoIf true, refuse when posted account.move.line exist on accounting_date for any of the stock valuation accounts.
dry_runNoIf true, only preview the lines + duplicate check. Set false to create + post.
Behavior4/5

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

Discloses key behaviors: creates one posted account.move, version-aware handling, duplicate guard logic. Provides ample detail for a mutation tool without annotations. Could mention error handling or permissions.

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?

Front-loaded with purpose, information-dense but concise. Could benefit from bullet points for readability, but every sentence earns its place.

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

Completeness4/5

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

Covers complex behavior (version-aware, duplicate guard) and parameter usage. No output schema, so missing full return value specification, but the description mentions returning duplicates.

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?

Adds meaningful context beyond schema: explains purpose of accounting_date, default contra account, dry_run effect. Schema coverage is 78%, so baseline 3; description adds value.

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?

Explicitly states it 'books the opening-balance journal entry for a previous SQL-inserted initial stock' and distinguishes from sibling 'odoo_stock_initial_import'. Clear verb+resource+scope.

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

Usage Guidelines4/5

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

Gives clear context: complements initial import, always use dry_run first. Also describes duplicate guard behavior. However, does not explicitly state when not to use it or mention alternative tools beyond the sibling.

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