Skip to main content
iVentureTeam
Odoo POS & Retail

Odoo POS Auto Close Session: Scheduled Actions and Cash Control 19/20

Odoo POS auto close session for Odoo 19 and 20: what the source really does, the 20.0 daily closing hour, cash control risks and a tested scheduled action.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
November 21, 202611 min read0 views
Odoo POS Auto Close Session: Scheduled Actions and Cash Control 19/20 cover

Open POS sessions are a common end-of-day problem in retail and restaurant databases. Our Odoo customization services team builds an Odoo POS auto close session job that respects cash control instead of hiding it.

Related service: Odoo for retail — POS, inventory and eCommerce running on one system.

This guide is for store managers, finance leads and Odoo admins who want sessions closed nightly with accurate cash. New to timed jobs? Read our guide to Odoo scheduled actions in Odoo 19 and 20.

Does Odoo close POS sessions automatically in Odoo 19 and 20?

No, neither Odoo 19 nor Odoo 20 closes a POS session automatically; they only remind you and, in Odoo 20, post daily accounting. We checked this against the 19.0 and 20.0 point_of_sale source on GitHub.

In both versions, _alert_old_session finds sessions opened 7 or more days ago and not closed, then schedules a "close this session" activity for the owner if none exists.

That reminder runs from the inventory scheduler. In 20.0 the hook moved to the pos_stock bridge module, which installs automatically with Inventory. Without Inventory, Odoo 20 sends no reminder.

Odoo's close the POS register guide states: "It is strongly advised to close the POS register at the end of each day." Advice, not automation.

What changed in Odoo 20 POS session closing?

POS session closing: Odoo 19 vs 20: what the source does

Odoo 20 split session closing in two: daily accounting that runs on its own, and the session close that still needs a person or your code.

TopicOdoo 19Odoo 20
Built-in auto closeNoneNone; daily entries only
POS cron jobsNo POS cron file in the moduleThree, including Auto Order Invoicing
Daily entriesPosted only at session closePosted at the Daily Closing Hour
Close method from codeaction_pos_session_closing_controlclose_session_from_ui
Cash control triggerA payment method that counts cashA payment method of type cash
Old-session reminder7 days, inventory scheduler7 days, via pos_stock

The new POS cron data file in 20.0 defines "POS: Product Snooze cleanup", "POS: Process Order Tasks" every 5 minutes, and "POS: Auto Order Invoicing" every 10 minutes.

How the Odoo 20 daily closing hour works

Each POS config now has a Closing Mode, Daily or At closing, with Daily as the default and a Daily Closing Hour of 4.0. In Settings this appears under Accounting as "Closing entries", described as the time the POS "will post its accounting entries".

Every 10 minutes the job looks for open sessions with orders whose closing hour falls in the last 10-minute window. For each one it calls _validate_session_accounting, which posts the entries and marks the orders done. It does not set the session to closed.

The field help says the session "will be automatically closed", but the code only posts accounting. Plan for the session to stay open, and recheck the hour after daylight-saving changes, as the job compares it with UTC.

What are the risks of leaving an Odoo POS session open?

An open session hides cash differences, delays stock and reporting, and blocks the next shift from starting clean. The longer it stays open, the harder the count becomes.

  • Cash drift: days of sales land in one session, so a short drawer cannot be traced to a shift.
  • Late accounting in Odoo 19: entries post only at close, so daily revenue and tax reports lag behind the till.
  • Stock timing: when stock updates at closing, on-hand figures stay wrong until the session closes.
  • Shift blocking: Odoo allows one session per POS that is not closed, so a forgotten session stops a clean new opening.
  • Failed closes: one Odoo 19 user found their session close failed every time on an analytic plan error, blocking the POS.

When a close fails, Odoo says the cashier "will be redirected to the back-end to manually close the session", as a forum thread on a failed close shows. Night staff rarely finish that.

How does cash control affect an automatic POS close?

Cash control is why you cannot simply call the close method from a cron: without a counted amount, Odoo assumes an empty drawer.

In Odoo 19, the counted cash lives in the Ending Balance field. The difference is the counted amount minus the expected amount. If your code never sets the counted amount, the difference equals the whole expected cash, posted as a loss on the cash journal's Loss Account.

In Odoo 20, close_session_from_ui takes a dictionary of counted amounts per payment method. If the cash method is missing, counted cash is 0 and Odoo posts a "Cash correction" line for the full difference. Bank methods you leave out are simply skipped.

