Go to file
2026-03-31 12:07:41 +07:00
models refactor: update cash adjustment logic to suppress shortages instead of surpluses during POS session closing 2026-03-31 12:07:41 +07:00
static/src/xml fix: Remove zero-amount payments during POS session validation. 2026-01-19 15:41:23 +07:00
__init__.py fix: Remove zero-amount payments during POS session validation. 2026-01-19 15:41:23 +07:00
__manifest__.py feat: Automatically adjust negative cash closing differences to prevent loss journal entries and increment module version. 2026-02-03 16:46:08 +07:00
.gitignore feat: Automatically adjust negative cash closing differences to prevent loss journal entries and increment module version. 2026-02-03 16:46:08 +07:00
README.md refactor: update cash adjustment logic to suppress shortages instead of surpluses during POS session closing 2026-03-31 12:07:41 +07:00

POS Cash Opening Adjustment

Version: 17.0.1.1.0
Author: Suherdy Yacob
Category: Point of Sale
License: LGPL-3

Summary

Prevents unwanted journal entries by handling zero-amount payments and automatically adjusting negative cash differences (shortages) during POS session closing.

Features

  • Phantom Difference Prevention: Relies on standard Odoo mechanisms to ensure no journal items are created when the expected cash mathematically matches the inputted cash (e.g. opening with 150k and closing with 150k, or opening with 200k, selling 100k, and closing with 300k).
  • Shortage Suppression: Automatically adjusts the real balance to match the expected balance when a shortage is detected, avoiding loss/expense journal entries.
  • Surplus Recording: Allows standard Odoo behavior to record a surplus as a profit journal entry.

Technical Details

Validation Override

The module overrides _validate_session in pos.session:

  1. Auto-Adjustment: If cash_register_balance_end_real is greater than cash_register_balance_end (Cash Surplus), it records the difference using standard Odoo accounting. If cash_register_balance_end_real is lower than cash_register_balance_end (Cash Shortage), it overrides the real balance to match the expected balance before standard accounting lines are generated, avoiding the creation of cash diff (loss) journal entries.
  2. Zero-Amount Fix: Iterates through all orders in the session and unlinks any payment lines where the amount is considered zero by the session's currency.