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
1=== modified file 'l10n_it_vat_registries/invoice.py'
2--- l10n_it_vat_registries/invoice.py 2013-08-21 16:15:06 +0000
3+++ l10n_it_vat_registries/invoice.py 2013-11-06 15:08:31 +0000
4@@ -68,12 +68,18 @@
5
6 def _get_invoice_total(self, move):
7 total = 0.0
8+ receivable_payable_found = False
9 for move_line in move.line_id:
10 if move_line.account_id.type == 'receivable':
11 total += move_line.debit or ( - move_line.credit)
12+ receivable_payable_found = True
13 elif move_line.account_id.type == 'payable':
14 total += ( - move_line.debit) or move_line.credit
15- return abs(total)
16+ receivable_payable_found = True
17+ if receivable_payable_found:
18+ return abs(total)
19+ else:
20+ return abs(move.amount)
21
22 def build_parent_tax_codes(self, tax_code):
23 res={}

Subscribers

People subscribed via source and target branches