From 3b9367cbbec4727977240a36aefece4faffb590d Mon Sep 17 00:00:00 2001 From: Arthur Maniet Date: Mon, 1 Jun 2015 14:57:41 +0200 Subject: [PATCH] [FIX] account payment: when registering a payment from an invoice, set default values from the invoice --- addons/account/account_payment.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account/account_payment.py b/addons/account/account_payment.py index 99a201fb8f3..2245847e7cf 100644 --- a/addons/account/account_payment.py +++ b/addons/account/account_payment.py @@ -261,12 +261,12 @@ class account_payment(models.Model): invoice_ids = rec.get('invoice_ids') and rec['invoice_ids'][0][2] or None if invoice_ids and len(invoice_ids) == 1: invoice = self.env['account.invoice'].browse(invoice_ids) - rec['communication'] = rec.get('communication', invoice.reference) - rec['currency_id'] = rec.get('currency_id', invoice.currency_id.id) - rec['payment_type'] = rec.get('payment_type', invoice.type in ('out_invoice', 'in_refund') and 'inbound' or 'outbound') - rec['partner_type'] = rec.get('partner_type', MAP_INVOICE_TYPE_PARTNER_TYPE[invoice.type]) - rec['partner_id'] = rec.get('partner_id', invoice.partner_id.id) - rec['amount'] = rec.get('amount', invoice.residual_signed) + rec['communication'] = invoice.reference + rec['currency_id'] = invoice.currency_id.id + rec['payment_type'] = invoice.type in ('out_invoice', 'in_refund') and 'inbound' or 'outbound' + rec['partner_type'] = MAP_INVOICE_TYPE_PARTNER_TYPE[invoice.type] + rec['partner_id'] = invoice.partner_id.id + rec['amount'] = invoice.residual_signed return rec def _get_invoices(self):