[FIX] stock: do not set user_id on prepare_invoice_group
authorDenis Ledoux <dle@odoo.com>
Thu, 24 Jul 2014 18:42:21 +0000 (20:42 +0200)
committerDenis Ledoux <dle@odoo.com>
Thu, 24 Jul 2014 18:42:21 +0000 (20:42 +0200)
The user_id is already set by the prepare_invoice method, which is called before the prepare_invoice_group (the user_id is already set, thus)
Besides, _prepare_invoice is overriden in sale_stock, to set the picking sale order salesman as user_id, and, without this correct, grouping invoicse by partner re-set the user_id to uid, which is wrong.

addons/stock/stock.py

index c14819f..d363275 100644 (file)
@@ -1011,7 +1011,6 @@ class stock_picking(osv.osv):
             '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),
-            'user_id': uid,
         }
 
     def _prepare_invoice(self, cr, uid, picking, partner, inv_type, journal_id, context=None):