When a company has chosen to invoice on delivery it could happen that the quantity of delivered products is higher than ordered. Tryton correclty invoice the delivered quantity.
An issue might arise when the customer finally receive a quantity that could have triggered a promotional price (through the use of the
sale_pricelist or the
sale_promotion module or maybe even both).
In that case companies usually wants to offer their customer the rebate they are entitled to receive.
After discussion it has been decided to add a field in
sale.configuration to specify what should be the behaviour of tryton when such a situation occurs. It’s a boolean field defining what is the quantity that should be invoiced.
It is not complicated to overload the
get_invoice_line method of
sale.line to use the price from the pricelist according to the quantity shipped.
Recomputing the promotion is more tricky, breaks the modularity and should only be considered for specific modules.