Sejal Bhut(OpenERP) has proposed merging 
lp:~openerp-community/openobject-addons/trunk-bug-1092211-sejal into 
lp:openobject-addons.

Requested reviews:
  Atul Patel(OpenERP) (atp-openerp)
Related bugs:
  Bug #1092211 in OpenERP Addons: "Problem with created invoice when doing 
partial shipment"
  https://bugs.launchpad.net/openobject-addons/+bug/1092211

For more details, see:
https://code.launchpad.net/~openerp-community/openobject-addons/trunk-bug-1092211-sejal/+merge/149808

Hello,

create correct invoice when doing partial shipment.

if do partial shipment , pass backorder id in context as active ids for 
creating invoice.
if no partial picking, then pass picking id in context.


Thanks



-- 
https://code.launchpad.net/~openerp-community/openobject-addons/trunk-bug-1092211-sejal/+merge/149808
Your team OpenERP Community is subscribed to branch 
lp:~openerp-community/openobject-addons/trunk-bug-1092211-sejal.
=== modified file 'stock_invoice_directly/wizard/stock_invoice.py'
--- stock_invoice_directly/wizard/stock_invoice.py	2012-12-06 14:56:32 +0000
+++ stock_invoice_directly/wizard/stock_invoice.py	2013-02-21 12:14:31 +0000
@@ -31,8 +31,12 @@
         if context is None: context = {}
         result = super(invoice_directly, self).do_partial(cr, uid, ids, context)
         partial = self.browse(cr, uid, ids[0], context)
-        context.update(active_model='stock.picking',
-                       active_ids=[partial.picking_id.id])
+        partial_picking_id = False
+        if partial.picking_id.backorder_id.id:
+            partial_picking_id=partial.picking_id.backorder_id.id
+        else:
+          partial_picking_id=partial.picking_id.id
+        context.update(active_model='stock.picking', active_ids=[partial_picking_id])
         if partial.picking_id.invoice_state == '2binvoiced':
             return {
                 'name': 'Create Invoice',

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp

Reply via email to