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

Module: Base

Entity: res.partner.bank

Compute Method: _compute_clearing_label_id

Inputs Method Outputs
country_to_clearing_label = dict(self.env['clearing.label']._read_group(
            domain=[('country_id', 'in', self.mapped('country_id').ids + [False])],
            groupby=['country_id'],
            aggregates=['id:recordset'],
        ))
default_clearing_label = country_to_clearing_label.get(self.env['res.country'])
for account in self:
            account.clearing_label_id = country_to_clearing_label.get(account.country_id, default_clearing_label)

Back to entity