Merge lp:~julie-w/unifield-server/US-1817 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 3991
Proposed branch: lp:~julie-w/unifield-server/US-1817
Merge into: lp:unifield-server
Diff against target: 73 lines (+14/-9)
3 files modified
bin/addons/account_reconciliation/account.py (+1/-0)
bin/addons/account_reconciliation/account_move_line.py (+10/-6)
bin/addons/account_reconciliation/wizard/account_reconcile.py (+3/-3)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-1817
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+308639@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/account_reconciliation/account.py'
2--- bin/addons/account_reconciliation/account.py 2016-06-16 09:03:45 +0000
3+++ bin/addons/account_reconciliation/account.py 2016-10-17 15:19:38 +0000
4@@ -22,6 +22,7 @@
5 ##############################################################################
6
7 from osv import osv
8+import time
9
10 class account_move_reconcile(osv.osv):
11 _name = "account.move.reconcile"
12
13=== modified file 'bin/addons/account_reconciliation/account_move_line.py'
14--- bin/addons/account_reconciliation/account_move_line.py 2016-10-04 10:33:24 +0000
15+++ bin/addons/account_reconciliation/account_move_line.py 2016-10-17 15:19:38 +0000
16@@ -125,6 +125,7 @@
17 total = 0.0
18 merges_rec = []
19 company_list = []
20+ reconcile_partial_browsed = False
21 if context is None:
22 context = {}
23 if isinstance(ids, (int, long)):
24@@ -148,12 +149,15 @@
25 if line.reconcile_id:
26 raise osv.except_osv(_('Warning'), _('Already Reconciled!'))
27 if line.reconcile_partial_id:
28- for line2 in line.reconcile_partial_id.line_partial_ids:
29- if not line2.reconcile_id:
30- if line2.id not in merges:
31- merges.append(line2.id)
32- # Next line have been modified from debit/credit to debit_currency/credit_currency
33- total += (line2.debit_currency or 0.0) - (line2.credit_currency or 0.0)
34+ if not reconcile_partial_browsed:
35+ # (US-1757) We browse the list of the already partially reconciled lines only once to get their total amount
36+ reconcile_partial_browsed = True
37+ for line2 in line.reconcile_partial_id.line_partial_ids:
38+ if not line2.reconcile_id:
39+ if line2.id not in merges:
40+ merges.append(line2.id)
41+ # Next line have been modified from debit/credit to debit_currency/credit_currency
42+ total += (line2.debit_currency or 0.0) - (line2.credit_currency or 0.0)
43 merges_rec.append(line.reconcile_partial_id.id)
44 else:
45 unmerge.append(line.id)
46
47=== modified file 'bin/addons/account_reconciliation/wizard/account_reconcile.py'
48--- bin/addons/account_reconciliation/wizard/account_reconcile.py 2014-08-26 15:41:14 +0000
49+++ bin/addons/account_reconciliation/wizard/account_reconcile.py 2016-10-17 15:19:38 +0000
50@@ -187,12 +187,12 @@
51 fcredit += line.credit
52 fdebit += line.debit
53 # Adapt state value
54- if (debit - credit) == 0.0:
55+ if abs(debit - credit) <= 10**-3:
56 state = 'total'
57 if transfer_with_change:
58 debit = fdebit
59 credit = fcredit
60- if (fdebit - fcredit) == 0.0:
61+ if abs(fdebit - fcredit) <= 10**-3:
62 state = 'total_change'
63 # Currencies state
64 different_currencies = False
65@@ -202,7 +202,7 @@
66 credit = fcredit
67 # For salaries, behaviour is the same as total_change: we use functional debit/credit
68 if account_id == salary_account_id or (currency_id and currency2_id and not transfer_with_change):
69- if (fdebit - fcredit) == 0.0:
70+ if abs(fdebit - fcredit) <= 10**-3:
71 state = 'total'
72 else:
73 state = 'partial'

Subscribers

People subscribed via source and target branches