Go to file
2026-06-16 15:09:09 +07:00
models refactor: remove redundant accounting logic and configurations for POS loyalty discounts 2026-04-27 14:13:03 +07:00
static/src/overrides/models fix: recalculate order price totals to prevent stale value usage during synchronous reward line replacement 2026-06-16 15:09:09 +07:00
__init__.py feat: Adjust loyalty discount calculations to apply before tax and introduce accounting for 100% loyalty discounts. 2026-03-12 08:58:58 +07:00
__manifest__.py refactor: remove redundant accounting logic and configurations for POS loyalty discounts 2026-04-27 14:13:03 +07:00
.gitignore chore: update gitignore patterns and rewrite module documentation for clarity 2026-04-27 15:41:35 +07:00
README.md feat: use unique rewardCode as reward_group_id to prevent visual merging of distinct loyalty claims in POS UI 2026-05-25 10:04:07 +07:00

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 the reward_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 PosOrder in loyalty.js to calculate discountable amounts before tax, generate unique rewardCode groups, and inject the layout-grouping attributes is_reward_group_member, is_reward_group_head, and reward_group_id.
  • Patches PosOrderline in orderline.js to aggregate prices and quantities of member lines under the group head, and hide secondary grouped lines using the d-none class.

Author

  • Suherdy Yacob