diff --git a/addons/account_payment/wizard/wizard_payment_order.py b/addons/account_payment/wizard/wizard_payment_order.py index ba39cd00260..a0ae8cb5bdb 100644 --- a/addons/account_payment/wizard/wizard_payment_order.py +++ b/addons/account_payment/wizard/wizard_payment_order.py @@ -63,8 +63,11 @@ def search_entries(self, cr, uid, data, context): # Search for move line to pay: line_ids = line_obj.search(cr, uid, [ - ('reconcile_id', '=', False), - ('amount_to_pay', '>', 0),('date_maturity','<=',search_due_date)], context=context) + ('reconcile_id', '=', False), + ('account_id.type', '=', 'payable'), + ('amount_to_pay', '>', 0), + ('date_maturity','<=',search_due_date) + ], context=context) FORM.string = ''' @@ -87,7 +90,6 @@ def create_payment(self, cr, uid, data, context): t = payment.mode and payment.mode.type.code or 'manual' line2bank= pool.get('account.move.line').line2bank(cr, uid, line_ids, t, context) - ## Finally populate the current payment with new lines: for line in line_obj.browse(cr, uid, line_ids, context=context): pool.get('payment.line').create(cr,uid,{ @@ -96,7 +98,7 @@ def create_payment(self, cr, uid, data, context): 'bank_id': line2bank.get(line.id), 'order_id': payment.id, 'partner_id': line.partner_id and line.partner_id.id or False, - 'communication': line.ref or '/' + 'communication': line.ref or '/', }, context=context) return {}