From f22f98cf9ece98cd88c6e7d01707754516119991 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 18 Sep 2014 11:57:36 +0200 Subject: [PATCH] [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 --- addons/stock_account/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_account/product.py b/addons/stock_account/product.py index ba4083a14e0..391a5e811b5 100644 --- a/addons/stock_account/product.py +++ b/addons/stock_account/product.py @@ -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']