Compare compact format of contact mechanism when updating Shopify customer
Closes #14211 (grafted from ec97714ff8ca390738a1aad5c588b5e2e0bc39e4) --HG-- branch : 7.0
This commit is contained in:
1 parent
0b267dbfe3
commit
1fcf4797dc
3 files changed
+19
-2
No files matched your search
@@ -29,7 +29,9 @@ class Party(IdentifiersMixin, metaclass=PoolMeta):
|
||||
continue
|
||||
for contact_mechanism in contact_mechanisms:
|
||||
if (contact_mechanism.type in types
|
||||
and contact_mechanism.value == value):
|
||||
and (contact_mechanism.value_compact
|
||||
== contact_mechanism.format_value_compact(
|
||||
value, contact_mechanism.type))):
|
||||
break
|
||||
else:
|
||||
contact_mechanisms.append(ContactMechanism(
|
||||
|
||||
@@ -110,7 +110,9 @@ class Sale(IdentifierMixin, metaclass=PoolMeta):
|
||||
if order.phone:
|
||||
for contact_mechanism in party.contact_mechanisms:
|
||||
if (contact_mechanism.type in {'phone', 'mobile'}
|
||||
and contact_mechanism.value == order.phone):
|
||||
and (contact_mechanism.value_compact
|
||||
== contact_mechanism.format_value_compact(
|
||||
order.phone, contact_mechanism.type))):
|
||||
break
|
||||
else:
|
||||
contact_mechanism = ContactMechanism(
|
||||
|
||||
@@ -441,6 +441,9 @@ Create an order on Shopify::
|
||||
>>> customer.email = (
|
||||
... ''.join(random.choice(string.ascii_letters) for _ in range(10))
|
||||
... + '@example.com')
|
||||
>>> customer_phone = '+32-495-555-' + (
|
||||
... ''.join(random.choice(string.digits) for _ in range(3)))
|
||||
>>> customer.phone = customer_phone
|
||||
>>> customer.addresses = [{
|
||||
... 'address1': "Street",
|
||||
... 'city': "City",
|
||||
@@ -515,6 +518,14 @@ Run fetch order::
|
||||
True
|
||||
>>> sale.state
|
||||
'quotation'
|
||||
>>> sale.party.name
|
||||
'Customer'
|
||||
>>> bool(sale.party.email)
|
||||
True
|
||||
>>> sale.party.phone.replace(' ', '') == customer_phone.replace('-', '')
|
||||
True
|
||||
>>> len(sale.party.contact_mechanisms)
|
||||
2
|
||||
|
||||
Capture full amount::
|
||||
|
||||
@@ -537,6 +548,8 @@ Capture full amount::
|
||||
'processing'
|
||||
>>> len(sale.invoices)
|
||||
0
|
||||
>>> len(sale.party.contact_mechanisms)
|
||||
2
|
||||
|
||||
Make a partial shipment::
|
||||
|
||||
|
||||
Reference in new issue
Block a user