Repository navigation
[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
Open
DarioLodeiros wants to merge 1 commit into
DarioLodeiros wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pms.checkin.partnerpropagatesemail,mobileandphoneto its partner through field inverses, which only write to an already linked partner.When those values arrive in the same
create/writeas the data that makesset_partner_id()create the partner (names, or the document data required bypms_partner_identification), or link an existing one by document, the inverse runs whilepartner_idis 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()increateandwrite, copy the check-inemail/mobile/phoneto 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 oncreateand onwrite). Both fail without the fix and pass with it.