So an automatic close has three honest options:

  • Close at expected cash: record the expected amount as counted, then have a manager count the drawer next morning and post any difference.
  • Alert only: leave cash sessions open and send the manager a list of sessions still open after closing time.
  • Close non-cash only: close sessions on configs with no cash method, and alert on the rest.

Set Maximum Difference only guards the POS screen. Your cron bypasses it, so the next-morning count is your control.

How do you auto close a POS session with a scheduled action?

Create a scheduled action on POS Session that finds sessions open after closing time and closes each with the expected cash. Odoo's scheduled actions reference covers the ir.cron fields.

  1. Turn on developer mode and go to Settings, Technical, Automation, Scheduled Actions.
  2. Create a new action on the model "Point of Sale Session" with the type "Execute Code".
  3. Set Execute Every to 1 day and the Next Execution Date to a time after your last store closes.
  4. Pick a Scheduler User with POS Administrator rights and the store's timezone.
  5. Paste code that filters sessions, passes the expected cash and logs every failure.
  6. Run Manually on staging, review the closing entries, then enable it on production.

A minimal Odoo 20 version looks like this. It closes sessions opened more than 14 hours ago:

```python cutoff = datetime.datetime.now() - datetime.timedelta(hours=14) sessions = model.search([('state', 'in', ['opened', 'closing_control']), ('start_at', '<', cutoff)]) for s in sessions: cash = s.get_closing_control_data().get('default_cash_details') or {} counted = {str(cash['id']): cash['amount']} if cash else {} res = s.close_session_from_ui(counted) if not res.get('status'): log("%s not closed: %s" % (s.name, res.get('message')), level='warning') ```

For Odoo 19, set the counted cash with post_closing_cash_details(s.cash_register_balance_end) when the config has cash control, then call close_session_from_ui(). In 19.0 the result key is "successful", not "status".

The 14-hour cutoff is illustrative; set it to fit your trading hours. Late-night stores need a later run or a filter by POS config.

Can you use a server action to close POS sessions?

Yes, a server action with the same code, bound to the POS Session list, gives managers a "Close selected sessions" menu item.

Create it on "Point of Sale Session" with "Execute Code", loop over records instead of a search, and click "Create Contextual Action" to add it to the list's Actions menu.

This is the safest first step: managers run it for a few weeks, you review the entries, then you schedule it. For event-based reminders, see our guide to Odoo automation rules in Odoo 19 and 20.

Which POS method names are correct in Odoo 19 and 20?

Most Odoo 17 and 18 tutorials call methods that Odoo 20 removed, so check every name against your version before you paste code. We read each method below in the 19.0 and 20.0 pos_session.py source.

MethodOdoo 19Odoo 20
action_pos_session_closing_controlPresent, backend close buttonRemoved
action_pos_session_validate and _closePresentRemoved
close_session_from_uiTakes bank difference pairsTakes counted amounts per method
post_closing_cash_detailsSets counted cashNot in pos_session.py
get_closing_control_dataExpected amounts by methodExpected amounts by method
_validate_session_accountingNot presentPosts the session entries

In Odoo 20 the backend "Close Session & Post Entries" button calls close_session_from_ui. States are the same in both: Opening Control, In Progress, Closing Control, Closed & Posted.

How do you test and monitor an automatic POS close?

Test on a neutralized staging copy with real sessions, then check the job's results every morning for the first month.

On a staging copy, scheduled actions are switched off, so enable only this one. Our Odoo staging environment checklist lists what else to check.

  • Test cases: cash, card-only, a draft order, an open restaurant table, and multi-currency if you use it.
  • Check the entries: compare the closing entry and cash statement with a manual close of the same data.
  • Watch failures: a draft order makes the close return a message rather than an error, so read the job's log lines.

For a wider review of your database before you automate, start with our free Odoo health check.

Which retail and restaurant teams need automatic POS closing most?

Teams with many tills, late shifts or no night back-office staff gain the most, and each needs its own rule.

IndustryPain or cost driverOdoo approachHow iVentureTeam helps
Multi-branch retailSessions left open across many storesNightly cron filtered by POS configBuild the job and a branch report
Restaurants and barsOpen tables and late closing timesSkip sessions with draft ordersAdd a draft-order alert for managers
Quick-service foodCard-heavy sales, small cash drawersClose non-cash sessions on their ownSplit rules by payment method
Kiosks and self-orderNo cashier to close the registerClose at expected cash, morning checkAdd the count to the opening routine

