[IMP] get company on common report class

bzr revid: mra@mra-laptop-20100719102104-iggepvbgg37u78mt
This commit is contained in:
Mustufa Rangwala 2010-07-19 15:51:04 +05:30
parent 402c96cfb2
commit bf465e7e07
1 changed files with 5 additions and 5 deletions

View File

@ -124,13 +124,13 @@ class common_report_header(object):
return ''
def _get_company(self, data):
if data.get('form', False) and data['form'].get('company_id', False):
comp_obj = pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, data['form']['company_id'])
return comp_obj.name
if data.get('form', False) and data['form'].get('chart_account_id', False):
return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr, self.uid, data['form']['chart_account_id']).company_id.name
return ''
def _get_journal(self, journal_ids):
self.cr.execute('select code from account_journal where id IN %s',(tuple(journal_ids),))
codes = [x for x, in self.cr.fetchall()]
return codes or ''
return codes or ''
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: