This script allows you to automatically close Point of Sale (POS) sessions in Odoo that are in a 'closing control' state. It validates all orders in the session and then closes it. I've tested this only on Odoo Version 12. Feel free to submit pull requests for other versions of Odoo.
- Python 3
- Odoo installation with XML-RPC enabled
- Odoo database credentials with permissions to manage POS sessions
To use the script, simply run it with Python 3 and pass in the IDs of the POS sessions you want to close as arguments. For example:
python3 close_session.py -pos=11,13
# optional with maximum cash register difference, this will overwrite the default of 1500
python3 close_session.py -pos=11 -maxdiff=1000
This will close all POS sessions with IDs 11 and 13.
Before running the script, you will need to set up the following environment variables:
- ODOO_URL: the URL of your Odoo instance
- ODOO_DB: the name of your Odoo database
- ODOO_USERNAME: the username for your Odoo account
- ODOO_PASSWORD: the password for your Odoo account
You can set these variables in your .bash_profile file.
The script also logs all activity to a file named 'closing.log' in the same directory as the script.
Feel free to submit a pull request or open an issue if you have any suggestions or find any bugs.
This script is licensed under the MIT License.