diff --git a/modules/purchase_trade/valuation.py b/modules/purchase_trade/valuation.py index 3ab5dda..cf18b52 100644 --- a/modules/purchase_trade/valuation.py +++ b/modules/purchase_trade/valuation.py @@ -284,9 +284,9 @@ class ValuationBase(ModelSQL): Currency = Pool().get('currency.currency') FeeLots = Pool().get('fee.lots') #if line is matched with sale_line we should add the open sale side - sale_lines = line.get_matched_lines() - sale_open_lots = [s.lot_s for s in sale_lines] - all_lots = (line.lots or []) + sale_open_lots + sale_lines = line.get_matched_lines() or [] + sale_open_lots = tuple(s.lot_s for s in sale_lines if s.lot_s) + all_lots = (line.lots or ()) + sale_open_lots for lot in all_lots: fl = FeeLots.search([('lot', '=', lot.id)]) if not fl: