diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index c9fd50986f7..23cc1563cff 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -160,13 +160,12 @@ class stock_move(osv.osv): _columns = { 'weight': fields.function(_cal_move_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', store={ - 'stock.move': (lambda self, cr, uid, ids, c={}: ids, ['product_id', 'product_qty', 'product_uom'], 20), + 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20), }), 'weight_net': fields.function(_cal_move_weight, method=True, type='float', string='Net weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', store={ - 'stock.move': (lambda self, cr, uid, ids, c={}: ids, ['product_id', 'product_qty', 'product_uom'], 20), + 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20), }), - } stock_move() diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py index 987c76e372d..93cd142ac01 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.py @@ -55,7 +55,7 @@ class stock_picking(osv.osv): ondelete='set null', select=True), } _defaults = { - 'purchase_id': lambda *a: False, + 'purchase_id': False, } def get_currency_id(self, cursor, user, picking): diff --git a/addons/sale/stock.py b/addons/sale/stock.py index 2855323c7a0..72e3f0a6c24 100644 --- a/addons/sale/stock.py +++ b/addons/sale/stock.py @@ -188,7 +188,7 @@ class stock_picking(osv.osv): }) return result - def action_cancel(self, cr, uid, ids, context={}): + def action_cancel(self, cr, uid, ids, context=None): res = super(stock_picking, self).action_cancel(cr, uid, ids, context=context) for pick in self.browse(cr, uid, ids, context): call_ship_end = True diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index 2f756d5ecda..3a0e09a0309 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -94,13 +94,13 @@ class account_invoice_line(osv.osv): _columns = { 'cost_price': fields.float('Cost Price', digits=(16, 2)), } - def write(self, cr, uid, ids, vals, context={}): + def write(self, cr, uid, ids, vals, context=None): if vals.get('product_id', False): res = self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price']) vals['cost_price'] = res[0]['standard_price'] return super(account_invoice_line, self).write(cr, uid, ids, vals, context) - def create(self, cr, uid, vals, context={}): + def create(self, cr, uid, vals, context=None): if vals.get('product_id',False): res = self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price']) vals['cost_price'] = res[0]['standard_price'] diff --git a/addons/stock_location/stock_location.py b/addons/stock_location/stock_location.py index 01d3b906d29..1f6d7b78e61 100644 --- a/addons/stock_location/stock_location.py +++ b/addons/stock_location/stock_location.py @@ -52,10 +52,10 @@ class stock_location_path(osv.osv): ), } _defaults = { - 'auto': lambda *arg: 'auto', - 'delay': lambda *arg: 1, - 'invoice_state': lambda *args: 'none', - 'picking_type':lambda *args:'internal', + 'auto': 'auto', + 'delay': 1, + 'invoice_state': 'none', + 'picking_type': 'internal', } stock_location_path()