[MERGE] merge with trunk
[odoo/odoo.git] / addons / stock / stock.py
index 8873d3f..0e748ca 100644 (file)
@@ -911,7 +911,8 @@ class stock_picking(osv.osv):
                     'name': (invoice.name or '') + ', ' + (picking.name or ''),
                     'origin': (invoice.origin or '') + ', ' + (picking.name or '') + (picking.origin and (':' + picking.origin) or ''),
                     'comment': (comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''),
-                    'date_invoice':context.get('date_inv',False)
+                    'date_invoice':context.get('date_inv',False),
+                    'user_id':picking.sale_id.user_id and picking.sale_id.user_id.id or False
                 }
                 invoice_obj.write(cr, uid, [invoice_id], invoice_vals, context=context)
             else:
@@ -928,6 +929,7 @@ class stock_picking(osv.osv):
                     'fiscal_position': partner.property_account_position.id,
                     'date_invoice': context.get('date_inv',False),
                     'company_id': picking.company_id.id,
+                    'user_id':picking.sale_id.user_id and picking.sale_id.user_id.id or False
                     }
                 cur_id = self.get_currency_id(cr, uid, picking)
                 if cur_id: