Removed value_total field and _amount_value function
bzr revid: bde@tiny2-desktop-20110524101339-bremxmlamrunfyia
This commit is contained in:
@@ -127,15 +127,7 @@ class account_asset_asset(osv.osv):
|
||||
'state':'normal'
|
||||
}, context)
|
||||
|
||||
def _amount_total(self, cr, uid, ids, name, args, context={}):
|
||||
id_set=",".join(map(str,ids))
|
||||
cr.execute("""SELECT l.asset_id,abs(SUM(l.debit-l.credit)) AS amount FROM
|
||||
account_move_line l
|
||||
WHERE l.asset_id IN ("""+id_set+") GROUP BY l.asset_id ")
|
||||
res=dict(cr.fetchall())
|
||||
for id in ids:
|
||||
res.setdefault(id, 0.0)
|
||||
return res
|
||||
|
||||
|
||||
def _amount_residual(self, cr, uid, ids, name, args, context={}):
|
||||
cr.execute("""SELECT
|
||||
@@ -174,7 +166,6 @@ class account_asset_asset(osv.osv):
|
||||
'method_delay': fields.integer('During (interval)', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'method_period': fields.integer('Depre. all (period)', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'method_end': fields.date('Ending date'),
|
||||
'value_total': fields.function(_amount_total, method=True, digits=(16,2),string='Total'),
|
||||
'method_progress_factor': fields.float('Progressif Factor', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'value_residual': fields.function(_amount_residual, method=True, digits=(16,2), string='Residual Value'),
|
||||
'method_time': fields.selection([('delay','Delay'),('end','Ending Period')], 'Time Method', required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
<separator string="Other Information" colspan="4"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="purchase_date"/>
|
||||
<field name="value_total"/>
|
||||
<separator string="Depreciation duration" colspan="4"/>
|
||||
<button
|
||||
name="%(wizard_asset_modify)d"
|
||||
@@ -192,7 +191,6 @@
|
||||
<tree string="Assets">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="value_total"/>
|
||||
<field name="purchase_date"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="state"/>
|
||||
|
||||
Reference in New Issue
Block a user