From 76b65420f6cfec651780450ae3c47b318cdb96f0 Mon Sep 17 00:00:00 2001 From: Javier Colmeiro Date: Wed, 19 Aug 2020 12:40:00 +0200 Subject: [PATCH] fix domain in payment_order_return fix domain in payment_order_return in order to avoid problems with moves without associated invoice as discused at #718 --- account_payment_order_return/__manifest__.py | 2 +- .../wizards/account_payment_line_create.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/account_payment_order_return/__manifest__.py b/account_payment_order_return/__manifest__.py index 1235bcb13..adcdf6f20 100644 --- a/account_payment_order_return/__manifest__.py +++ b/account_payment_order_return/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Account Payment Order Return', - 'version': '12.0.1.0.0', + 'version': '12.0.1.1.0', 'category': 'Banking addons', 'author': 'Tecnativa, ' 'Odoo Community Association (OCA)', diff --git a/account_payment_order_return/wizards/account_payment_line_create.py b/account_payment_order_return/wizards/account_payment_line_create.py index d443af40d..af489e1c8 100644 --- a/account_payment_order_return/wizards/account_payment_line_create.py +++ b/account_payment_order_return/wizards/account_payment_line_create.py @@ -15,5 +15,9 @@ class AccountPaymentLineCreate(models.TransientModel): domain = super(AccountPaymentLineCreate, self)._prepare_move_line_domain() if not self.include_returned: - domain.append(('invoice_id.returned_payment', '=', False)) + domain += [ + '|', + ('invoice_id', '=', False), + ('invoice_id.returned_payment', '=', False) + ] return domain