Price list on the basis of "Cost" of item

@nabinhait thank you. I have added the same in Github.

Negative Discount does not work.

@rmehta This was a critical requirement for us before migration (for taking decision on migration as we have more than 2000 products). We request to expedite “Margin” facility or activate negative discount till the time margin field is available.

Just pushed a fix. Will be updated in next release!

Thank you very much… Much appreciated… :slight_smile:

It would be a good idea to allow to create prices lists based on other price list ( root/master price list ) on this way you can have a master price list ( for example costs price list ) and to “create end-user price” list and “distributor price list” based on “costs price list”. This way allows to define add % margin over root price list. A similar process it is used on Odoo and it is really powerful.

As Deven says, the usual way on some business segments it is not to apply discount over retail price but add profit margin over cost. With the current way it is really complicated to maintain several prices list, in first place because you need to add all products one by one each time you want create a new price list, and also you need to modify all prices list each time the cost item changes :sweat:


@rmehta Round About Solution (Jugad :slight_smile: ) works. We need to keep same price list for Selling and Buying. Purchase cost should be kept as price list value. Price Rule to be applied only on Selling transaction. Thanks.

I am afraid that everyone would not be able to figure it out how to use it. And it’s prone to error (especially when price would be automatically updated during saving of transaction). I hope this is just a temporary solution.

I think, if a pricing rule would have facility to base One Price-list on the basis of Another Price-list, it can be the simplest and easy to use kind of solution.

Thank you anyways and we appreciate hard work by the team.

1 Like

Hi, I’ve an query. How i can add price range against a single product.
for example a product have different packing weights i.e. 5gm , 15gm etc. Now the price for same product is different according to packing size.
Please guide me. Thanks.

Hi, I’ve been using ErpNext for a week and with what I’ve tried I really like its great functionality and simplicity, my current system is Sage 50 and the reason we want to move is because it does not have a point of sale and does not manage several wineries in the 2014 version and, above all, we seek innovation against cost.

Erpnext In agreement with the present and the future of our company, apparently, one of my main doubts was how I add the amount of the cost to my products, since I could not find the field, supporting me with the official support that they indicated to me. . that the field is shown as “Rate of valuation”.

I would like to know how I could apply the prices of my products according to the latest acquisition “cost” of products + the profit margin.

I add caturas to illustrate my need.

This would be where I would filter my products in a massive way according to cost, type, etc.

The following image shows the products that are applied in my filter. To which I would update the price.

and you can also see that I can apply the prices for the list price 1, 2, 3 and each price is based on the last cost plus the percentage, since it could also be based on the current price, plus a percentage or simply add up to the last cost the desired amount.

I hope to make myself understood, my English is not good.

I look forward to your kind response



Hi All,
I’m using v13.21.0, and have been struggling with this feature.


  • I created a Price List “COST
  • Type = Buying AND Selling
  • I added to it an item price (say item_A)
  • Linked Price List = “COST
  • Type = “Buying and Selling” (Can’t change this as it is linked to Price List “COST”)
  • Left “Customer” blank
  • Set Supplier to “Supplier_A
  • I set the rate to “USD 1000
  • Validity 01-01-2021 to 31-12-2022


  • When creating a Purchase Order for “item_A” from “Supplier_A”, it used the rate USD 1000 => Correct behavior
  • When creating a Quotation of “item_A” for any customer, it is not getting the rate. It gives rate = $0.00. => Price not loaded.

Adding Price Rule:

  • I added a new “Pricing Rule” with the following settings:
  • Apply on: item_A Brand , also tried apply on item code of “item_A”
  • Party Information: tried “Selling” / “Selling and Buying”
  • Applicable for: tried Customer_A and tried “All Customer Groups” and tried leaving it blank
  • Set Margin to 50% (Percentage)
  • Set Discount to 10% (Percentage)
  • Discount Applicable on: tried “Blank” and tried “COST” (I can choose COST only when I make the Pricing Rule of type “Buying and Selling”


  • When creating a Purchase Order for “item_A” from “Supplier_A”, it used the rate USD 1000 => incorrect behavior as the Margin and Discount were ignored (pricing rule set to Buying & Selling)
  • When creating a Quotation of “item_A” for any customer, it is not getting the rate. It gives rate = $0.00. => Price not loaded and Pricing Rule not fired.

Setting two separate Price Lists:

  • I made one Price List for Buying and another for Selling
  • Added Item Price under each rule
  • Added Pricing Rule for each of them (one for Buying and the other for Selling)

Rates / Margin / Discount applied correctly in both Quotation and Purchase Order.


  • When setting one Price List of type “Buying AND Selling”, adding an Item Price to it, the “Rate” is not loaded in Quotation, it loads only in Purchase Order.

Can’t create a “Selling” List Price that is dependent on a “Buying” List Price, therefore every-time the Buying Item Price changes we have to update the “Selling” Item Price.

I googled about this but unfortunately I didn’t reach anything useful except this post which is touching the same problem.

I want to know if the feature of building a Selling price based on a root price list (or a buying price) exists in ERPNEXT (like Odoo) or I have no choice but to use two different price lists (one Buying and one Selling) and survive with the manual updates.

Any ideas?


Please do not set supplier.

Please create 2 separate pricing rules for with different applicable for : supplier and customer.

share your findings.

Here are the steps,

1- Created “Cost Test” Price List as Buying and Selling

2- Added one Item Price to the created List Price

Rate = USD 1000 ( I don’t know if the system will consider this as Buying or Selling!)

3- Created "Test Selling Rule for “Other Brand” " for a specific Customer

4- Set Quantity and Amount limits

5- Set Margin to 10% , No discount , Allow multiple rules

6- Duplicated the “Test Selling Rule” and changed it’s name to "Test Buying Rule for “Other Brand” and changed only the “Party Information” part

7- Set Discount to 10% but can’t choose the List Price due to the hard coded Filter condition.

Test 1 - Quotation:

1- Create Quotation and choose the List Price “Cost Test” :

2- Adding the item :

Conclusion: 20% Margin didn’t load , the pricing rule wasn’t triggered

Test 2: Purchase Order

1- Create a Purchase Order to “Test Supplier” , Choose Price List “COST Test”

2- Select the item

Item Price = USD 1000 loaded

Conclusion: 10% Discount after 20% Margin didn’t load , the pricing rule wasn’t triggered

Result when disabling the two pricing rule: Same result, the Quotation and Purchase Order set the rate as USD 1000, this means the two pricing rules are have no effect either enabled or disabled.

Test Summary:

  • When Creating a Price List with type “Buying AND Selling” and adding an Item Price to it, the “Rate” will be used in either Quotation or Purchase Order.

in pricing rule, tick both buying and selling check box,

1 Like

Here is the correct settings after some trials:

Required Scenario:

  • Test Item “real cost” from “Test Supplier” is USD 900
  • I want to purchase the item from Test Supplier at USD 900 (at 10% discount from the List Price)
  • I want to sell the item to any Customer at margin 40% (USD 1400)


  • Create a “COST Price List” (as in previous post)
  • Add “Test Item” and set rate to USD 1000 (in case you don’t want to reveal your real cost or have a safety margin) or USD 900
  • Added Pricing Rule “Buying from from Test Supplier” as follows:

Set Buying and Selling, and Apply for specific Supplier

  • Set no Margin and Discount = 10% (in case you set the rate to USD 1000) or leave 0


1- Quotation loaded the item at 40% Margin automatically (USD 1400) to “any Customer”
2- Purchase Order to “Test Supplier” loaded the item at 10% Discount (USD 900)

Thanks @szufisher for the tips