Skip to content

Commit

Permalink
[FIX] inversed invoice_control value problem in stock_location addon …
Browse files Browse the repository at this point in the history
…(with

chained picking setup)

https://launchpad.net/bugs/1208456
  • Loading branch information
rha-odoo authored and Stefan Rijnhart committed Jul 2, 2014
1 parent 3cd5759 commit 037929e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions addons/sale_stock/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def _prepare_chained_picking(self, cr, uid, picking_name, picking, picking_type,
values = super(stock_move, self)._prepare_chained_picking(cr, uid, picking_name, picking, picking_type, moves_todo, context=context)
if picking.sale_id:
values['sale_id'] = picking.sale_id.id
if values.get('type') == 'out' and picking.sale_id.order_policy == 'picking':
values['invoice_state'] = '2binvoiced'
picking.write({'invoice_state': 'none'})
return values

class stock_picking(osv.osv):
Expand Down
6 changes: 5 additions & 1 deletion addons/stock_location/stock_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ def action_cancel(self, cr, uid, ids, context=None):

def _prepare_chained_picking(self, cr, uid, picking_name, picking, picking_type, moves_todo, context=None):
res = super(stock_move, self)._prepare_chained_picking(cr, uid, picking_name, picking, picking_type, moves_todo, context=context)
res.update({'invoice_state': moves_todo[0][1][6] or 'none'})
state = moves_todo[0][1][6] or 'none'
if picking.sale_id:
if res.get('type') == 'out' and picking.sale_id.order_policy == 'picking':
state = '2binvoiced'
res.update(invoice_state=state)
return res
stock_move()

Expand Down

0 comments on commit 037929e

Please sign in to comment.