first commit
This commit is contained in:
commit
0ba81c4546
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
.DS_Store
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
14
README.md
Normal file
14
README.md
Normal file
@ -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.
|
||||
2
__init__.py
Normal file
2
__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
20
__manifest__.py
Normal file
20
__manifest__.py
Normal file
@ -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',
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="pos_prevent_combo_split.SplitBillScreen" t-inherit="pos_restaurant.SplitBillScreen" t-inherit-mode="extension">
|
||||
<xpath expr="//Orderline" position="attributes">
|
||||
<attribute name="class">{'selected active': qtyTracker[line.uuid] and qtyTracker[line.uuid] !== 0, 'opacity-75 pointer-events-none': line.combo_parent_id}</attribute>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
Loading…
Reference in New Issue
Block a user