Discount on Sale

I made an implementation: Issue 9589: Manage discount on sale line - Tryton issue tracker

4 Likes

I continue my tests around this module, and I did not succeed in initializing the base price with the price taken from a price list. Can you confirm that this has not yet been implemented ?

By default the base price is the list price but the method compute_base_price is there to be extended and implement other ways.

BTW, just did a quick look at the code, but doesn’t the sale_discount module miss support for sale_amendment?

Which feature are you missing?

If the unit price is updated with an amendment the discount will be recomputed as it is a function field.

So for me there is nothing else missing.

Shouldn’t the user be able to change “base_price” field?

I do not see why. Once the sale is confirmed the base price is fixed so if you update the unit_price you are oferring a bigger discount.

Or a lower or even negative discount.

The thing is that amendment is meant to fix mistakes. And those can be in unit_price but also in base_price. Once the amendment is applied the sale is updated with the correct values so changing only the unit_price may not be the fix the user needs.

Say:

  • The user introduced base_price = 10, discount = 10%, unit_price = 9 in the sale
  • Then needs to change the price to become base_price = 12, discount = 10%, unit_price = 10.8

If only the unit_price can be changed, then the discount will be negative which is not correct. Of course the created invoice will be correct but not the data in the sale.

discount is just marketing. If you already show to the customer a different base price, there is no point to change it later. This will just be perceived as cheating.

1 Like

I do not see why you need to change the base price. If you agreed to the user that the base price is 10, the base price should be always 10 no mather if you update latter the sale.

I may understand that you are raising the price of a product the 1st of January. So all the sales created before this that should have the previous base price and the sales after this date the new base price. If you create an amendement for a sale created before the 1st of January and you update the unit_price to match the new unit price then is a raise for the customer and the discount should reflect it.

This topic was automatically closed after 14 days. New replies are no longer allowed.