Skip to main content
Odoo Community Association

Romania - Stock Accounting

Mature License: AGPL-3 OCA/l10n-romania Translate me on Weblate Try me on Runboat

This module provides Romanian-specific stock accounting features that align with Romanian accounting standards and regulations. Below are the configuration options available.

Overview

The module extends Odoo’s standard stock accounting to meet Romanian accounting requirements, providing:

  • Location-specific accounting configurations

  • Romanian-specific stock valuation accounts

  • Product category stock account customization

  • Warehouse fiscal position management

  • Specialized accounts for stock operations

  • Per-location FIFO valuation (vs. Odoo’s default company-wide FIFO)

  • Automatic negative stock compensation for FIFO products

Per-location FIFO

For products with cost_method=fifo, the module values outgoing moves against the FIFO stack of the source location rather than the company-wide stack. Each outgoing move is automatically split into one stock.move per FIFO layer (e.g. an outgoing of 4 units from a location with IN 2@10 + IN 3@8 produces a 2x10 move + a 2x8 move).

Internal transfers (internal → internal or via transit) are treated as both is_in and is_out on the same move:

  • they consume from the FIFO stack of the source location,

  • they enter the FIFO stack of the destination location with the value pulled from the source,

  • they generate an accounting entry through the location’s valuation account (or the company-level transfer account if locations share an account).

Controlled by res.company.fifo_per_location (defaults to True for Romanian companies, computed from country_id, editable per company).

Negative stock compensation

When a FIFO outgoing move happens before the corresponding incoming move (i.e. the location FIFO stack is empty), the outgoing value falls back to the product’s standard_price. The pending quantity is tracked on the outgoing move via fifo_neg_pending_qty / fifo_neg_origin_value.

When the next matching incoming move is posted, the module:

  1. allocates the new incoming value across pending outgoing moves (FIFO);

  2. updates stock.move.value on the outgoing moves to reflect the real purchase price;

  3. emits an account.move correction that debits the variation/COGS account and credits the stock valuation account for the delta;

  4. links that correction back to the originating IN move via account.move.fifo_neg_origin_move_id for traceability.

Compensation is idempotent — if _set_value is re-invoked on the same IN move (e.g. when the supplier invoice is posted), the existing compensation is detected and not duplicated.

Controlled by res.company.fifo_location_negative_compensation (defaults to True for Romanian companies, editable per company).

Performance notes

  • Partial composite index on stock_move(product_id, location_dest_id, date DESC, id DESC) WHERE state='done' AND is_in=true powers the FIFO stack lookup with index-only scans on large histories.

  • Partial index on stock_move(...) WHERE fifo_neg_pending_qty > 0 keeps the compensation search constant-time even with millions of historical moves.

  • A request-scoped cache (context['fifo_stack_cache']) reuses the same _run_fifo_get_stack result across batched lookups in product._compute_value and stock.quant._compute_value — large Inventory Valuation reports drop from O(N) queries to O(distinct (product, location)) queries.

Table of contents

Changelog

19.0.0.26.1

  • Expose the stock.move.l10n_ro_move_type selection as the module level MOVE_TYPE constant, so other modules can reuse it instead of duplicating the list. Up to 18.0 the same list was available as VALUED_TYPE on stock.valuation.layer. No functional change.

19.0.0.25.1

  • Fix IndexError: list index out of range in stock_move._l10n_ro_process_fifo_split when validating an outgoing move. An incoming move with nothing left to consume (its valued quantity is zero, for instance a reception corrected to 0 after validation) still entered the per-location FIFO stack; _split returns no values for a quantity that is zero at the UoM rounding, so indexing its result crashed the transfer. Such moves no longer enter the stack, zero-quantity slices are skipped by the outgoing split, and the quantities are compared with the UoM rounding instead of raw floats.

19.0.0.19.1

  • Fix TypeError: '<' not supported between instances of 'bool' and 'str' in stock_move._compute_account when sorting the account move lines. A journal item without an account (or whose account has no code) returns False for account_id.code, which cannot be compared against the string codes of the other lines. The sort key now falls back to an empty string, and the subsequent code[0] check guards against an empty/falsy code.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • NextERP Romania

  • Dorin Hongu

  • Forest and Biomass Romania

Contributors

Do not contact contributors directly about support or help with technical issues.

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainers:

dhongu feketemihai

This module is part of the OCA/l10n-romania project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo_addon_l10n_ro_stock_account-19.0.0.27.0-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_l10n_ro_stock_account-19.0.0.27.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6766cf3ee09573bce303c8a0e69d473cbc49c7ff5ae98640554073cf0d7f7795
MD5 4c68ffbbe8bb6dbe22ae110ee5318074
BLAKE2b-256 a505549173cea2c7dd86bc2d2b8038ea0a8c1405fb30e544583c15e23bad1495

See more details on using hashes here.

Release history Release notifications | RSS feed

19.0.1.15.0

1 file

19.0.1.14.0

1 file

19.0.1.13.0

1 file

19.0.1.12.0

1 file

19.0.1.11.0

1 file

19.0.1.10.0

1 file

19.0.1.9.0

1 file

19.0.1.8.0

1 file

19.0.1.6.0

1 file

19.0.1.4.0.1

1 file

19.0.1.4.0

1 file

19.0.1.2.0.1

1 file

19.0.1.2.0

1 file

19.0.1.1.0

1 file

This release

19.0.0.27.0 This release

1 file

19.0.0.26.0

1 file

19.0.0.25.0.1

1 file

19.0.0.25.0

1 file

19.0.0.24.0

1 file

19.0.0.23.0

1 file

19.0.0.22.0

1 file

19.0.0.20.0

1 file

19.0.0.19.0.1

1 file

19.0.0.19.0

1 file

19.0.0.18.0

1 file

19.0.0.17.0

1 file

19.0.0.16.0

1 file

19.0.0.15.0

1 file

19.0.0.14.0

1 file

19.0.0.13.2.1

1 file

19.0.0.13.1.1

1 file

19.0.0.13.0

1 file

19.0.0.12.0

1 file

19.0.0.11.0.1

1 file

19.0.0.11.0

1 file

19.0.0.10.0.1

1 file

19.0.0.10.0

1 file

19.0.0.9.0.1

1 file

19.0.0.9.0

1 file

19.0.0.8.0.2

1 file

19.0.0.8.0

1 file

19.0.0.7.0

1 file

19.0.0.6.0.1

1 file

19.0.0.6.0

1 file

19.0.0.5.0

1 file

19.0.0.4.0

1 file

19.0.0.3.0

1 file

19.0.0.2.0

1 file

19.0.0.1.0

1 file

18.0.1.33.0

1 file

18.0.1.31.0

1 file

18.0.1.30.0

1 file

18.0.1.28.0

1 file

18.0.1.27.0

1 file

18.0.1.26.1.1

1 file

18.0.1.26.0

1 file

18.0.1.25.0

1 file

18.0.1.24.0

1 file

18.0.1.23.0

1 file

18.0.1.22.0

1 file

18.0.1.21.0

1 file

18.0.1.20.0.1

1 file

18.0.1.20.0

1 file

18.0.1.19.0.1

1 file

18.0.1.19.0

1 file

18.0.1.18.0

1 file

18.0.1.17.0

1 file

18.0.1.16.0.1

1 file

18.0.1.16.0

1 file

18.0.1.15.0

1 file

18.0.1.14.0.1

1 file

18.0.1.14.0

1 file

18.0.1.13.0

1 file

18.0.1.12.0

1 file

18.0.1.11.0

1 file

17.0.1.36.0

1 file

17.0.1.35.0.1

1 file

17.0.1.35.0

1 file

17.0.1.34.0

1 file

17.0.1.33.0

1 file

17.0.1.32.0

1 file

17.0.1.31.0

1 file

17.0.1.30.0

1 file

17.0.1.29.0.1

1 file

17.0.1.29.0

1 file

17.0.1.28.0

1 file

17.0.1.27.0

1 file

17.0.1.26.0

1 file

17.0.1.25.0

1 file

17.0.1.24.0

1 file

17.0.1.23.0

1 file

17.0.1.22.0

1 file

17.0.1.21.0

1 file

17.0.1.20.0.1

1 file

17.0.1.20.0

1 file

17.0.1.19.0

1 file

17.0.1.18.0.1

1 file

17.0.1.18.0

1 file

17.0.1.17.0

1 file

17.0.1.16.0

1 file

17.0.1.15.0

1 file

17.0.1.14.0

