Countries, Federal States, and Country Groups
The base addon supplies res.country, res.country.state, and res.country.group.
Country records (res.country)
Section titled “Country records (res.country)”Country records represent sovereign nations or autonomous territories.
name: Required country name (e.g. “Indonesia”, “United States”).code: Required, unique 2-letter uppercase ISO 3166-1 alpha-2 code (e.g. “ID”, “US”). Lowercase inputs are sanitized to uppercase on create and write.address_format: Report address presentation template string, defaulting to:'%(street)s\n%(street2)s\n%(city)s %(state_code)s %(zip)s\n%(country_name)s'.currency_id: Foreign key tores.currency.phone_code: International telephone dialing prefix integer.country_group_ids: Many-to-many relationship linking memberres.country.grouprecords.state_ids: One-to-many relationship linking subdivisionres.country.staterecords.
The helper method get_address_fields extracts all interpolation field placeholders from address_format.
State records (res.country.state)
Section titled “State records (res.country.state)”Federal states represent first-level administrative subdivisions of countries (states, provinces, cantons).
country_id: Required many-to-one link tores.country(indexed, ondelete restrict).name: Required state name (e.g. “California”, “West Java”).code: State code, unique per country (unique (country_id, code)).
Country Groups (res.country.group)
Section titled “Country Groups (res.country.group)”Country groups represent trade, tax, or regional country clusters (such as “EU”, “SEPA”, “GCC”).
name: Group name.code: Optional unique uppercase code.country_ids: Many-to-many link to constituent countries.
Partner Address Integration
Section titled “Partner Address Integration”res.partner integrates geographic addressing via:
country_id: Many-to-one tores.country.state_id: Many-to-one tores.country.state, dynamically filtered by the partner’scountry_id.country_code: Related read-only ISO code fromcountry_id.code._address_fields: Address propagation includesstate_idandcountry_id. Contact children automatically synchronize their country and state with their parent company address.