Unit price is not filled for some products when using sale and purchase forms

Hi everyone,

When I process Sale/Purchase with some products, the Unit Price is not automatically filled in the form, and Unit Price is reset if I change the amount.

For most products, the behaviour works as expected, but I can’t find any reason for this.
The rest of the Sale/Purchase process works as expected for all products.
There is no differences in the interface between these problematic products and the others.
I’ve tried navigating through DB in search for differences between these products but there is so many tables to manage this I’m a bit lost.

What could explain this behaviour?

The product unit price is used when changing the quantity or the product.
This is because the price list may depend on the quantity, so once the quantity is updated we recompute the unit price.

Yes, but here my problem is that for some products the unit price is set and reset to 0 in the sale/purchase forms (despite it is not 0 in the product form).

I guess you have several records for the multivalue model with different values and that causes the issue.

Sorry I don’t understand. You mean “variants”? Because I don’t have any.
On TABLE product_template I have only one list_price per product.

The list price is stored in a model product.list_price where there can be more than 1 price per product depending on the criteria.

Ok, my fault, I wrongly analyse the context of the issue.
Looking deeper, actually I have the same problem with all products but on the purchase form only.

But if I don’t use the listed price for purshasable products but a Supplier with a price/quantity, the price is filled as expected during the purshase process.

So reformulating: Default Listed price is not used by the purshase form without suppliers and price by quantity for purchasable products. Is this actually an expected behaviour?

Of course the list price, as the tooltip said, is

The standard price the product is sold at.

It may seems logical to you but actually even when you purchase it, the product is sold :slight_smile:
I would expect this field to be used in this case without having a supplier defined.

Naming and comment in Tryton are always written from the managed company point of view.

If the system has not explicit value define, it is better to not guess than guessing wrong (and here nobody is expected to purchase at the same price as the sale).

Make sense, thanks for explanation.