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
This commit is contained in:
Javier Colmeiro
2020-08-19 12:40:00 +02:00
committed by João Marques
parent 8f64046232
commit 76b65420f6
2 changed files with 6 additions and 2 deletions

View File

@@ -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)',

View File

@@ -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