Changeset - ba8b366ba652
[Not reviewed]
0 1 0
Lance Edgar (lance) - 3 years ago 2021-10-17 16:24:40
lance@edbob.org
Restore "pending" customer when unassigning batch contact

unassign means "unset contact uuid" essentially, i.e. unassign the
"proper" contact. but if "pending" contact info is there, restore it
1 file changed with 12 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rattail/batch/custorder.py
Show inline comments
 
@@ -253,9 +253,18 @@ class CustomerOrderBatchHandler(BatchHandler):
 
        """
 
        batch.customer = None
 
        batch.person = None
 
        batch.contact_name = None
 
        batch.phone_number = None
 
        batch.email_address = None
 

	
 
        # note that if batch already has a "pending" customer on file,
 
        # we will "restore" it as the contact info for the batch
 
        pending = batch.pending_customer
 
        if pending:
 
            batch.contact_name = pending.display_name
 
            batch.phone_number = pending.phone_number
 
            batch.email_address = pending.email_address
 
        else:
 
            batch.contact_name = None
 
            batch.phone_number = None
 
            batch.email_address = None
 

	
 
        # always reset "add to customer" flags
 
        batch.clear_param('add_phone_number')
0 comments (0 inline, 0 general)