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

Module: Expenses

Entity: hr.expense

Compute Method: _compute_selectable_payment_method_line_ids

Inputs Method Outputs
for expense in self:
            allowed_method_line_ids = expense.company_id.company_expense_allowed_payment_method_line_ids
            if allowed_method_line_ids:
                expense.selectable_payment_method_line_ids = allowed_method_line_ids
            else:
                expense.selectable_payment_method_line_ids = self.env['account.payment.method.line'].search([
                    # The journal is the source of the payment method line company
                    *self.env['account.journal']._check_company_domain(expense.company_id),
                    ('payment_type', '=', 'outbound'),
                    ('journal_id.active', '=', True),
                ])

Back to entity