1 file

17.0.1.13.0.1

1 file

17.0.1.13.0

1 file

17.0.1.12.0

1 file

17.0.1.11.0

1 file

17.0.1.10.1

1 file

17.0.1.10.0

1 file

17.0.1.9.0

1 file

17.0.1.8.0

1 file

17.0.1.7.0

1 file

17.0.1.6.0

1 file

17.0.1.5.0.1

1 file

17.0.1.5.0

1 file

17.0.1.4.0

1 file

17.0.1.3.0

1 file

17.0.1.2.0

1 file

17.0.1.1.1

1 file

17.0.1.1.0

1 file

16.0.1.28.0.2

1 file

16.0.1.28.0.1

1 file

16.0.1.28.0

1 file

16.0.1.27.0

1 file

16.0.1.26.0

1 file

16.0.1.25.0

1 file

16.0.1.24.2.1

1 file

16.0.1.24.1

1 file

16.0.1.24.0.1

1 file

16.0.1.24.0

1 file

16.0.1.23.0

1 file

16.0.1.22.0

1 file

16.0.1.21.0

1 file

16.0.1.20.0

1 file

16.0.1.19.0

1 file

16.0.1.17.0

1 file

16.0.1.16.0

1 file

16.0.1.15.0

1 file

16.0.1.14.0

1 file

16.0.1.13.0

1 file

16.0.1.12.0

1 file

16.0.1.11.0

1 file

16.0.1.10.0

1 file

16.0.1.9.0.1

1 file

16.0.1.9.0

1 file

16.0.1.8.0

1 file

16.0.1.7.0

1 file

16.0.1.6.0

1 file

16.0.1.5.0.2

1 file

16.0.1.5.0.1

1 file

16.0.1.5.0

1 file

16.0.1.4.0.2

1 file

16.0.1.4.0.1

1 file

16.0.1.4.0

1 file

16.0.1.3.0.1

1 file

16.0.1.3.0

1 file

16.0.1.2.0

1 file

16.0.1.1.0.1

1 file

16.0.1.1.0

1 file

15.0.3.41.0

1 file

15.0.3.40.0

1 file

15.0.3.39.0

1 file

15.0.3.38.0

1 file

15.0.3.36.0

1 file

15.0.3.35.0

1 file

15.0.3.34.0

1 file

15.0.3.33.0

1 file

15.0.3.32.0

1 file

15.0.3.31.0.1

1 file

15.0.3.31.0

1 file

15.0.3.30.0

1 file

15.0.3.29.0

1 file

15.0.3.28.0.1

1 file

15.0.3.28.0

1 file

15.0.3.27.0

1 file

15.0.3.26.0

1 file

15.0.3.25.0.1

1 file

15.0.3.25.0

1 file

15.0.3.24.0.1

1 file

15.0.3.24.0

1 file

15.0.3.23.0.1

1 file

15.0.3.23.0

1 file

15.0.3.22.0.1

1 file

15.0.3.22.0

1 file

15.0.3.21.0

1 file

15.0.3.20.0

1 file

15.0.3.19.0.1

1 file

15.0.3.19.0

1 file

15.0.3.18.0

1 file

15.0.3.17.0

1 file

15.0.3.16.0

1 file

15.0.3.15.0

1 file

15.0.3.14.0.1

1 file

15.0.3.14.0

1 file

15.0.3.13.0

1 file

15.0.3.12.0.2

1 file

15.0.3.12.0

1 file

15.0.3.11.0

1 file

15.0.3.10.0.8

1 file

15.0.3.10.0.1

1 file

15.0.3.10.0

1 file

15.0.3.9.0

1 file

15.0.3.8.0

1 file

15.0.3.7.0

1 file

15.0.3.6.0

1 file

15.0.3.5.0

1 file

15.0.3.4.0

1 file

15.0.3.3.0

1 file

15.0.3.2.0

1 file

15.0.3.1.1

1 file

15.0.3.1.0

1 file

15.0.3.0.0.1

1 file

15.0.3.0.0

1 file

15.0.2.0.0

1 file

15.0.1.6.0.2

1 file

15.0.1.6.0

1 file

15.0.1.5.0

1 file

15.0.1.4.0

1 file

15.0.1.3.0.1

1 file

15.0.1.1.0.1

1 file

15.0.1.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page