[FIX] stock_account: accept negative quantities on standard price

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
This commit is contained in:
Martin Trigaux 2014-09-18 11:57:36 +02:00
parent 93845d683c
commit f22f98cf9e
1 changed files with 1 additions and 1 deletions

View File

@ -124,7 +124,7 @@ class product_template(osv.osv):
}
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']