OdooWiki OCA HUB

Partner Country State Required

partner_country_state_required folder_open OCA/partner-contact open_in_new
Uncategorised License: AGPL-3

This module allows the country state to be required on the partners assigned to countries having fed. states by setting up the state_required field of the res.country model.

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

This module makes the state/province field mandatory on partner addresses when the selected country has states available. It also turns on the state-required flag for all countries during installation.

When you save a contact, company or any other partner record, Odoo now checks the address. If a country is selected, that country has the "state required" option enabled, and the country actually has states/provinces defined, then the state field must be filled in. If it is left empty, Odoo blocks the save and shows the message: "Please specify a state for the address when selecting a country with available states."

  • The rule is applied automatically every time the country or state on a partner is changed or saved.
  • It affects the standard partner model (res.partner), so it applies to customers, vendors, companies and contacts.
  • During installation, the module sets the state-required flag to true for every country already in the database, so the rule is active immediately for all countries that have states.
  • The check can be skipped by code that explicitly sets a context flag, but normal users cannot bypass it from the interface.

There are no new menus or screens; the change appears directly in the existing partner form as a validation error when the state is missing.

Depends on

base
Models and fields (1)
  • res.partner · extends an existing model

Text generated by AI (DeepSeek) from reading the Odoo 19.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 4 confirmed, 5 with no information of 9 versions.

Sources · Odoo 19.0

Confirmed on 2026-11-03 in branch 19.0 of OCA/partner-contact.

terminal Installation and usage

No verified information

Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.