diff --git a/addons/account/report/account_tax_code.py b/addons/account/report/account_tax_code.py index f3c3fb75e47..8c1c94552d0 100644 --- a/addons/account/report/account_tax_code.py +++ b/addons/account/report/account_tax_code.py @@ -43,20 +43,20 @@ class account_tax_code_report(rml_parse.rml_parse): if line_ids: move_line_objs = self.pool.get('account.move.line').browse(self.cr,self.uid,line_ids) for line in move_line_objs: - res['date'] = line.date - res['ref'] = line.ref - res['acode'] = line.account_id.code - res['pname'] = '' - res['country'] = '' - - if line.partner_id: - res['pname'] = line.partner_id.name - if line.partner_id.address and line.partner_id.address[0].country_id: - res['country'] = line.partner_id.address[0].country_id.code - res['name'] = line.name - res['debit'] = line.debit - res['credit'] = line.credit - result.append(res) + res['date'] = line.date + res['ref'] = line.ref + res['acode'] = line.account_id.code + res['pname'] = '' + res['country'] = '' + + if line.partner_id: + res['pname'] = line.partner_id.name + if line.partner_id.address and line.partner_id.address[0].country_id: + res['country'] = line.partner_id.address[0].country_id.code + res['name'] = line.name + res['debit'] = line.debit + res['credit'] = line.credit + result.append(res) return result