From 20d37b1a566956965bb4431b62fa7362c6f25fc2 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Tue, 4 Jun 2013 23:19:18 +0200 Subject: [PATCH] [FIX] Attempt to add move line without invoice to payment order gives error on empty value for the payment line's 'state' field --- account_banking_payment/model/payment_order_create.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/account_banking_payment/model/payment_order_create.py b/account_banking_payment/model/payment_order_create.py index 8199fca25..36c0f3aeb 100644 --- a/account_banking_payment/model/payment_order_create.py +++ b/account_banking_payment/model/payment_order_create.py @@ -98,8 +98,12 @@ class payment_order_create(orm.TransientModel): # customer invoice number (in the case of debit order) communication = line.invoice.number.replace('/', '') state = 'structured' - if communication != line.ref: + if line.invoice.number != line.ref: communication2 = line.ref + else: + state = 'normal' + communication2 = line.ref + # support debit orders when enabled if (payment.payment_order_type == 'debit' and 'amount_to_receive' in line):