Skip to content
Health
100/100
good
  • Security25/25
    No findings
  • Activity25/25
    Human commit this month
  • Required by25/25
    5 modules depend on it
  • Maturity25/25
    In 8 Odoo series since 13.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
5
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.52 MB
Module directory on disk
Code analysis 1 migration note 14 models 8 views 0 HTTP endpoints

Description

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
  • Stock valuation entries for dropship deliveries, symmetric with regular deliveries

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).

Dropship valuation

A dropship move (supplier location straight to a customer location, goods never entering the company's own stock) is now valued and accounted for the same way a regular delivery is: the vendor bill still debits the stock valuation account on receipt, and the module now credits that same account and debits the expense account when the goods leave to the customer, leaving no residual balance. Without this, the stock valuation account accumulated a balance that no longer corresponded to any goods on hand, and the cost of the dropshipped goods was never recognised as an expense.

This applies to dropship moves validated after the fix is installed; historical dropship moves keep their original (missing) accounting entries and require a separate, deliberate regularisation if that balance needs to be cleared.

Dropship accounting entries

The company never physically holds the dropshipped goods (the supplier ships straight to the customer), but under Romanian accounting rules stock is recognised at the transfer of risks and rewards (OMFP 1802/2014, pt. 283 para. 1), not at physical possession — the same principle behind accounts 327 "Goods in transit" and 357 "Goods held by third parties" for stock the company owns without holding. Routing a dropship purchase through the stock valuation account rather than expensing it directly at the vendor bill also keeps a purchase-invoice/sale-invoice timing mismatch (e.g. vendor bill in December, customer invoice in January) from misstating the period result, per the accrual principle (pt. 53).

Forward move (goods leave to the customer):

AccountDebitCredit
Expense (607)value
Stock valuation (371)value

Return move (dropshipped_return), storno convention — same accounts as the forward move, amount in red, not a debit/credit swap:

AccountDebitCredit
Expense (607)−value
Stock valuation (371)−value

408 "Suppliers - invoices not received" never applies to a dropship move: that account is a pivot for goods physically received into a warehouse before the vendor bill arrives, and a dropship move never has that physical-receipt leg. If the vendor bill is missing at the time of the customer sale, the correct counterpart is 327 (a stock-in-transit account), not 408.

For the entry above to stay correct in practice: the credit to 371 must happen in the same accounting period as the debit from the vendor bill and for the same amount, so the account nets to zero for dropship traffic at period end; and dropship quantities should flow through a distinct location so they never mix into a real warehouse's physical inventory count.

Dropshipping a product does not affect the value of that same product's real stock held elsewhere, on either costing method (FIFO or average cost). Core Odoo's own average-cost engine folds dropship moves into the same moving-average pool as real purchases by design, which would otherwise retroactively reprice unrelated stock on hand purely because the same product was also dropshipped; this module routes dropship moves around that recompute entirely for Romanian-accounted companies.

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.

Dependencies

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

Views touched 8

XML IDNameModelTypeStatus
product_template_form_view product.normal.form.inherit.stock product.template form Inherits account.product_template_form_view
view_account_form account.account.form account.account form Inherits account.view_account_form
view_company_form_fifo_location res.company.form.fifo.location res.company form Inherits base.view_company_form
view_location_form_inherit view_location_romania_form stock.location form Inherits stock_account.view_location_form_inherit
view_picking_form view_picking_form stock.picking form Inherits stock.view_picking_form
view_product_category_add_romania_form view_product_category_add_romania_form product.category form Inherits account.view_category_property_form
view_stock_move_form_fifo_neg stock.move.form.fifo.neg stock.move form Inherits stock.view_move_form
view_warehouse stock.warehouse.form stock.warehouse form Inherits stock.view_warehouse

HTTP endpoints 0

No HTTP endpoints found for this module.

Models touched 14

New fields (2)
  • l10n_ro_reception_in_progress_account_id Many2one → account.account
    string='Romania - Reception in Progress Account' args: 'account.account'
  • l10n_ro_stock_consume_account_id Many2one → account.account
    company_dependent=True domain=ACCOUNT_DOMAIN help='Account used for stock consume and usage giving operations' string='Consume Account' args: 'account.account'
Public methods (0)

No public methods.

New fields (2)
  • fifo_neg_origin_move_id Many2one → stock.move
    copy=False help='The incoming stock move that triggered this FIFO negative stock compensation accounting entry.' index='btree_not_null' readonly=True string='Source IN move for negative stock compensation' args: 'stock.move'
  • l10n_ro_extra_stock_move_id Many2one → stock.move
    readonly=True string='Romania - Extra Stock Move' args: 'stock.move'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (1)
  • l10n_ro_stock_account_change Boolean
    help='Only for Romania, to change the accounts to the ones defined on stock locations' string='Allow stock account change from locations'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (1)
  • l10n_ro_property_stock_valuation_account_id Many2one → account.account
    company_dependent=True domain=ACCOUNT_DOMAIN help='In Romania accounting is only one account for valuation/input/output. If this value is set, we will use it, otherwise will use the category value. ' ondelete='restrict' string='Stock Valuation Account' args: 'account.account'
Public methods (0)

No public methods.

New fields (2)
  • fifo_location_negative_compensation Boolean
    compute='_compute_fifo_location_negative_compensation' help='When a FIFO outgoing move happens before the corresponding incoming move (negative stock on the location), its initial value is the standard_price. On the next incoming move, the module emits a correction accounting entry to align the outgoing value with the actual incoming price. Defaults to True for Romanian companies; editable per company.' readonly=False store=True string='FIFO Negative Stock Compensation'
  • fifo_per_location Boolean
    compute='_compute_fifo_per_location' help='Enable FIFO valuation at the source location level (instead of the company level). Outgoing moves for products with cost_method=fifo are automatically split into one stock.move per FIFO layer. Defaults to True for Romanian companies; editable per company.' readonly=False store=True string='FIFO per Location'
Public methods (0)

No public methods.

New fields (3)
  • l10n_ro_property_account_expense_location_id Many2one → account.account
    company_dependent=True domain=ACCOUNT_DOMAIN help='This account will overwrite the expense accounts from product or category.' string='Expense Account' args: 'account.account'
  • l10n_ro_property_account_income_location_id Many2one → account.account
    company_dependent=True domain=ACCOUNT_DOMAIN help='This account will overwrite the income accounts from product or category.' string='Income Account' args: 'account.account'
  • l10n_ro_property_stock_valuation_account_id Many2one → account.account
    company_dependent=True domain=ACCOUNT_DOMAIN string='Stock Valuation Account Romania' args: 'account.account'
Public methods (1)
  • propagate_account(self)

New fields (4)
  • l10n_ro_account_id Many2one → account.account
    compute='_compute_account' store=True string='Romania - Valuation Account' args: 'account.account'
  • l10n_ro_extra_account_move_ids One2many → account.move
    copy=False readonly=True string='Romania - Extra Account Moves' args: 'account.move', 'l10n_ro_extra_stock_move_id'
  • l10n_ro_move_type Selection
    compute='_compute_l10n_ro_move_type' help='Specify the type of stock move for Romanian localization.' store=True string='Romanian - Move Type' args: MOVE_TYPE
  • l10n_ro_transfer_account_id Many2one → account.account
    compute='_compute_account' store=True string='Romania - Transfer Valuation Account' args: 'account.account'
Public methods (0)

No public methods.

New fields (3)
  • fifo_neg_compensation_move_ids One2many → account.move
    readonly=True string='Negative Stock Compensation Entries' args: 'account.move', 'fifo_neg_origin_move_id'
  • fifo_neg_origin_value Monetary
    copy=False currency_field='company_currency_id' readonly=True string='Negative Stock Initial Value'
  • fifo_neg_pending_qty Float
    copy=False help='Quantity from a FIFO outgoing move that was valued at standard_price because the location stack was empty. Compensated FIFO on the next incoming move for the same (product, location) pair.' readonly=True string='Negative Stock Pending Qty'
Public methods (1)
  • search_remaining_qty(self, operator, value)
    For companies with ``fifo_per_location``, iterate per location so the search result matches the per-location ``remaining_qty`` computed by ``_compute_remaining_qty``. Falls back to the base behavior for companies that use company-wide FIFO.

New fields (2)
  • l10n_ro_notice Boolean
  • l10n_ro_reception_in_progress Boolean
Public methods (1)
  • action_l10n_ro_view_account_moves(self)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (1)
  • l10n_ro_fiscal_position_id Many2one → account.fiscal.position
    string='Fiscal Position' args: 'account.fiscal.position'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…