openlabs / magento_integration

Magento OpenERP Integration
https://openerp-magento-connector.readthedocs.org/en/develop/
80 stars 77 forks source link

Unable to import websites #79

Closed nickbock closed 11 years ago

nickbock commented 11 years ago

Hi,

Thanks for all the work on this addon / connector. I followed all the steps from https://openerp-magento-connector.readthedocs.org/en/develop/. Alltough i keep getting an error on importing:

OpenERP Server Error Client Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/openerp/addons/web/http.py", line 204, in dispatch response["result"] = method(self, *_self.params) File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1132, in call_button action = self._call_kw(req, model, method, args, {}) File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1120, in _call_kw return getattr(req.session.model(model), method)(_args, *kwargs) File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 42, in proxy result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw) File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, args) File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 103, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, _params) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 188, in execute_kw return self.execute(db, uid, obj, method, args, _kw or {}) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, _args, _kwargs) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 197, in execute res = self.execute_cr(cr, uid, obj, method, _args, _kw) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 185, in execute_cr return getattr(object, method)(cr, uid, _args, *_kw) File "/usr/lib/pymodules/python2.7/openerp/addons/magento_integration/wizard/import_websites.py", line 49, in import_websites cursor, user, order_config_api.get_states(), context File "/usr/lib/pymodules/python2.7/openerp/addons/magento_integration/sale.py", line 101, in create_all_using_magento_data 'openerp_state': default_order_states_map[code], KeyError: 'processing_payment'

Do you have any idea what could be wrong?

Thanks,

Nick

shalabhaggarwal commented 11 years ago

Hi,

This is because on the magento instance in openerp you need to map all the order states imported to the order states of OpenERP.

The screenshot below should help.

screen shot 2013-07-18 at 7 28 54 pm

If you have already done this and the issue persists, a screenshot will help.

Thanks!

shalabhaggarwal commented 11 years ago

Hi,

This is because on the magento instance in openerp you need to map all the order states imported to the order states of OpenERP.

The screenshot below should help.

screen shot 2013-07-18 at 7 28 54 pm

If you have already done this and the issue persists, a screenshot will help.

Thanks!

nickbock commented 11 years ago

Do i need to add them by hand? There are no fields to fill in. screen shot 2013-07-18 at 4 04 53 pm

Also when i press import order states. I also get the error:

OpenERP Server Error Client Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/openerp/addons/web/http.py", line 204, in dispatch response["result"] = method(self, *_self.params) File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1132, in call_button action = self._call_kw(req, model, method, args, {}) File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1120, in _call_kw return getattr(req.session.model(model), method)(_args, *kwargs) File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 42, in proxy result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw) File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, args) File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 103, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, _params) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 188, in execute_kw return self.execute(db, uid, obj, method, args, _kw or {}) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, _args, _kwargs) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 197, in execute res = self.execute_cr(cr, uid, obj, method, _args, _kw) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 185, in execute_cr return getattr(object, method)(cr, uid, _args, *_kw) File "/usr/lib/pymodules/python2.7/openerp/addons/magentointegration/magento.py", line 104, in import_order_states cursor, user, order_config_api.get_states(), context File "/usr/lib/pymodules/python2.7/openerp/addons/magento_integration/sale.py", line 101, in create_all_using_magento_data 'openerp_state': default_order_states_map[code], KeyError: 'processing_payment'

EDIT: The "Test Connection" and "Import Shipping Methodes" do work.

sharoonthomas commented 11 years ago

It looks like an issue in the order status mappings. "processing_payment" does not seem to be a default order status. Can you confirm if it is something custom in your magento installation ? This will help us debug the issue.

nickbock commented 11 years ago

I check it. There is no status processing_payment in my magento installation. I also checked the DB instead of the backend and its not there. I tried adding a processing_payment, but that didnt solve the problem.

nickbock commented 11 years ago

So. I added this:

'sent' here means quotation state, thats an OpenERP fuck up. 'new': 'sent', 'canceled': 'cancel', 'closed': 'done', 'complete': 'done', 'processing': 'progress', 'holded': 'sent', 'pending_payment': 'sent', 'payment_review': 'sent', 'processing_payment': 'sent',

And now i get the following: KeyError: 'cancel_payment'

Maybe it has something to do with the extension of my payment provider?

I'll keep adding them. Lets see what happens

sharoonthomas commented 11 years ago

I have a proposed patch which is waiting for review of @shalabhaggarwal before it can be merged. Meantime if you want to try, you can download from my fork: https://github.com/sharoonthomas/magento-integration/tree/develop

nickbock commented 11 years ago

Cool. Thanks. I will check it out.

nickbock commented 11 years ago

Your patch solved it. Thanks.

sharoonthomas commented 11 years ago

@nickbock thanks for the confirmation. Will wait for @shalabhaggarwal to merge.