product_price_list: compute returns None instead of unit_price if no line matches
Scenario:
- create a price_list with
- price: list_price
- one line:
- product: product.id
- quantity: 2
- formula: 'unit_price - 1'
- use that price list in a sale and add a sale line for the product with quantity 1. -> None is returned as price
What happens:
- with the price_list set in the context sale_price_list/_get_sale_unit_price calls compute from that specific Pricelist
- compute tries pattern matching, and when no line matches simply returns None.
I think in case a price list doesn't apply it should return the unit_price like
if line.match(pattern):
unit_price = line.get_unit_price(**context)
if isinstance(unit_price, Null):
unit_price = None
return unit_price
else:
return context['names']['unit_price']