[FIX] account_asset: Do not copy depreciation lines while copying asset.

bzr revid: uco@tinyerp.com-20110526110702-2i112dmip928vz0e
This commit is contained in:
Ujjvala Collins (OpenERP) 2011-05-26 16:37:02 +05:30
parent 2bc8a08ed5
commit 6256ac7958
1 changed files with 7 additions and 0 deletions

View File

@ -188,6 +188,13 @@ class account_asset_asset(osv.osv):
'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'account.asset.asset',context=context),
}
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
if context is None:
context = {}
default['depreciation_line_ids'] = []
return super(account_asset_asset, self).copy(cr, uid, id, default, context=context)
def _compute_period(self, cr, uid, property, context={}):
if (len(property.entry_asset_ids or [])/2)>=property.method_delay: