Merge lp:~sbi/ocb-addons/trunk-bug1101811 into lp:ocb-addons

Proposed by Stéphane Bidoul (Acsone)
Status: Merged
Merged at revision: 8752
Proposed branch: lp:~sbi/ocb-addons/trunk-bug1101811
Merge into: lp:ocb-addons
Diff against target: 21 lines (+2/-2)
1 file modified
account/report/account_financial_report.py (+2/-2)
To merge this branch: bzr merge lp:~sbi/ocb-addons/trunk-bug1101811
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Needs Information
Holger Brunn (Therp) Approve
Review via email: mp+150192@code.launchpad.net

Description of the change

Automatically derived from https://code.launchpad.net/~sbi/openobject-addons/trunk-bug1101811 for https://code.launchpad.net/~openerp/openobject-addons/trunk. Below is a copy of the original description.

[FIX] account_financial_report: use sign in comparison column

To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

looks good, thanks for your contribution!

review: Approve
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi Holger,

thank you for the review, but please do not merge immediately. Have a look at the comment here: https://lists.launchpad.net/openerp-community-reviewer/msg00028.html

Cheers,
Stefan.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

As for the change itself: when report.sign in the original code is used, I can see it is not applied when the account balance is 0.0. I think that is to prevent the entry showing up as '-0.0'. Have you seen this, and would it be something to take into account in your branches?

review: Needs Information
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Yes, it makes sense. Xavier Alt also commited somthing about this last week. Branch updated and merge proposal resubmitted.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/report/account_financial_report.py'
2--- account/report/account_financial_report.py 2013-01-07 10:28:57 +0000
3+++ account/report/account_financial_report.py 2013-02-23 15:16:24 +0000
4@@ -65,7 +65,7 @@
5 vals['debit'] = report.debit
6 vals['credit'] = report.credit
7 if data['form']['enable_filter']:
8- vals['balance_cmp'] = self.pool.get('account.financial.report').browse(self.cr, self.uid, report.id, context=data['form']['comparison_context']).balance
9+ vals['balance_cmp'] = self.pool.get('account.financial.report').browse(self.cr, self.uid, report.id, context=data['form']['comparison_context']).balance * report.sign
10 lines.append(vals)
11 account_ids = []
12 if report.display_detail == 'no_detail':
13@@ -97,7 +97,7 @@
14 if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance']):
15 flag = True
16 if data['form']['enable_filter']:
17- vals['balance_cmp'] = account_obj.browse(self.cr, self.uid, account.id, context=data['form']['comparison_context']).balance
18+ vals['balance_cmp'] = account_obj.browse(self.cr, self.uid, account.id, context=data['form']['comparison_context']).balance * report.sign
19 if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance_cmp']):
20 flag = True
21 if flag: