From 0ba81c4546d3e843d2efd5ca5ba5edcfdb47ac5c Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Mon, 1 Jun 2026 22:46:29 +0700 Subject: [PATCH] first commit --- .gitignore | 8 ++++++++ README.md | 14 +++++++++++++ __init__.py | 2 ++ __manifest__.py | 20 +++++++++++++++++++ .../split_bill_screen_patch.js | 13 ++++++++++++ .../split_bill_screen_patch.xml | 8 ++++++++ 6 files changed, 65 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 __init__.py create mode 100644 __manifest__.py create mode 100644 static/src/app/screens/split_bill_screen/split_bill_screen_patch.js create mode 100644 static/src/app/screens/split_bill_screen/split_bill_screen_patch.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d1ba00d --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +__pycache__/ +*.py[cod] +*$py.class +.DS_Store +.idea/ +.vscode/ +*.swp +*.swo diff --git a/README.md b/README.md new file mode 100644 index 0000000..9da29e4 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# POS Prevent Combo Split + +This module prevents users from splitting individual combo sub-items on POS bill/order splitting. + +## Features + +- Disable individual combo sub-item clicks on POS bill splitting screen. +- Set combo sub-items visual state to dimmed and unclickable. +- Force combo splitting from the combo parent only, which automatically splits both the parent and its sub-items. + +## Installation + +1. Install the pos_prevent_combo_split module. +2. Restart Odoo server and update the app list. diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..67dee8c --- /dev/null +++ b/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. diff --git a/__manifest__.py b/__manifest__.py new file mode 100644 index 0000000..902d6f4 --- /dev/null +++ b/__manifest__.py @@ -0,0 +1,20 @@ +{ + 'name': 'POS Prevent Combo Split', + 'version': '19.0.1.0.0', + 'category': 'Point of Sale', + 'summary': 'Prevent splitting individual combo sub-items on POS bill/order splitting', + 'description': """ + Prevents splitting individual combo sub-items on POS bill/order splitting. + Allows splitting only from the combo parent, which automatically splits both the parent and its sub-items. + """, + 'author': 'Suherdy Yacob', + 'depends': ['pos_restaurant'], + 'data': [], + 'assets': { + 'point_of_sale._assets_pos': [ + 'pos_prevent_combo_split/static/src/app/**/*', + ], + }, + 'installable': True, + 'license': 'LGPL-3', +} diff --git a/static/src/app/screens/split_bill_screen/split_bill_screen_patch.js b/static/src/app/screens/split_bill_screen/split_bill_screen_patch.js new file mode 100644 index 0000000..1b1ea84 --- /dev/null +++ b/static/src/app/screens/split_bill_screen/split_bill_screen_patch.js @@ -0,0 +1,13 @@ +/** @odoo-module **/ + +import { SplitBillScreen } from "@pos_restaurant/app/screens/split_bill_screen/split_bill_screen"; +import { patch } from "@web/core/utils/patch"; + +patch(SplitBillScreen.prototype, { + onClickLine(line) { + if (line.combo_parent_id) { + return; + } + super.onClickLine(line); + } +}); diff --git a/static/src/app/screens/split_bill_screen/split_bill_screen_patch.xml b/static/src/app/screens/split_bill_screen/split_bill_screen_patch.xml new file mode 100644 index 0000000..fd1f9e3 --- /dev/null +++ b/static/src/app/screens/split_bill_screen/split_bill_screen_patch.xml @@ -0,0 +1,8 @@ + + + + + {'selected active': qtyTracker[line.uuid] and qtyTracker[line.uuid] !== 0, 'opacity-75 pointer-events-none': line.combo_parent_id} + + +