connector picking up addresses based on 'customer_address_id' is wrong

Bug #881123 reported by Kyle Waid
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magento OpenERP Connector
Fix Released
Undecided
Sébastien BEAU - http://www.akretion.com

Bug Description

When importing sales orders it collects the customers shipping/billing address based on 'customer_address_id'. If the ID or referential is stored in ir_model_data it will retrieve this or update it as the shipping/billing info.

This is bad practice. Magento most of the time returns correct datas in field customer_address_id, but it can and does return id = 0 or even wrong customer addresses! In any production environment, customers are impacted. API sends wrong data.

You have it mapped to take shipping _address or billing_address, but these are not fields passed in the api. They are passed

billing_address_id, and shipping_address_id NOT billing_address, shipping_address. This causes matching to always fail and default back to customer_address_id which is wrong.

Revision history for this message
Kyle Waid (midwest) wrote :
Download full text (4.4 KiB)

shipping_address_id': '3583702', 'customer_balance_refunded': None, 'shipping_address': {'address_id': '3583702', 'region_id': '34', 'telephone': '952-925-9854', 'prefix': '', 'street': '5825 Excelsior Blvd.', 'postcode': '55416', 'suffix': 'TJ', 'city': 'St. Louis Park', 'parent_id': '230909', 'country_id': 'US', 'gift_message_id': None, 'address_type': 'shipping', 'email': '<email address hidden>', 'quote_address_id': None, 'customer_address_id': '62517', 'fax': '', 'firstname': 'Events ', 'middlename': 'and', 'lastname': 'Sponsorship', 'company': 'Midwest Supplies', 'giftregistry_item_id': None, 'tax_id': None, 'customer_id': '40965', 'region': 'Minnesota'}, 'ext_order_id': None, 'shipping_canceled': None, 'payment_authorization_expiration': None, 'total_offline_refunded': None, 'gw_printed_card_tax_amount': '0.0000', 'store_id': '1', 'base_gift_cards_invoiced': None, 'updated_at': '2011-10-24 20:20:04', 'gw_items_tax_amount': '0.0000', 'base_discount_invoiced': '0.0000', 'real_order_id': None, 'gw_items_price': '0.0000', 'global_currency_code': 'USD', 'x_forwarded_for': None, 'base_total_qty_ordered': None, 'base_shipping_tax_refunded': None, 'base_shipping_discount_amount': '0.0000', 'increment_id': '1235816', 'store_currency_code': 'USD', 'gw_price_invoiced': None, 'shipping_incl_tax': '0.0000', 'gw_price_refunded': None, 'base_grand_total': '0.0000', 'giftcert_amount_invoiced': None, 'customer_balance_amount': '0.0000', 'gw_items_price_invoiced': None, 'customer_dob': None, 'billing_address_id': '3583701', 'remote_ip': None, 'status': 'processing', 'is_multi_payment': None, 'customer_note': 'Test order ', 'reward_currency_amount_refunded': None, 'discount_description': '', 'gift_cards_refunded': None, 'base_reward_currency_amount_invoiced': None, 'gw_items_base_price': '0.0000', 'discount_refunded': None, 'is_hold': None, 'tracking_numbers': None, 'currency_rate': None, 'base_to_order_rate': '1.0000', 'subtotal': '0.0000', 'payment': {'cc_ss_issue': None, 'protection_eligibility': None, 'cc_raw_response': None, 'flo2cash_account_id': None, 'base_amount_paid_online': '0.0000', 'cc_cid_status': None, 'cc_exp_year': '0', 'echeck_account_type': None, 'additional_information': [], 'cc_debug_response_serialized': None, 'base_amount_authorized': '0.0000', 'base_amount_ordered': '0.0000', 'ideal_issuer_id': None, 'base_shipping_refunded': None, 'ideal_transaction_checked': None, 'shipping_captured': '0.0000', 'shipping_refunded': None, 'cc_ss_start_year': '0', 'cc_ss_start_month': '0', 'customer_payment_id': None, 'base_shipping_captured': '0.0000', 'echeck_account_name': None, 'cc_debug_request_body': None, 'amount': None, 'shipping_amount': '0.0000', 'amount_ordered': '0.0000', 'quote_payment_id': None, 'cc_approval': None, 'parent_id': '230909', 'echeck_routing_number': None, 'base_amount_paid': '0.0000', 'method': 'free', 'echeck_type': None, 'amount_refunded': None, 'base_shipping_amount': '0.0000', 'amount_paid': '0.0000', 'cc_type': '', 'cc_last4': '', 'last_trans_id': None, 'cc_trans_id': None, 'amount_authorized': '0.0000', 'base_amount_canceled': None, 'cc_status': None, 'payment_id': '3548056', 'cc_raw_request': None, 'anet_trans...

Read more...

Changed in magentoerpconnect:
assignee: nobody → Sébastien BEAU - http://www.akretion.com (sebastien.beau)
Kyle Waid (midwest)
Changed in magentoerpconnect:
status: New → Confirmed
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Here is how I think to fix that :

Each time an order is imported :
 - we synchronize the customer and its address book (not the addresses given by the sale order) -> the addresses stored in the address book of the customer will be available on the partner and linked with the correct id in the address book of magento
 - We import also the addresses of the sale order, but we do not link them with magento. Theses addresses are created with "active = False" so they won't appear in the searches and the partner form. The history of the sale orders address will also be kept if an address of the "address book" is modified meanwhile.

Kyle Waid (midwest)
Changed in magentoerpconnect:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.