Skip to Content

PMIS Accounting Dates

Beta License: LGPL-3 PMISuite/stock-accounting Version: 18.0

Shared Accounting Dates infrastructure for Odoo 18 Community. Depends only on account; it does not install stock, localization, fiscal-month, or reporting addons.

Table of contents

Features

Date Roles

  • Accounting date: Odoo's native account.move.date and its native journal-item relationship. This addon does not redefine that field.

  • Fiscal date: fiscal_date, used for financial accounting and reporting. Journal items store an indexed, read-only related value from their move.

  • Tax date: tax_date, determining the applicable tax-reporting period. Journal items store an indexed, writable value so policy addons can retain line-specific reporting dates and correction events.

Defaults and Synchronization

By default, both additional roles use the accounting date. Explicit fiscal dates are editable; changing a fiscal-date compute dependency recalculates the date. An explicit tax date different from its default survives subsequent accounting date changes. On draft moves, empty line tax dates and line dates following the previous header date are synchronized; differing line dates are preserved. Section and note lines are excluded from tax-date initialization. Posting prepares draft dates before Odoo posts the move. Automatic move synchronization does not rewrite posted moves. Native access, company, date-type, and posting constraints apply; there is no universal ordering or equality constraint between the three roles.

The draft-only guard belongs to move-level synchronization. The line-level initializer also runs when lines are created or reassigned and has no equivalent state guard. The fiscal field remains computed from its dependencies. This addon does not provide a general lock preventing all date changes on posted entries.

Usage

  1. Open an invoice or journal entry. Fiscal Date and Tax Date appear after the accounting date. The header tax date is editable in draft only in the supplied form.

  2. Review fiscal and tax dates on journal items. Fiscal date follows the move; line tax dates can differ when a reporting policy requires it.

  3. Use the optional date columns, date filters, and grouping options on journal entries and journal items. Invoice lists also expose the dates; journal-item pivot and graph views include them.

Extension Contract

_get_default_fiscal_date() and _get_default_tax_date() are singleton hooks on moves and lines. _prepare_accounting_dates() returns date values without writing; _synchronize_accounting_dates(previous_dates=None) applies defaults to the explicit recordset. previous_dates maps record IDs to previous tax dates. On moves, synchronization updates eligible line tax dates; it does not write the prepared defaults back to empty headers. Line synchronization also recomputes the related fiscal date. No hook searches for or initializes every move in the database.

Consumers can extend _get_accounting_date_driver_fields() on moves to track additional default drivers. _get_accounting_date_lines() selects lines for automatic draft synchronization. A localization may exclude its lines and invoke date initialization only after its own posting and lock checks. Additional fiscal-date dependencies belong on an override of _compute_fiscal_date() calling super(); field definitions remain here.

Ownership

  • pmis_stock_move_fiscal_month supplies the manual stock fiscal-month default and the link from fiscal_date to date_range_fm_id.

  • pmis_account_financial_report consumes the shared fiscal date directly.

  • Localization addons own tax-date policy, VAT locks, and correction rules. Those rules are not supplied by this infrastructure addon.

Installation and Upgrade

For a new installation, only account is required. Localization and stock addons are optional consumers, not installation prerequisites.

When upgrading a database with former field owners, coordinate this addon's installation with the affected consumers. The pre-install hook transfers field metadata ownership for move and line fiscal dates from pmis_stock_move_fiscal_month and line tax dates from l10n_si_tax_addons when the target external ID is absent. It does not rename stored columns or itself modify accounting dates. Consumer-specific migrations remain the responsibility of those addons.

Existing empty tax headers remain empty until explicitly edited or initialized; _prepare_accounting_dates() supplies their effective fallback. This preserves historical entries with mixed line dates. Existing fiscal dates and tax-line dates are retained. Do not uninstall former field owners as a migration shortcut.

Validation

tests/test_account_move.py, tests/test_account_move_line.py, and tests/test_hooks.py cover defaults, persisted line values, explicit roles, line exceptions, display lines, copies, batch creation, extension hooks, and posted-move synchronization. Run with the workspace's run_pytest_addon.sh on an authorized disposable database. Also run the fiscal-month tests and Slovenian header-date, tax-lock, refund, and correction tests when upgrading those consumers. An installation/upgrade test is required before deployment; syntax or lint checks do not prove registry or migration safety.

Bug Tracker

Bugs are tracked on PMISuite Repository Issues. Before reporting an issue, check whether it has already been reported. Include the Odoo version, installed date-policy addons, steps to reproduce, and the expected and observed date behavior using synthetic examples.

Credits

Authors

Contributors

  • Matjaž Mozetič

Maintainers

LUXIM MATMOZ

Current maintainer:

sysadminmatmoz

Luxim is an independent R&D and deployment company focused on solving complex problems in the Odoo ecosystem.

Odoo Community Association

Luxim is an active member of OCA (Odoo Community Association).