From c3de121988987575d55490afe50ded38c1d18a4e Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 11 Dec 2014 16:57:25 +0100 Subject: [PATCH] [FIX] stock_account: avoid getting 'stock.picking()' as reference In the new api an empty recordset converted to string is the name its class while previously it was converted to an empty string. The valid v7 condition sould have probably been move.picking_id and move.picking_id.name or False but in v8, simply move.picking_id.name is enough and avoids getting these accounting entries strangly named when there is no picking. --- addons/stock_account/stock_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py index 243d982f8f6..2fcc661c079 100644 --- a/addons/stock_account/stock_account.py +++ b/addons/stock_account/stock_account.py @@ -241,7 +241,7 @@ class stock_quant(osv.osv): 'line_id': move_lines, 'period_id': period_id, 'date': move.date, - 'ref': move.picking_id and move.picking_id.name}, context=context) + 'ref': move.picking_id.name}, context=context) #def _reconcile_single_negative_quant(self, cr, uid, to_solve_quant, quant, quant_neg, qty, context=None): # move = self._get_latest_move(cr, uid, to_solve_quant, context=context)