- modify name_get method on account_move_reconcile object
- account move line bug fix

bzr revid: mra@tinyerp.com-20080925053125-pdg0711nfnnhbf3f
This commit is contained in:
Mustufa Rangwala 2008-09-25 11:01:25 +05:30
parent 2ab70b66aa
commit b347a98ee0
2 changed files with 14 additions and 8 deletions

View File

@ -924,15 +924,21 @@ class account_move_reconcile(osv.osv):
{'reconcile_id': rec.id }
)
return True
def name_get(self, cr, uid, ids, context=None):
result = {}
if not len(ids):
return []
result = []
for r in self.browse(cr, uid, ids, context):
total = reduce(lambda y,t: (t.debit or 0.0) - (t.credit or 0.0) + y, r.line_partial_ids, 0.0)
if total:
result[r.id] = '%s (%.2f)' % (r.name, total)
name = '%s (%.2f)' % (r.name, total)
result.append((r.id,name))
else:
result[r.id] = r.name
result.append((r.id,r.name))
return result
account_move_reconcile()
#----------------------------------------------------------

View File

@ -629,7 +629,7 @@ class account_move_line(osv.osv):
if raise_ex:
raise osv.except_osv(_('Wrong Accounting Entry!'), _('Both Credit and Debit cannot be zero!'))
account_obj = self.pool.get('account.account')
if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
raise osv.except_osv(_('Bad account!'), _('You can not use an inactive account!'))
if update_check: