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.country

Compute Method: _compute_country_group_codes

Inputs Method Outputs
'''If a country has no associated country groups, assign [''] to country_group_codes.
        This prevents storing [] as False, which helps avoid iteration over a False value and
        maintains a valid structure.
        '''
for country in self:
            country.country_group_codes = [g.code for g in country.country_group_ids if g.code] or ['']

Back to entity