From 54eac9c8511500810e52059a499a55e595259445 Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Tue, 11 Sep 2012 19:00:15 +0530 Subject: [PATCH] [IMP]on create of sale receipt add first sale account and display lable of bank name and number in customer accounting tab bzr revid: sgo@tinyerp.com-20120911133015-24z0gr1mnwzk6fwh --- addons/account/partner_view.xml | 6 ++++-- addons/account_voucher/account_voucher.py | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index d83571b314e..90ae9ea989c 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -93,8 +93,10 @@
- - + + + + diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index f75cda8cdde..86be18b6e77 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1373,8 +1373,14 @@ class account_voucher_line(osv.osv): 'company_id': fields.related('voucher_id','company_id', relation='res.company', type='many2one', string='Company', store=True, readonly=True), 'currency_id': fields.function(_currency_id, string='Currency', type='many2one', relation='res.currency', readonly=True), } + + def _default_account_id(self, cr, uid, ids, context=None): + prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context) + return prop and prop.id or False + _defaults = { 'name': '', + 'account_id':_default_account_id } def onchange_reconcile(self, cr, uid, ids, reconcile, amount, amount_unreconciled, context=None):