How to Override Pricing Rule for Individual Quotation Items

Hi everyone,

We’re trying to implement a custom behavior in ERPNext, where the pricing rule applies by default, but salespersons should be allowed to manually override the rate for individual items in the Quotation and keep that rate without ERPNext forcing the pricing rule again.

Scenario:

Item: ITEM-0001
Default selling price: 140
Pricing Rule applies a 25% discount, so the price becomes 105
During the sales process, the salesperson selects the item and ERPNext correctly applies 105
But when they try to give more discount manually (e.g., change rate to 100), ERPNext resets it back to 105 during save or refresh.

We tried:

Setting “Ignore Pricing Rule”, but that disables all rules for the entire quotation, which we don’t want.
We want to ignore pricing rule per item, not globally.

Our goal is:

Pricing Rule should apply by default.
But if the salesperson manually edits the rate, ERPNext should respect that value and not apply pricing rules again for that item.

How we can achive it, we tried by creating custom app but did’t not succeeded , always erpenxt overiding our custom app logic. or any other method please share.

Has anyone implemented this before? Any guidance or example would be very helpful.

Thanks in advance!

HI @shihab0020

In order to implement this custom behavior, where the pricing rule applies by default but can be manually overridden per item by a salesperson, you can use custom scripting (Client Script) with some server-side logic to suppress pricing rule enforcement after manual override.

If the item level suppression can be jumped, Additional Discount on whole Quotation may server the purpose without any customization.

Thanks for the response!

We definitely need item-level control, as different items may have different discount strategies. Using “Additional Discount (%)” at the quotation level won’t work for our case.

We’ve tried using a custom app to handle this — for example, if item1 has a pricing rule that applies a 25% discount (140 → 105), and the salesperson manually reduces it further to 100, ERPNext still resets it back to 105 when saving. We want to allow the manual rate to override the pricing rule for that item only.

We even tried setting ignore_pricing_rule = 1 on the item row in a server-side script, but ERPNext still reapplies the rule. We used logic Qoutation item table custom filed like custom_manual_rate to detect sales person during qoutation time wants to change rate or not logic.

If possible, could you please share a sample script (client or server) that allows manual override per item? We’d really appreciate it — all our current attempts are being overridden by ERPNext’s pricing rule logic.

Thanks again!

I just recently discovered this issue also. In our case we ideally would want to have that item level manual control as well. For example, say a customer generally receives a blanket 10% discount on the standard selling rate. As far as I can tell the only way to achieve this in ERPNext (out of the box) is using a Pricing Rule, ie not via a Price List directly (which requires each item price to be set individually). But then in some cases we may want to not apply the 10% discount for a particular item. When testing this, it seemed the only way was to select ‘Ignore Pricing Rule’ and then manually enter the discount per line item. I guess that might be ok if you have only a few items in your doc or it’s an occasional thing here and there, but of course becomes rather impractical with lots of line items and/or for more frequent application!

Hi @ahsantareen,

Thanks for the reply!

We need item-level control since each item may have different discount logic. We tried client and server scripts, but ERPNext still overrides the manually entered rate with the pricing rule rate.

Could you kindly share a sample script or approach to allow manual override per item?

Thanks in advance!