Skip to Content
Menu
This question has been flagged

I'm using the prestashop - openerp connector module, but when i try to import data from the website (background jobs) is giving me this error traceback:

 File "/usr/prestaconnect/openerp-connector/connector/queue/worker.py", line 122, in run_job
 job.perform(session)
 File "/usr/prestaconnect/openerp-connector/connector/queue/job.py", line 460, in perform
self.result = self.func(session, *self.args, **self.kwargs)
 File "/usr/prestaconnect/prestashoperpconnect/prestashoperpconnect/unit/import_synchronizer.py", line 663, in       import_batch
  importer.run(filters=filters, **kwargs)
 File "/usr/prestaconnect/prestashoperpconnect/prestashoperpconnect/unit/import_synchronizer.py", line 202, in run
return super(PaymentMethodsImportSynchronizer, self).run(filters, **kwargs)
 File "/usr/prestaconnect/prestashoperpconnect/prestashoperpconnect/unit/import_synchronizer.py", line 176, in run
record_ids = self._run_page(filters)
 File "/usr/prestaconnect/prestashoperpconnect/prestashoperpconnect/unit/import_synchronizer.py", line 186, in _run_page
self._import_record(record_id, **kwargs)
 File "/usr/prestaconnect/prestashoperpconnect/prestashoperpconnect/unit/import_synchronizer.py", line 206, in _import_record
 ('name', '=', record['payment']),
 TypeError: string indices must be integers, not str

In the module code i see this:

class PaymentMethodsImportSynchronizer(BatchImportSynchronizer):
_model_name = 'payment.method'

 def run(self, filters=None, **kwargs):
   if filters is None:
    filters = {}
filters['display'] = '[id,payment]'
   return super(PaymentMethodsImportSynchronizer, self).run(filters, **kwargs)

  def _import_record(self, record):
   ids = self.session.search('payment.method', [
    ('name', '=', record['payment']),
    ('company_id', '=', self.backend_record.company_id.id),
    ])
    if ids:
        return
    self.session.create('payment.method', {
    'name': record['payment'],
    'company_id': self.backend_record.company_id.id,
   })

I don't know what actually is happening, i need some lights on this, cause i did not developed this module, and i'm new to prestashop - openerp integration.

I managed to install everything and it does import metadata and base data as well.

Any help would be greatly appreciated, thanks in advance!

Avatar
Discard
Best Answer

Hi,

Same error for me.

It appears since they added code in revision 281 on the 2013-11-14 to import payment methods.

You can browse the change in the code here : bazaar.launchpad.net/~prestashoperpconnect-core-editors/prestashoperpconnect/7.0/revision/281 and comment all the changes.

Regards

Avatar
Discard
Author

Oh, thank you very much! Just saw your answer! I'll check it out, merci!

Related Posts Replies Views Activity
3
Nov 23
50210
0
Mar 15
4187
4
Jan 24
12935
2
Mar 15
8277
2
Dec 23
17703