For the full retail picture, see Odoo ERP for retail and Odoo ERP for restaurant services.

Should you build POS auto close in the UI or as a custom module?

Use the UI for a short test or a manager button, and a small custom module for anything that runs every night. A module adds tests, savepoints and an upgrade path.

A UI scheduled action runs all sessions in one transaction, so one error rolls back the whole run. A module can wrap each session in a savepoint, as Odoo 20 does in its own daily job.

A module can also add a per-store "Auto close" checkbox and a summary email, with tests so the next upgrade does not quietly break it.

Odoo Online cannot install custom modules, so there the UI action is your only route; retest it after every version update. Our Odoo 19 POS review covers which POS features ship as standard.

How iVentureTeam helps automate Odoo POS session closing

Old sessions piling up? Run a health check

iVentureTeam builds POS closing automation that closes sessions on time and keeps cash differences visible. We have delivered 150+ ERP projects across 35+ countries with 40+ Odoo specialists, led by a consultant with 13+ years in Odoo.

  • Version check: we confirm which methods your database has before writing code.
  • Closing rules: we agree with finance how to treat cash, card-only and restaurant sessions.
  • Module build: a small, tested module with per-store settings and failure alerts, delivered through our Odoo POS implementation approach.
  • Morning control: a drawer-count step and difference report for store managers.

POS end-of-day automation case study: Ajwan International

This was not a session auto-close project; it was the closest fit we have, a POS to Odoo integration that made end-of-day work run on schedule. Ajwan International is a Kuwaiti IT provider whose restaurant client ran WebPOS at the till and Odoo in the back office.

Menus and prices were kept twice, and finance rebuilt sales reports from till exports. We built custom Odoo modules and REST APIs, with scheduled synchronization and error handling, so bills, items and payments flow into Odoo.

The 10-week project reports 90% less manual re-keying between POS and ERP, and Ajwan's Operations Manager said "end-of-day reconciliation takes minutes".

Read the Ajwan WebPOS and Odoo restaurant integration case study.

The bottom line on Odoo POS auto close session

Odoo 19 and 20 will not close a forgotten POS session for you, so build a scheduled action that closes at expected cash and puts the drawer count into the next morning. Odoo 20's daily entries help, but they do not close the session.

Check method names against your version, test every session type on staging, and log every failure.

Ready to stop chasing open POS sessions?

Plan my POS closing job

Get a closing job built and tested for your stores. Plan your POS session automation with us, call +91-90235-15208, or email business@iventureteam.com.

Frequently Asked Questions

Can Odoo POS close a session automatically?

+

Not in standard Odoo 19 or 20. Odoo adds a reminder after 7 days, and Odoo 20 posts daily entries at a set hour. Closing needs a scheduled action or a custom module.

What does the Odoo 20 Daily Closing Hour do?

+

It sets when the "POS: Auto Order Invoicing" job posts accounting entries for open sessions with orders. The default is 4.0, meaning 04:00. In the code we read, the session itself stays open.

Which method closes a POS session from code in Odoo 20?

+

Use close_session_from_ui on the session, passing counted amounts per payment method. Odoo 20 removed action_pos_session_closing_control, which older tutorials and Odoo 19 code still use.

What happens to cash if a cron closes the session?

+

If you pass no counted cash, Odoo treats the drawer as empty and posts the full expected cash as a difference. Pass the expected amount instead, then count the drawer the next morning.

Why can't I close my Odoo POS session?

+

Common causes are draft orders, unposted invoices, a missing loss or profit account on the journal, or a broken analytic setup. The error message usually names the cause.

Can I auto close POS sessions on Odoo Online?

+

Yes, with a scheduled action in developer mode, as Odoo Online runs Execute Code actions. You cannot install a custom module there, so keep the code short and retest it after each version update.

Does closing a POS session update stock in Odoo?

+

It can. When stock updates at closing, deliveries are created when the session closes, so an open session leaves on-hand figures out of date until it closes.

Is it safe to close restaurant POS sessions automatically?

+

Only if your code skips sessions with draft orders. Odoo blocks the close when orders are still in draft and not scheduled for later, so open tables must be paid or cancelled first.

Free written answer from a certified consultant

Getting Odoo Accounting set up right?

We map your accounting, tax and reporting in Odoo and show what to set up first, and what to watch.

Free, with no obligation. A senior consultant replies within 12 business hours.

We use cookies to improve your experience

Essential cookies make the site work, and we use analytics to improve it. Choose “Only necessary” to turn analytics off. See our cookie policy.