delivery, purchase, sale, stock_location: minor fixes, mutable args
bzr revid: p_christ@hol.gr-20101127201616-fq46x1c2uo7s7b62
This commit is contained in:
parent
9e01e43db8
commit
7c5d0e6aba
|
@ -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()
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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']
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue