Merge lp:~agilebg/openobject-italia/7.0-bug-1221567-elbati into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0

Proposed by Lorenzo Battistini
Status: Merged
Merged at revision: 226
Proposed branch: lp:~agilebg/openobject-italia/7.0-bug-1221567-elbati
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
Diff against target: 23 lines (+7/-1)
1 file modified
l10n_it_vat_registries/invoice.py (+7/-1)
To merge this branch: bzr merge lp:~agilebg/openobject-italia/7.0-bug-1221567-elbati
Reviewer Review Type Date Requested Status
Leonardo Pistone (community) code review, no test Approve
Lorenzo Battistini Pending
Review via email: mp+184509@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Leonardo Pistone (lepistone) wrote :

Thanks Lorenzo.

Would that be a tad more readable if you switched the if / else block removing "not"?

review: Needs Fixing
225. By Lorenzo Battistini

[IMP] switched the if / else block removing "not"

Revision history for this message
Lorenzo Battistini (elbati) wrote :

On 10/28/2013 12:05 PM, Leonardo Pistone - Agile BG wrote:
> Review: Needs Fixing
>
> Thanks Lorenzo.
>
> Would that be a tad more readable if you switched the if / else block removing "not"?

Done!

Revision history for this message
Leonardo Pistone (lepistone) wrote :

Thanks Lorenzo, LGTM

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'l10n_it_vat_registries/invoice.py'
--- l10n_it_vat_registries/invoice.py 2013-08-21 16:15:06 +0000
+++ l10n_it_vat_registries/invoice.py 2013-11-06 15:08:31 +0000
@@ -68,12 +68,18 @@
6868
69 def _get_invoice_total(self, move):69 def _get_invoice_total(self, move):
70 total = 0.070 total = 0.0
71 receivable_payable_found = False
71 for move_line in move.line_id:72 for move_line in move.line_id:
72 if move_line.account_id.type == 'receivable':73 if move_line.account_id.type == 'receivable':
73 total += move_line.debit or ( - move_line.credit)74 total += move_line.debit or ( - move_line.credit)
75 receivable_payable_found = True
74 elif move_line.account_id.type == 'payable':76 elif move_line.account_id.type == 'payable':
75 total += ( - move_line.debit) or move_line.credit77 total += ( - move_line.debit) or move_line.credit
76 return abs(total)78 receivable_payable_found = True
79 if receivable_payable_found:
80 return abs(total)
81 else:
82 return abs(move.amount)
77 83
78 def build_parent_tax_codes(self, tax_code):84 def build_parent_tax_codes(self, tax_code):
79 res={}85 res={}

Subscribers

People subscribed via source and target branches