The qty_available available of a product can be negative (e.g. using the force availibility button on delivery order) and the generated account.move.line should be adapted (otherwise getting negative values in debit/credit entries).
Fixes #2475
}
move_id = move_obj.create(cr, uid, move_vals, context=context)
- if diff > 0:
+ if diff*qty > 0:
amount_diff = qty * diff
debit_account_id = datas['stock_account_input']
credit_account_id = datas['property_stock_valuation_account_id']