In the price_list, you’ve to define a formula for the quantity using those variables: unit_price, cost_price or list_price.
Example: Formula: unit_price * 0.9

If I remember correctly the logic, first condition is evaluated, if true, calculate price and exit, if fault, go to next line
so the behavior you describe seems correct.

Thank you, I understand the result now, and I see the benefit with formula based price lists for groups (few price list lines for a lot of products).

For my use case (individual volume prices for one single product) it would be great if the line with the highest quantity would be picked, if the sequence is null or equal.

In PostgreSQL,

[...] ORDER BY sequence ASC, quantity DESC

would give the correct result as the first matching line.

I tried to extend the class PriceListLine, adding

_order = [('quantity', 'DESC')]

but this has no effect.

Is there a possibility to have a second order criteria (Quantity, descending) for the sequence ordered price list lines?

There are many criteria so the order can not be computed from only a single criteria. This is why we use a sequence.

But now as it seems you want to define a set of prices per individual product, it may be better to just store on each product a list of quantity/price and return the right price in Product._get_sale_unit_price. So your price list will be simpler and only contain general/global formula using unit_price.

Yes, I think that is the way to go for this special use case; thank you for the hint to _get_sale_unit_price.
For now, I wrote a simple Proteus script which resets the sequence for all price list lines to the desired order (descending by quantity per product). I let the script run nightly, which is okay for now.

Next I will try to write a module as suggested by you.