← Back to team overview

openerp-community team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-1092211-sejal into lp:openobject-addons

 

Sejal Bhut(OpenERP) has proposed merging lp:~openerp-dev/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-dev/openobject-addons/trunk-bug-1092211-sejal/+merge/151180

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-dev/openobject-addons/trunk-bug-1092211-sejal/+merge/151180
Your team OpenERP Community is subscribed to branch lp:~openerp-dev/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-03-01 10:22:26 +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',


Follow ups