diff --git a/pms_civitfun/services/pms_payment_service.py b/pms_civitfun/services/pms_payment_service.py index 3df6f914c9..8749b5d15a 100644 --- a/pms_civitfun/services/pms_payment_service.py +++ b/pms_civitfun/services/pms_payment_service.py @@ -55,9 +55,13 @@ def payment_register(self, pms_input_param): .sudo() .search( [ - ("name", "=", booking_identifier), + "&", ("pms_property_id", "=", pms_property.id), - ] + "|", + ("name", "=", booking_identifier), + ("folio_id.name", "=", booking_identifier), + ], + limit=1, ) ) if not reservation: @@ -131,12 +135,13 @@ def payment_search(self, pms_input_param): .sudo() .search( [ - "|", "&", - ("name", "=", booking_identifier), - ("folio.name", "=", booking_identifier), ("pms_property_id", "=", pms_property.id), - ] + "|", + ("name", "=", booking_identifier), + ("folio_id.name", "=", booking_identifier), + ], + limit=1, ) ) if not reservation: