Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Third Party and Deferred/Electronic Checks Management

Entity: l10n_latam.check

Compute Method: _compute_current_journal

Inputs Method Outputs
for rec in self:
            last_operation = rec._get_last_operation()
            incoming_operations = (rec.payment_id + rec.operation_ids).filtered(lambda x: x.state not in ['draft', 'canceled'] and x.payment_type == 'inbound')
            outgoing_operations = (rec.payment_id + rec.operation_ids).filtered(lambda x: x.state not in ['draft', 'canceled'] and x.payment_type == 'outbound')
            if not last_operation or len(incoming_operations) - len(outgoing_operations) < 1:
                rec.current_journal_id = False
                continue
            if last_operation.payment_type == 'inbound':
                rec.current_journal_id = last_operation.journal_id
            else:
                rec.current_journal_id = False

Back to entity