← Back to team overview

savoirfairelinux-openerp team mailing list archive

[Merge] lp:~openerp-chinese-team/e-commerce-addons/guest-order-bug-fix into lp:e-commerce-addons/oerp6.1-stable

 

Joshua Jan(SHINEIT) has proposed merging lp:~openerp-chinese-team/e-commerce-addons/guest-order-bug-fix into lp:e-commerce-addons/oerp6.1-stable.

Requested reviews:
  extra-addons-commiter (extra-addons-commiter)
Related bugs:
  Bug #1054059 in Magento OpenERP Connector: "Importing Guest-Orders is not possible (KeyError: 'shop_id' in create_onfly_partner on line 387)"
  https://bugs.launchpad.net/magentoerpconnect/+bug/1054059

For more details, see:
https://code.launchpad.net/~openerp-chinese-team/e-commerce-addons/guest-order-bug-fix/+merge/131812

Hello all,
    There are two change to fix the https://bugs.launchpad.net/magentoerpconnect/+bug/1054059
    Another one:
    https://code.launchpad.net/~openerp-chinese-team/magentoerpconnect/guest-order-bug-fix 
Best Regards
Joshua
 
-- 
https://code.launchpad.net/~openerp-chinese-team/e-commerce-addons/guest-order-bug-fix/+merge/131812
Your team extra-addons-commiter is requested to review the proposed merge of lp:~openerp-chinese-team/e-commerce-addons/guest-order-bug-fix into lp:e-commerce-addons/oerp6.1-stable.
=== modified file 'base_sale_multichannels/sale.py'
--- base_sale_multichannels/sale.py	2012-08-21 07:38:58 +0000
+++ base_sale_multichannels/sale.py	2012-10-29 03:11:21 +0000
@@ -535,7 +535,7 @@
         return super(sale_order, self)._import_resources(cr, uid, external_session, defaults=defaults, method=method, context=context)
 
 
-    def check_if_order_exist(self, cr, uid, external_session, resource, order_mapping=None, context=None):
+    def check_if_order_exist(self, cr, uid, external_session, resource, order_mapping=None, defaults=None, context=None):
         mapping_name = False
         for line in order_mapping['mapping_lines']:
             if line['internal_field'] == 'name':
@@ -546,6 +546,7 @@
                                         'from_external_to_openerp', resource,
                                         mapping=local_mapping,
                                         mapping_id=1,
+                                        defaults=defaults,
                                         context=context)
             if vals.get('name'):
                 exist_id = self.search(cr, uid, [['name', '=', vals['name']]], context=context)
@@ -562,7 +563,7 @@
         mapping, mapping_id = self._init_mapping(cr, uid, external_session.referential_id.id,
                                             mapping=mapping, mapping_id=mapping_id, context=context)
         exist_id = self.check_if_order_exist(cr, uid, external_session, resource,
-                                            order_mapping=mapping[mapping_id], context=context)
+                                            order_mapping=mapping[mapping_id], defaults=defaults, context=context)
         if exist_id:
             return {}
         else:


Follow ups