-
Created Pricing Rule (PRLE-0003)
- Apply On = Item Group (All Item Groups)
- Selling = Enabled
- Discount = 20%
- Coupon Code Based = Enabled
-
Created Coupon Code
- Code = WEEKEND20
- Linked to PRLE-0003
- Valid dates set
-
Verified in bench console:
frappe.get_meta(‘POS Invoice’)
.get_field(‘coupon_code’).hidden = 0
(field exists and not hidden) -
Checked in browser console:
document.querySelector
(‘[data-fieldname=“coupon_code”]’)
returns null
@AKHIN I’ve identified issues causing the coupon code field to not appear in the POS Invoice screen.
Wrong depends_on condition on the field
In POS Invoice doctype, the coupon_code field has a self-referencing dependency:
“depends_on”: “coupon_code”
This means the field only renders when it already has a value, so it never shows up on a transaction. That’s why document.querySelector(‘[data-fieldname=“coupon_code”]’) returns null even though the field exists and hidden = 0 in the meta.
1 Like