diff --git a/addons/account/report/common_report_header.py b/addons/account/report/common_report_header.py index b8f3fb1c760..0b45a0580b9 100644 --- a/addons/account/report/common_report_header.py +++ b/addons/account/report/common_report_header.py @@ -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: \ No newline at end of file