~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to sale_override/sale.py

UF-370 [IMP] Add context on create method

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
        return procurement_data
267
267
 
268
268
    # @@@override@sale.sale.order.action_ship_create
269
 
    def action_ship_create(self, cr, uid, ids, *args, **kwargs):
 
269
    def action_ship_create(self, cr, uid, ids, context={}, *args, **kwargs):
270
270
        """
271
271
        Adds hooks
272
272
        """
317
317
                        if reason_type_id:
318
318
                            picking_values.update({'reason_type_id': reason_type_id})
319
319
                            
320
 
                        picking_id = self.pool.get('stock.picking').create(cr, uid, picking_values)
 
320
                        picking_id = self.pool.get('stock.picking').create(cr, uid, picking_values, context=context)
321
321
                    move_data =  {
322
322
                        'name': line.name[:64],
323
323
                        'picking_id': picking_id,
345
345
                        move_data.update({'reason_type_id': reason_type_id})
346
346
                        
347
347
                    move_data = self._hook_ship_create_stock_move(cr, uid, ids, move_data, line, *args, **kwargs)
348
 
                    move_id = self.pool.get('stock.move').create(cr, uid, move_data)
 
348
                    move_id = self.pool.get('stock.move').create(cr, uid, move_data, context=context)
349
349
 
350
350
                if line.product_id:
351
351
                    proc_data = {