| models | ||
| static/src/overrides/models | ||
| __init__.py | ||
| __manifest__.py | ||
| .gitignore | ||
| README.md | ||
POS Loyalty Discount Before Tax
Overview
This custom Odoo 19 module modifies the standard Point of Sale (POS) loyalty reward calculation and display. By default, Odoo may calculate certain loyalty discounts after taxes. This module ensures that loyalty discounts are applied before tax calculations, meaning the tax is calculated based on the discounted subtotal.
Features
- Before-Tax Calculation: Overrides standard loyalty reward logic in the POS frontend, ensuring tax amounts accurately reflect the post-discount price.
- Split-Tax UI Grouping: When Odoo splits a single reward discount line into multiple rows in the database to accommodate different tax categories, this module groups them back together in the POS UI.
- Per-Claim Separation: Uses a unique per-claim identifier (
rewardCode) as thereward_group_id. This prevents distinct claims of the same reward (e.g. claiming a "cheapest product" discount twice) from visually merging in the POS interface, maintaining parity between the POS screen and the printed receipt.
Technical Details
- Patches
PosOrderinloyalty.jsto calculate discountable amounts before tax, generate uniquerewardCodegroups, and inject the layout-grouping attributesis_reward_group_member,is_reward_group_head, andreward_group_id. - Patches
PosOrderlineinorderline.jsto aggregate prices and quantities of member lines under the group head, and hide secondary grouped lines using thed-noneclass.
Author
- Suherdy Yacob