Merge lp:~zeroincombenze/openobject-italia/7.0 into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0

Proposed by Antonio M. - Zeroincombenze
Status: Needs review
Proposed branch: lp:~zeroincombenze/openobject-italia/7.0
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
Diff against target: 51 lines (+12/-7)
3 files modified
l10n_it_partially_deductible_vat/AUTHORS.txt (+3/-2)
l10n_it_partially_deductible_vat/__openerp__.py (+1/-1)
l10n_it_partially_deductible_vat/account.py (+8/-4)
To merge this branch: bzr merge lp:~zeroincombenze/openobject-italia/7.0
Reviewer Review Type Date Requested Status
Davide Corio (community) code review, no test Approve
Lorenzo Battistini code review Approve
Review via email: mp+225138@code.launchpad.net

Commit message

[FIX] Bug #1335867 Randomly Tax has diff. rates

Description of the change

Added new check condition

To post a comment you must log in.
Revision history for this message
Antonio M. - Zeroincombenze (zeroincombenze) wrote :

Bug #1335867
Randomly, software report follow wrong error message:
"The taxes %s have different rates"
As in example file, undeductible tax has 2 sub codes, first with suffix a for undeductible rate and last with suffix b for deductible rate.
The last one has type = 'balance' in order to receive all residual amount.

The wrong code at line 35, property '_have_same_rate' does not check for this condition and returns a unpredictable value, as is randomly recorded.

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

LGTM

Thanks!

review: Approve (code review)
Revision history for this message
Davide Corio (enlightx-deactivatedaccount) :
review: Approve (code review, no test)
Revision history for this message
Lorenzo Battistini (elbati) wrote :

This project is now hosted on https://github.com/OCA/l10n-italy. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

Unmerged revisions

241. By openerp <openerp@shs-av-dev>

[FIX] Bug #1335867 Randomly Tax has diff. rates

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_it_partially_deductible_vat/AUTHORS.txt'
2--- l10n_it_partially_deductible_vat/AUTHORS.txt 2013-01-08 22:58:30 +0000
3+++ l10n_it_partially_deductible_vat/AUTHORS.txt 2014-07-01 11:44:22 +0000
4@@ -1,2 +1,3 @@
5-Lorenzo Battistini <lorenzo.battistini@agilebg.com>
6-Franco Tampieri <franco.tampieri@agilebg.com>
7+Lorenzo Battistini <lorenzo.battistini@agilebg.com>
8+Franco Tampieri <franco.tampieri@agilebg.com>
9+Antonio M. Vigliotti <info@shs-av.com>
10\ No newline at end of file
11
12=== modified file 'l10n_it_partially_deductible_vat/__openerp__.py'
13--- l10n_it_partially_deductible_vat/__openerp__.py 2014-06-23 09:55:36 +0000
14+++ l10n_it_partially_deductible_vat/__openerp__.py 2014-07-01 11:44:22 +0000
15@@ -25,7 +25,7 @@
16
17 {
18 "name" : "Italy - Partially Deductible VAT",
19- "version" : "0.1",
20+ "version" : "0.2",
21 "depends" : ['account'],
22 "author" : "OpenERP Italian Community",
23 "description": """
24
25=== modified file 'l10n_it_partially_deductible_vat/account.py'
26--- l10n_it_partially_deductible_vat/account.py 2013-05-23 16:55:09 +0000
27+++ l10n_it_partially_deductible_vat/account.py 2014-07-01 11:44:22 +0000
28@@ -32,15 +32,19 @@
29
30 _inherit = 'account.tax'
31
32+# See Bug #1335867
33+# [antoniov: 2014-06-30] if account_tax.type is 'balance', 'amount' value is unpredictable. Random bug!
34 def _have_same_rate(self, account_taxes):
35 rate = None
36 for account_tax in account_taxes:
37- if rate is None:
38- rate = account_tax.amount
39- elif rate != account_tax.amount:
40- return False
41+ if account_tax.type != 'balance':
42+ if rate is None:
43+ rate = account_tax.amount
44+ elif rate != account_tax.amount:
45+ return False
46 return True
47
48+
49 def get_main_tax(self, tax):
50 if not tax.parent_id:
51 return tax

Subscribers

People subscribed via source and target branches