From c5a8943ebbf535792f505040d7d0c3a1d8fbb343 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 12 Mar 2014 12:29:25 +0100 Subject: [PATCH] [IMP] At quants creation it should do accounting entries also bzr revid: jco@openerp.com-20140312112925-o2dvsqg2urfnu2sr --- addons/stock_account/stock_account.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py index 0459756ba36..977ff2e448e 100644 --- a/addons/stock_account/stock_account.py +++ b/addons/stock_account/stock_account.py @@ -127,6 +127,12 @@ class stock_quant(osv.osv): self._create_account_move_line(cr, uid, quants, move, acc_valuation, acc_dest, journal_id, context=ctx) + def _quant_create(self, cr, uid, qty, move, lot_id=False, owner_id=False, src_package_id=False, dest_package_id=False, force_location=False, context=None): + quant = super(stock_quant, self)._quant_create(cr, uid, qty, move, lot_id, owner_id, src_package_id, dest_package_id, force_location, context=context) + if move.product_id.valuation == 'real_time': + self._account_entry_move(cr, uid, [quant], move, context) + return quant + def move_single_quant_tuples(self, cr, uid, quants, move, location_dest_id, dest_package_id, context=None): quant_record = super(stock_quant, self).move_single_quant_tuples(cr, uid, quants, move, location_dest_id, dest_package_id, context=context) if move.product_id.valuation == 'real_time':