[IMP]pms_api_rest: filter journals for property in GET transactions services

This commit is contained in:
braisab
2022-11-09 14:29:11 +01:00
committed by Darío Lodeiros
parent 98752b3f52
commit 5fc0eadbfe
2 changed files with 13 additions and 19 deletions

View File

@@ -31,10 +31,10 @@ class PmsAccountJournalService(Component):
if not pms_property:
pass
else:
for method in pms_property._get_payment_methods(automatic_included=True):
payment_method = self.env["account.journal"].search(
[("id", "=", method.id)]
)
for payment_method in pms_property._get_payment_methods(automatic_included=True):
# REVIEW: avoid send to app generic company journals
if not payment_method.pms_property_ids:
continue
result_account_journals.append(
PmsAccountJournalInfo(
id=payment_method.id,