[IMP] account_asset: Improved move line check method

bzr revid: pso@tinyerp.com-20110512113746-ttmm4uby9wvsjuxr
This commit is contained in:
pso (OpenERP) 2011-05-12 17:07:46 +05:30
parent ba7b9326d7
commit 873a2a4d5f
2 changed files with 3 additions and 3 deletions

View File

@ -279,7 +279,7 @@ class account_asset_depreciation_line(osv.osv):
_name = 'account.asset.depreciation.line'
_description = 'Asset depreciation line'
def get_move_line(self, cr, uid, ids, name, args, context={}):
def _get_move_check(self, cr, uid, ids, name, args, context=None):
res = {}
for line in self.browse(cr, uid, ids, context=context):
res[line.id] = line.move_id and True or False
@ -294,7 +294,7 @@ class account_asset_depreciation_line(osv.osv):
'depreciated_value': fields.float('Amount Already Depreciated', required=True),
'depreciation_date': fields.char('Depreciation Date', size=64, select=1),
'move_line_id': fields.many2one('account.move.line', 'Depreciation Entry'),
'move_line_present': fields.function(get_move_line, method=True, type='boolean', string='Move Line Present', store=True)
'move_check': fields.function(_get_move_check, method=True, type='boolean', string='Move Included', store=True)
}
account_asset_depreciation_line()

View File

@ -88,7 +88,7 @@
<field name="amount"/>
<field name="depreciated_value"/>
<field name="remaining_value"/>
<field name="move_line_present"/>
<field name="move_check"/>
</tree>
<graph type="bar">
<field name="name"/>