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 GitHub
parent c3ceb140c6
commit 5c18382533

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