diff --git a/csv_export_payment/models/csv_export_payment.py b/csv_export_payment/models/csv_export_payment.py index 52fa356..7cd2aef 100644 --- a/csv_export_payment/models/csv_export_payment.py +++ b/csv_export_payment/models/csv_export_payment.py @@ -45,6 +45,17 @@ def get_row(self, record): ) invoice = payment.invoice_ids + if payment.partner_type == 'customer': + if payment.payment_type == 'inbound': + amount = payment.amount + if payment.payment_type == 'outbound': + amount = - payment.amount + if payment.partner_type == 'supplier': + if payment.payment_type == 'inbound': + amount = - payment.amount + if payment.payment_type == 'outbound': + amount = payment.amount + row = ( payment.name, payment.journal_id.code, @@ -53,7 +64,7 @@ def get_row(self, record): payment.partner_id.export_reference, invoice.number, invoice.journal_id.code, - str(payment.amount), + str(amount), ) row = tuple(self.replace_line_return(s) for s in row)