39 lines
1.8 KiB
Python
39 lines
1.8 KiB
Python
# -*- coding: utf-8 -*-
|
|
{
|
|
'name': 'POS Loyalty Usage Limit',
|
|
'version': '1.0',
|
|
'category': 'Sales/Point of Sale',
|
|
'summary': 'Add usage limit to loyalty cards per day, month, or year',
|
|
'author': 'Abdul Aziz Amrullah',
|
|
'depends': ['pos_loyalty'],
|
|
'description': """
|
|
POS Loyalty Usage Limit
|
|
=======================
|
|
|
|
This custom Odoo 19 module enhances the Point of Sale (POS) Loyalty system by introducing redemption usage limits on individual loyalty cards.
|
|
|
|
Key Features:
|
|
-------------
|
|
* **Flexible Limits**: Configure limits to be enforced per day, per month, or per year.
|
|
* **Card-Level Control**: Limits are configured individually on each `loyalty.card`, allowing specific rules per customer.
|
|
* **Smart POS Filtering**: The "Reward" button is proactively hidden in the POS interface if the customer has reached their limit, reducing cashier confusion.
|
|
* **Offline Synchronization**: Correctly balances backend historical usage data with live un-synced offline session data for accurate enforcement.
|
|
* **Strict Backend Validation**: Employs real-time RPC validation checks during payment processing to prevent exploitation via concurrent POS sessions.
|
|
|
|
How it works:
|
|
-------------
|
|
If a card has a limit of '1 per day', the customer can only redeem a reward once per day. If they attempt a second redemption in the same day (even on a different POS register), the transaction is blocked, or the reward is hidden. If the limit is turned off (unchecked), the card operates with unlimited usages as per standard Odoo behavior.
|
|
""",
|
|
'data': [
|
|
'views/loyalty_card_views.xml',
|
|
],
|
|
'assets': {
|
|
'point_of_sale._assets_pos': [
|
|
'pos_loyalty_usage_limit_custom/static/src/app/models/pos_order.js',
|
|
],
|
|
},
|
|
'installable': True,
|
|
'application': False,
|
|
'license': 'LGPL-3',
|
|
}
|