Skip to content

[16.0][FIX] pms: save check-in contact data in the partner it creates or links - #462

Open
DarioLodeiros wants to merge 1 commit into
OCA:16.0from
commitsun:16.0-fix-pms-checkin-partner-contact-sync
Open

DarioLodeiros wants to merge 1 commit into
OCA:16.0from
commitsun:16.0-fix-pms-checkin-partner-contact-sync

Conversation

@DarioLodeiros

Copy link
Copy Markdown
Member

Problem

pms.checkin.partner propagates email, mobile and phone to its partner through field inverses, which only write to an already linked partner.

When those values arrive in the same create/write as the data that makes set_partner_id() create the partner (names, or the document data required by pms_partner_identification), or link an existing one by document, the inverse runs while partner_id is still empty. The partner is created/linked afterwards and never gets them: the guest's phone and email stay on that check-in only and are missing in the contact and in the guest's later stays.

This is the usual reception flow: scan the ID document, type the phone, press check-in.

Fix

After set_partner_id() in create and write, copy the check-in email/mobile/phone to the partner fields that are still empty. Existing partner data is never overwritten.

Tests

Two new tests in test_pms_checkin_partner.py (partner created on create and on write). Both fail without the fix and pass with it.

The email/mobile/phone inverses of pms.checkin.partner only write to an
already linked partner. When those values come in the same create/write as
the data that makes set_partner_id() create the partner (or link an
existing one by document), the inverse runs while partner_id is still
empty and the values never reach the partner: the guest's phone stays on
that check-in only and is missing in the contact and in later stays.

After set_partner_id(), copy the check-in email/mobile/phone to the
partner fields that are still empty. Existing partner data is never
overwritten.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants