Reviewers: ,
Please review this at http://codereview.tryton.org/813002/
Affected files:
M move.py
Index: move.py
===================================================================
--- a/move.py
+++ b/move.py
@@ -808,7 +808,9 @@
line.debit or line.credit, 1):
if ((tax_line['tax'][key + '_account'].id
or line.account.id) == account_id
- and (tax_line['tax'][key + '_tax_code'].id
+ and ((tax_line['tax'][key + '_tax_code'].id
+ if tax_line['tax'][key
+ '_tax_code']
+ else None)
== code_id)
and tax_line['tax'].id == tax_id):
if line.debit:
@@ -937,7 +939,8 @@
base_amounts = {}
for tax_line in Tax.compute(self.account.taxes,
debit or credit, 1):
- code_id = tax_line['tax'][key + '_base_code'].id
+ code_id = (tax_line['tax'][key + '_base_code'].id
+ if tax_line['tax'][key + '_base_code'] else None)
if not code_id:
continue
tax_id = tax_line['tax'].id