[FIX] account_asset: Do not copy depreciation lines while copying asset.
authorUjjvala Collins (OpenERP) <uco@tinyerp.com>
Thu, 26 May 2011 11:07:02 +0000 (16:37 +0530)
committerUjjvala Collins (OpenERP) <uco@tinyerp.com>
Thu, 26 May 2011 11:07:02 +0000 (16:37 +0530)
bzr revid: uco@tinyerp.com-20110526110702-2i112dmip928vz0e

addons/account_asset/account_asset.py

index 35fa5ac..762f27f 100644 (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: