~initos.com/openerp-connector-magento/7.0-import_customer_lang

« back to all changes in this revision

Viewing changes to magentoerpconnect/sale.py

  • Committer: Katja Matthes
  • Date: 2014-06-23 09:47:03 UTC
  • Revision ID: katja.matthes@initos.com-20140623094703-pnw2mpbbcebp4dqe
map language of storeview to default language of backend, fix language for addresses from sale order import

Show diffs side-by-side

added added

removed removed

Lines of Context:
626
626
 
627
627
        partner_id = sess.read('magento.res.partner',
628
628
                               partner_bind_id, ['openerp_id'])['openerp_id'][0]
 
629
        # get parent's language
 
630
        lang = sess.read('res.partner', partner_id, ['lang'])['lang'] or 'en_US'
629
631
 
630
632
        # Import of addresses. We just can't rely on the
631
633
        # ``customer_address_id`` field given by Magento, because it is
644
646
 
645
647
        # For the orders which are from guests, we let the addresses
646
648
        # as active because they don't have an address book.
647
 
        addresses_defaults = {'parent_id': partner_id,
 
649
        addresses_defaults = {'lang': lang,
 
650
                              'parent_id': partner_id,
648
651
                              'magento_partner_id': partner_bind_id,
649
652
                              'email': record.get('customer_email', False),
650
653
                              'active': is_guest_order,