Coupon Code field is not visible in v16.12.0 POS screen even after correct setup

  1. Created Pricing Rule (PRLE-0003)

    • Apply On = Item Group (All Item Groups)
    • Selling = Enabled
    • Discount = 20%
    • Coupon Code Based = Enabled
  2. Created Coupon Code

    • Code = WEEKEND20
    • Linked to PRLE-0003
    • Valid dates set
  3. Verified in bench console:
    frappe.get_meta(‘POS Invoice’)
    .get_field(‘coupon_code’).hidden = 0
    (field exists and not hidden)

  4. 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