24 lines
1.9 KiB
Markdown
24 lines
1.9 KiB
Markdown
# 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
|
|
1. **Configurable Shift Cutoff Time**: You can set a "Morning Shift End Time" (in float hours, e.g., `15.0` for `3:00 PM`) via the POS Configuration menu.
|
|
2. **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.
|
|
3. **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.
|
|
4. **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
|
|
1. Install the module `pos_shift_close` on your Odoo 19 instance.
|
|
2. Go to **Point of Sale > Configuration > Settings**.
|
|
3. Under the **Accounting** section, locate the new **Morning Shift End Time** field.
|
|
4. Enter your cutoff time (e.g., `15:00` for 3 PM) and save.
|
|
|
|
## Technical Details
|
|
- **Dependency**: Requires `point_of_sale`.
|
|
- **Overrides**: Implements specific overrides in `_check_if_no_draft_orders` and `_set_opening_control_data` inside `pos.session` model.
|
|
- Time conversions correctly compare against the user's localized timezone (`self.env.user.tz`).
|