Skip to content

[16.0][FIX] pms_partner_identification: look up partner document by its unique key - #437

Draft
DarioLodeiros wants to merge 1 commit into
OCA:16.0from
DarioLodeiros:16.0-fix-partner-document-lookup-unique-key
Draft

[16.0][FIX] pms_partner_identification: look up partner document by its unique key#437
DarioLodeiros wants to merge 1 commit into
OCA:16.0from
DarioLodeiros:16.0-fix-partner-document-lookup-unique-key

Conversation

@DarioLodeiros

@DarioLodeiros DarioLodeiros commented Aug 17, 2026

Copy link
Copy Markdown
Member

The unique index on res.partner.id_number is (partner_id, category_id).

_create_or_update_partner_document searches the existing document also by country_id, so any legacy row whose country is not set (or differs from the one captured at check-in) is not found. The method then falls into create() and crashes against the unique constraint when the check-in is saved.

This searches by the uniqueness key only: the subsequent write() updates the existing document and backfills its country from the check-in data, so legacy documents self-correct on the guest's next check-in without any data migration.

…que key

The unique index on res.partner.id_number is (partner_id, category_id).
Searching also by country_id misses existing rows whose country is not
set (or differs), so the method falls into create() and crashes against
the unique constraint when saving a check-in.

Search by the uniqueness key only: the subsequent write() updates the
existing document and backfills its country from the check-in data.
@OCA-git-bot OCA-git-bot added series:16.0 mod:pms_partner_identification Module pms_partner_identification labels Aug 17, 2026
@DarioLodeiros
DarioLodeiros marked this pull request as draft August 20, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:pms_partner_identification Module pms_partner_identification series:16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants