Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
4e617069
Commit
4e617069
authored
10 years ago
by
Denis Ledoux
Browse files
Options
Downloads
Plain Diff
[MERGE] forward port of branch saas-3 up to
82109d9b
parents
b1adf3a9
82109d9b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addons/account/report/account_aged_partner_balance.py
+13
-8
13 additions, 8 deletions
addons/account/report/account_aged_partner_balance.py
with
13 additions
and
8 deletions
addons/account/report/account_aged_partner_balance.py
+
13
−
8
View file @
4e617069
...
@@ -155,10 +155,10 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
...
@@ -155,10 +155,10 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
dates_query
+=
'
BETWEEN %s AND %s)
'
dates_query
+=
'
BETWEEN %s AND %s)
'
args_list
+=
(
form
[
str
(
i
)][
'
start
'
],
form
[
str
(
i
)][
'
stop
'
])
args_list
+=
(
form
[
str
(
i
)][
'
start
'
],
form
[
str
(
i
)][
'
stop
'
])
elif
form
[
str
(
i
)][
'
start
'
]:
elif
form
[
str
(
i
)][
'
start
'
]:
dates_query
+=
'
> %s)
'
dates_query
+=
'
>
=
%s)
'
args_list
+=
(
form
[
str
(
i
)][
'
start
'
],)
args_list
+=
(
form
[
str
(
i
)][
'
start
'
],)
else
:
else
:
dates_query
+=
'
< %s)
'
dates_query
+=
'
<
=
%s)
'
args_list
+=
(
form
[
str
(
i
)][
'
stop
'
],)
args_list
+=
(
form
[
str
(
i
)][
'
stop
'
],)
args_list
+=
(
self
.
date_from
,)
args_list
+=
(
self
.
date_from
,)
self
.
cr
.
execute
(
'''
SELECT l.partner_id, SUM(l.debit-l.credit), l.reconcile_partial_id
self
.
cr
.
execute
(
'''
SELECT l.partner_id, SUM(l.debit-l.credit), l.reconcile_partial_id
...
@@ -177,20 +177,25 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
...
@@ -177,20 +177,25 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
partners_partial
=
self
.
cr
.
fetchall
()
partners_partial
=
self
.
cr
.
fetchall
()
partners_amount
=
dict
((
i
[
0
],
0
)
for
i
in
partners_partial
)
partners_amount
=
dict
((
i
[
0
],
0
)
for
i
in
partners_partial
)
for
partner_info
in
partners_partial
:
for
partner_info
in
partners_partial
:
partial
=
False
if
partner_info
[
2
]:
if
partner_info
[
2
]:
# in case of partial reconciliation, we want to keep the left amount in the oldest period
# in case of partial reconciliation, we want to keep the left amount in the oldest period
self
.
cr
.
execute
(
'''
SELECT MIN(COALESCE(date_maturity,date)) FROM account_move_line WHERE reconcile_partial_id = %s
'''
,
(
partner_info
[
2
],))
self
.
cr
.
execute
(
'''
SELECT MIN(COALESCE(date_maturity,date)) FROM account_move_line WHERE reconcile_partial_id = %s
'''
,
(
partner_info
[
2
],))
date
=
self
.
cr
.
fetchall
()
date
=
self
.
cr
.
fetchall
()
if
date
and
args_list
[
-
3
]
<=
date
[
0
][
0
]
<=
args_list
[
-
2
]:
partial
=
False
if
'
BETWEEN
'
in
dates_query
:
partial
=
date
and
args_list
[
-
3
]
<=
date
[
0
][
0
]
<=
args_list
[
-
2
]
elif
'
>=
'
in
dates_query
:
partial
=
date
and
date
[
0
][
0
]
>=
form
[
str
(
i
)][
'
start
'
]
else
:
partial
=
date
and
date
[
0
][
0
]
<=
form
[
str
(
i
)][
'
stop
'
]
if
partial
:
# partial reconcilation
# partial reconcilation
partial
=
True
self
.
cr
.
execute
(
'''
SELECT SUM(l.debit-l.credit)
self
.
cr
.
execute
(
'''
SELECT SUM(l.debit-l.credit)
FROM account_move_line AS l
FROM account_move_line AS l
, account_move AS am
WHERE l.reconcile_partial_id = %s
'''
,
(
partner_info
[
2
],))
WHERE
l.move_id = am.id AND am.state in %s AND
l.reconcile_partial_id = %s
'''
,
(
tuple
(
move_state
),
partner_info
[
2
],))
unreconciled_amount
=
self
.
cr
.
fetchall
()
unreconciled_amount
=
self
.
cr
.
fetchall
()
partners_amount
[
partner_info
[
0
]]
+=
unreconciled_amount
[
0
][
0
]
partners_amount
[
partner_info
[
0
]]
+=
unreconciled_amount
[
0
][
0
]
if
not
partial
:
else
:
partners_amount
[
partner_info
[
0
]]
+=
partner_info
[
1
]
partners_amount
[
partner_info
[
0
]]
+=
partner_info
[
1
]
history
.
append
(
partners_amount
)
history
.
append
(
partners_amount
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment