[FIX]mrp: raises exception error when mrp module produce product with mark Track...
authorron@tinyerp.com <>
Thu, 4 Nov 2010 05:00:13 +0000 (10:30 +0530)
committerron@tinyerp.com <>
Thu, 4 Nov 2010 05:00:13 +0000 (10:30 +0530)
lp bug: https://launchpad.net/bugs/669210 fixed

bzr revid: ron@tinyerp.com-20101104050013-pk01lxfs91163uih

addons/stock/stock.py
addons/stock/wizard/stock_invoice_onshipping.py

index 735fb47..1c3b31a 100644 (file)
@@ -2231,7 +2231,7 @@ class stock_move(osv.osv):
                 quantity_rest = quantity
                 uos_qty_rest =  uos_qty
                 if move.product_id.track_production and location_id:
-                    res += self.split_lines(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context)
+                    res += self.action_split(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context)
                 else:
                     res += [move.id]
                     update_val = {
index 3d46812..38b384c 100644 (file)
@@ -28,18 +28,17 @@ class stock_invoice_onshipping(osv.osv_memory):
     def _get_journal_id(self, cr,uid,ids, context=None):
         if context is None:
             context = {}
-
         if ids['active_model'] == "stock.picking":
             pick_obj = self.pool.get('stock.picking').browse(cr,uid,ids['active_id'])
             acct_obj = self.pool.get('account.journal')
             vals=[]
-            if pick_obj.type == 'in':
+            if pick_obj.type == 'out':
                value = acct_obj.search(cr, uid, [('type', 'in',('sale','sale_refund') )])
                for jr_type in acct_obj.browse(cr, uid, value, context=context):
                    t1 = jr_type.id,jr_type.name
                    vals.append(t1)
 
-            elif pick_obj.type == 'out':
+            elif pick_obj.type == 'in':
                value = acct_obj.search(cr, uid, [('type', 'in',('purchase','purchase_refund') )])
                for jr_type in acct_obj.browse(cr, uid, value, context=context):
                    t1 = jr_type.id,jr_type.name