Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0][IMP] column payment should show the amount paid by printed payment only #2

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion account_check_report/report/account_check_report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@
name="account_check_report.check_report"
file="account_check_report.check_report"/>

</odoo>
</odoo>
36 changes: 16 additions & 20 deletions account_check_report/report/report_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ def _get_paid_amount(self, payment, invoice):
for pay in invoice.payment_move_line_ids:
payment_currency_id = False
if invoice.type in ('out_invoice', 'in_refund'):
amount = sum(
[p.amount for p in pay.matched_debit_ids if
p.debit_move_id in invoice.move_id.line_ids
and p.credit_move_id.payment_id == payment])
amount_currency = sum([p.amount_currency for p in
pay.matched_debit_ids if
p.debit_move_id in
invoice.move_id.line_ids
and p.credit_move_id.payment_id
== payment])
amount = 0
amount_currency = 0
for p in pay.matched_debit_ids:
if p in invoice.move_id.line_ids.mapped(
'matched_credit_ids'):
if p.credit_move_id.payment_id.id == payment.id:
amount += p.amount
amount_currency += amount_currency
if pay.matched_debit_ids:
payment_currency_id = \
all(
Expand All @@ -45,16 +43,14 @@ def _get_paid_amount(self, payment, invoice):
and pay.matched_debit_ids[0].currency_id \
or False
elif invoice.type in ('in_invoice', 'out_refund'):
amount = sum(
[p.amount for p in pay.matched_credit_ids if
p.credit_move_id in invoice.move_id.line_ids
and p.debit_move_id.payment_id == payment])
amount_currency = sum([p.amount_currency for p in
pay.matched_credit_ids if
p.credit_move_id in
invoice.move_id.line_ids
and p.debit_move_id.payment_id
== payment])
amount = 0
amount_currency = 0
for p in pay.matched_credit_ids:
if p in invoice.move_id.line_ids.mapped(
'matched_debit_ids'):
if p.debit_move_id.payment_id.id == payment.id:
amount += p.amount
amount_currency += amount_currency
if pay.matched_credit_ids:
payment_currency_id = \
all(
Expand Down