[MERGE] merged the al branch with sequence field copied from SO line to invoice line...
authorQuentin (OpenERP) <qdp-launchpad@openerp.com>
Thu, 16 Feb 2012 13:09:57 +0000 (14:09 +0100)
committerQuentin (OpenERP) <qdp-launchpad@openerp.com>
Thu, 16 Feb 2012 13:09:57 +0000 (14:09 +0100)
bzr revid: qdp-launchpad@openerp.com-20120216130957-o7zwad5m4zcvotmi

addons/sale_layout/sale_layout.py

index ef63ad5..15531e7 100644 (file)
@@ -161,4 +161,15 @@ class sale_order(osv.osv):
 
 sale_order()
 
+class stock_picking(osv.osv):
+    _inherit = "stock.picking"
+
+    def _prepare_invoice_line(self, cr, uid, group, picking, move_line, invoice_id, invoice_vals, context=None):
+        vals = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id, invoice_vals, context=context)
+
+        if move_line.sale_line_id:
+            vals['sequence'] = move_line.sale_line_id.sequence
+
+        return vals
+
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: