Rifakat (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-382014-rha into 
lp:openobject-addons/6.0.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-382014-rha/+merge/93356

Hello,

Sale order line 'sequence' information is not maintained while we create 
invoice from picking.

Please review this fix.

Regards,
Rifakat
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-382014-rha/+merge/93356
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-382014-rha.
=== modified file 'sale_layout/sale_layout.py'
--- sale_layout/sale_layout.py	2011-09-20 14:07:57 +0000
+++ sale_layout/sale_layout.py	2012-02-16 09:00:26 +0000
@@ -148,4 +148,21 @@
 
 sale_order()
 
+
+class stock_picking(osv.osv):
+    _inherit = "stock.picking"
+    
+    def action_invoice_create(self, cr, uid, ids, journal_id=False, group=False, type='out_invoice', context=None):
+        result = super(stock_picking, self).action_invoice_create(cr, uid, ids,
+                 journal_id=journal_id, group=group, type=type, context=context)
+        invoice_line_pool = self.pool.get('account.invoice.line')
+        for picking in self.browse(cr, uid, result.keys(), context=context):
+            if picking.sale_id:
+                for sale_line in picking.sale_id.order_line:
+                    invoice_lines = [line.id for line in sale_line.invoice_lines]
+                    invoice_line_pool.write(cr, uid, invoice_lines, {'sequence': sale_line.sequence}, context=context) 
+        return result
+    
+stock_picking()
+
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

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

Reply via email to