_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']