[IMP] account_voucher: defined name_get method in accountvoucher for taking amount field.

bzr revid: vra@tinyerp.com-20100923072657-zyr0c1cytuslj2hc
This commit is contained in:
vra
2010-09-23 12:56:57 +05:30
parent 1f36c4b2dd
commit 4f36684661
+6 -1
View File
@@ -104,6 +104,11 @@ class account_voucher(osv.osv):
def _get_narration(self, cr, uid, context={}):
return context.get('narration', False)
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
return [(r['id'], (str(r['amount']) or '')) for r in self.read(cr, uid, ids, ['amount'], context, load='_classic_write')]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
res = super(account_voucher,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
doc = etree.XML(res['arch'])
@@ -117,7 +122,7 @@ class account_voucher(osv.osv):
_name = 'account.voucher'
_description = 'Accounting Voucher'
_order = "date desc, id desc"
_rec_name = 'number'
# _rec_name = 'number'
_columns = {
'type':fields.selection([
('sale','Sale'),