Add phone/email support in CORE -> Rattail importer for CustomerShopper
This commit is contained in:
parent
76b0791831
commit
7489d4a4a9
|
@ -198,16 +198,16 @@ class CustomerShopperImporter(FromCOREPOSAPI, corepos_importing.model.CustomerSh
|
||||||
'last_name',
|
'last_name',
|
||||||
'display_name',
|
'display_name',
|
||||||
'active',
|
'active',
|
||||||
# 'phone_number',
|
'phone_number',
|
||||||
# 'phone_number_2',
|
'phone_number_2',
|
||||||
# 'email_address',
|
'email_address',
|
||||||
]
|
]
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
super().setup()
|
super().setup()
|
||||||
model = self.model
|
model = self.model
|
||||||
|
|
||||||
# self.maxlen_phone_number = self.app.maxlen(model.PhoneNumber.number)
|
self.maxlen_phone_number = self.app.maxlen(model.PhoneNumber.number)
|
||||||
|
|
||||||
self.customers_by_card_number = self.app.cache_model(
|
self.customers_by_card_number = self.app.cache_model(
|
||||||
self.session,
|
self.session,
|
||||||
|
@ -294,30 +294,30 @@ class CustomerShopperImporter(FromCOREPOSAPI, corepos_importing.model.CustomerSh
|
||||||
# TODO: can a CORE shopper be *not* active?
|
# TODO: can a CORE shopper be *not* active?
|
||||||
'active': True,
|
'active': True,
|
||||||
|
|
||||||
# 'phone_number': shopper['phone'] or None,
|
'phone_number': shopper['phone'] or None,
|
||||||
# 'phone_number_2': shopper['altPhone'] or None,
|
'phone_number_2': shopper['altPhone'] or None,
|
||||||
|
|
||||||
# 'email_address': shopper['email'] or None,
|
'email_address': shopper['email'] or None,
|
||||||
}
|
}
|
||||||
|
|
||||||
# # truncate phone number data if needed
|
# truncate phone number data if needed
|
||||||
# if data['phone_number'] and len(data['phone_number']) > self.maxlen_phone_number:
|
if data['phone_number'] and len(data['phone_number']) > self.maxlen_phone_number:
|
||||||
# log.warning("phone_number is too long (%s chars), "
|
log.warning("phone_number is too long (%s chars), "
|
||||||
# "will truncate to %s chars: %s",
|
"will truncate to %s chars: %s",
|
||||||
# len(data['phone_number']),
|
len(data['phone_number']),
|
||||||
# self.maxlen_phone_number,
|
self.maxlen_phone_number,
|
||||||
# data['phone_number'])
|
data['phone_number'])
|
||||||
# data['phone_number'] = data['phone_number'][:self.maxlen_phone_number]
|
data['phone_number'] = data['phone_number'][:self.maxlen_phone_number]
|
||||||
# if data['phone_number_2'] and len(data['phone_number_2']) > self.maxlen_phone_number:
|
if data['phone_number_2'] and len(data['phone_number_2']) > self.maxlen_phone_number:
|
||||||
# log.warning("phone_number_2 is too long (%s chars), "
|
log.warning("phone_number_2 is too long (%s chars), "
|
||||||
# "will truncate to %s chars: %s",
|
"will truncate to %s chars: %s",
|
||||||
# len(data['phone_number_2']),
|
len(data['phone_number_2']),
|
||||||
# self.maxlen_phone_number,
|
self.maxlen_phone_number,
|
||||||
# data['phone_number_2'])
|
data['phone_number_2'])
|
||||||
# data['phone_number_2'] = data['phone_number_2'][:self.maxlen_phone_number]
|
data['phone_number_2'] = data['phone_number_2'][:self.maxlen_phone_number]
|
||||||
|
|
||||||
# # swap 1st and 2nd phone numbers if only latter has value
|
# swap 1st and 2nd phone numbers if only latter has value
|
||||||
# self.prioritize_2(data, 'phone_number')
|
self.prioritize_2(data, 'phone_number')
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue