Skip to content
Snippets Groups Projects
Commit 86a28196 authored by Andrea Grazioso (agr-odoo)'s avatar Andrea Grazioso (agr-odoo)
Browse files

[FIX] account: avoid change of payment type on 0 amount


Create a draft payment with payment type and 0 amount.
Save.

The payment type will be overwritten

opw-2495461

closes odoo/odoo#70603

Signed-off-by: default avatarQuentin De Paoli (qdp) <qdp@openerp.com>
parent fa2fb9f7
No related branches found
No related tags found
No related merge requests found
......@@ -680,12 +680,15 @@ class AccountPayment(models.Model):
})
payment_vals_to_write.update({
'amount': abs(liquidity_amount),
'payment_type': 'inbound' if liquidity_amount > 0.0 else 'outbound',
'partner_type': partner_type,
'currency_id': liquidity_lines.currency_id.id,
'destination_account_id': counterpart_lines.account_id.id,
'partner_id': liquidity_lines.partner_id.id,
})
if liquidity_amount > 0.0:
payment_vals_to_write.update({'payment_type': 'inbound'})
elif liquidity_amount < 0.0:
payment_vals_to_write.update({'payment_type': 'outbound'})
move.write(move._cleanup_write_orm_values(move, move_vals_to_write))
pay.write(move._cleanup_write_orm_values(pay, payment_vals_to_write))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment