https://bugs.launchpad.net/openobject-addons/+bug/1060259
<br />1 === modified file 'stock_invoice_directly/wizard/stock_invoice.py'<br />2 --- stock_invoice_directly/wizard/stock_invoice.py 2012-03-05 18:40:03 +0000<br />3 +++ stock_invoice_directly/wizard/stock_invoice.py 2012-11-09 09:44:58 +0000<br />4 @@ -31,8 +31,13 @@<br />5 if context is None: context = {}<br />6 result = super(invoice_directly, self).do_partial(cr, uid, ids, context)<br />7 partial = self.browse(cr, uid, ids[0], context)<br />8 - context.update(active_model='stock.picking',<br />9 - active_ids=[partial.picking_id.id])<br />10 + active_ids = partial.picking_id.backorder_id.id<br />11 + if active_ids:<br />12 + context.update(active_model='stock.picking',<br />13 + active_ids=[active_ids])<br />14 + else:<br />15 + context.update(active_model='stock.picking',<br />16 + active_ids=[partial.picking_id.id])<br />17 if partial.picking_id.invoice_state == '2binvoiced':<br />18 return {<br />19 'name': 'Create Invoice',<br />