1.9 KiB
1.9 KiB
POS Shift Close
Overview
The pos_shift_close module customizes the Point of Sale session closing behavior in Odoo 19 to accommodate businesses with multiple shifts (e.g., Morning and Afternoon/Night shifts).
By default, Odoo prevents a POS session from closing if there are still unpaid or draft orders. This module introduces a time-based configuration to bypass this restriction for the Morning shift. When the Afternoon shift opens a new session, all draft orders from the Morning shift are automatically transferred over so they can be processed seamlessly.
Key Features
- Configurable Shift Cutoff Time: You can set a "Morning Shift End Time" (in float hours, e.g.,
15.0for3:00 PM) via the POS Configuration menu. - Morning Shift Validation Bypass: If a cashier attempts to close a session before the configured cutoff time, the standard Odoo check for draft orders is bypassed.
- Automatic Order Transfer: When the next session (Afternoon shift) is opened for the same POS, the module automatically scans previously closed sessions and moves any remaining draft orders to the newly opened session.
- Standard Night Flow Restriction: If a session is closed after the cutoff time (i.e., at the end of the day), the standard Odoo behavior applies, and the session cannot be closed until all pending orders are either paid or cancelled.
Setup & Configuration
- Install the module
pos_shift_closeon your Odoo 19 instance. - Go to Point of Sale > Configuration > Settings.
- Under the Accounting section, locate the new Morning Shift End Time field.
- Enter your cutoff time (e.g.,
15:00for 3 PM) and save.
Technical Details
- Dependency: Requires
point_of_sale. - Overrides: Implements specific overrides in
_check_if_no_draft_ordersand_set_opening_control_datainsidepos.sessionmodel. - Time conversions correctly compare against the user's localized timezone (
self.env.user.tz).