Customer accounts created in admin, website = Admin (get method error) external shop group

Bug #1025987 reported by Kyle Waid
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Magento OpenERP Connector
Confirmed
Undecided
gekko tek

Bug Description

I have discovered a pretty big bug in my opinion. Took me a while to discover the cause. Let me show you how to produce the error. By default in magento there are two websites. Admin, and the clients website. Often, a website user will create the customers account in the admin panel for a phone order, etc. By default, magento will use Admin as the website. This creates the customer account with store_id=0 or admin. When you synchronize referential, it doesnt sync admin. So when you import an order, the customers account store_id will return 0 and OpenERP will fail to import order because there is no get method to get that store_id. See the api response. Pay attention to customer.info store_id.

Also notice the domain error, should use in not = '('referential_id', '=', [0])'

I have seen this bug on many systems. Not sure how to fix it.

2012-07-18 05:00:33,703 2335 INFO ? Broadened Horizons: Calling Method:customer.info,Arguments:[u'445']
2012-07-18 05:00:37,189 2335 INFO ? Broadened Horizons: Query Returned:{'store_id': '0', 'website_id': '0', 'updated_at': '2012-07-18 04:25:30', 'prefix': '', 'created_in': 'Admin', 'suffix': '', 'taxvat': '', 'increment_id': '01023', 'default_billing': '144', 'password_hash': 'abf32fc9aa45e5a020d04cd2f2ad62ca:qZ', 'default_shipping': None, 'email': 'email_field', 'confirmation': None, 'firstname': 'Kyle', 'middlename': '', 'lastname': 'Test', 'disable_btobpayment': '0', 'payment_delay': '0', 'customer_id': '445', 'dob': None, 'gender': None, 'created_at': '2012-07-18 04:24:08', 'group_id': '1'}
2012-07-18 05:00:37,219 2335 WARNING ? openerp.osv.expression: The domain term '('referential_id', '=', [0])' should use the 'in' or 'not in' operator.
Ready Method False
2012-07-18 05:00:37,243 2335 ERROR ? Broadened Horizons: User Error : There is no "Get Method" configured on the mapping external.shop.group
Traceback (most recent call last):
  File "/usr/local/openerp/openobject-extension/base_external_referentials/decorator.py", line 129, in wrapper
    response = func(self, import_cr, uid, external_session, resource, *args, **kwargs)
  File "/usr/local/openerp/e-commerce-addons/base_sale_multichannels/sale.py", line 559, in _record_one_external_resource
    defaults=defaults, mapping=mapping, mapping_id=mapping_id, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/external_osv.py", line 676, in _record_one_external_resource
    vals = self._transform_one_resource(cr, uid, external_session, 'from_external_to_openerp', resource, mapping=mapping, mapping_id=mapping_id, defaults=defaults, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/decorator.py", line 48, in wrapped
    return func(self, cr, uid, argument, *args, **kwargs)
  File "/usr/local/openerp/magentoerpconnect/magentoerpconnect/sale.py", line 423, in _transform_one_resource
    previous_result=previous_result, defaults=defaults, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/external_osv.py", line 1327, in _transform_one_resource
    vals[to_field] = self._transform_field(cr, uid, external_session, convertion_type, field_value, mapping_line, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/external_osv.py", line 1406, in _transform_field
    return related_obj.get_or_create_oeid(cr, uid, external_session, field_value, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/external_osv.py", line 357, in get_or_create_oeid
    return self._import_one_resource(cr, uid, external_session, external_id, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/external_osv.py", line 628, in _import_one_resource
    res = self._record_one_external_resource(cr, uid, external_session, resources, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/external_osv.py", line 676, in _record_one_external_resource
    vals = self._transform_one_resource(cr, uid, external_session, 'from_external_to_openerp', resource, mapping=mapping, mapping_id=mapping_id, defaults=defaults, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/external_osv.py", line 1327, in _transform_one_resource
    vals[to_field] = self._transform_field(cr, uid, external_session, convertion_type, field_value, mapping_line, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/external_osv.py", line 1406, in _transform_field
    return related_obj.get_or_create_oeid(cr, uid, external_session, field_value, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/external_osv.py", line 357, in get_or_create_oeid
    return self._import_one_resource(cr, uid, external_session, external_id, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/external_osv.py", line 623, in _import_one_resource
    resources = self._get_external_resources(cr, uid, external_session, external_id, context=context)
  File "/usr/local/openerp/openobject-extension/base_external_referentials/decorator.py", line 48, in wrapped
    return func(self, cr, uid, argument, *args, **kwargs)
  File "/usr/local/openerp/magentoerpconnect/magentoerpconnect/magerp_osv.py", line 87, in _get_external_resources
    mapping[mapping_id]['model'])
except_osv: (u'User Error', u'There is no "Get Method" configured on the mapping external.shop.group')
2012-07-18 05:00:37,247 2335 INFO ? Broadened Horizons: Calling Method:sales_order.done,Arguments:[u'517']

Revision history for this message
Kyle Waid (midwest) wrote :
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

on which branch are you observing this?

Changed in magentoerpconnect:
assignee: nobody → Sébastien BEAU - http://www.akretion.com (sebastien.beau)
Revision history for this message
Kyle Waid (midwest) wrote :

Hi, we only use future trunk or whatever it is called now, but I believe the bug exists in all versions due to the nature of the bug. Thanks

Changed in magentoerpconnect:
status: New → Triaged
Revision history for this message
Kyle Waid (midwest) wrote :

We will fix this

Changed in magentoerpconnect:
assignee: Sébastien BEAU - http://www.akretion.com (sebastien.beau) → gekko tek (gekkotek)
status: Triaged → Confirmed
Revision history for this message
David (dhecar) wrote :

I think I have same bug:

Login Successful
2013-05-09 08:13:59,196 8922 WARNING ? openerp.osv.expression: The domain term '('referential_id', '=', [0])' should use the 'in' or 'not in' operator.
2013-05-09 08:13:59,197 8922 INFO ? Glamour: Missing openerp resource for object external.shop.group with external_id 0. Importing on the fly
2013-05-09 08:13:59,219 8922 ERROR ? openerp.netsvc: Error de usuario
There is no "Get Method" configured on the mapping external.shop.group

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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