Skip to content

Commit f24a96b

Browse files
committed
[FIX] account_cashbox_l10n_latam_check:fix filtering of cashbox sessions
Filtering of cashbox sessions is now correctly based on the destination journal. This ensures that only cashbox sessions associated with the selected destination journal are considered. closes #1003 X-original-commit: 386049e Signed-off-by: Filoquin adhoc <maq@adhoc.com.ar> Signed-off-by: Camila Vives <cav@adhoc.inc>
1 parent a365328 commit f24a96b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

account_cashbox_l10n_latam_check/wizards/l10n_latam_payment_mass_transfer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ def _compute_requiere_account_cashbox_session(self):
2626
@api.depends("destination_journal_id")
2727
def _compute_cashbox_session_id(self):
2828
for rec in self:
29-
session_ids = self.env["account.cashbox.session"].search(
30-
[("state", "=", "opened"), "|", ("user_ids", "=", self.env.uid), ("user_ids", "=", False)]
29+
session_ids = (
30+
self.env["account.cashbox.session"]
31+
.search([("state", "=", "opened"), "|", ("user_ids", "=", self.env.uid), ("user_ids", "=", False)])
32+
.filtered(lambda x: rec.destination_journal_id in x.cashbox_id.journal_ids)
3133
)
3234
if len(session_ids) == 1:
3335
rec.cashbox_session_id = session_ids.id

0 commit comments

Comments
 (0)