Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
21027 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor

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

Publicaciones relacionadas Respuestas Vistas Actividad
3
nov 23
50639
0
mar 15
4296
4
ene 24
13169
2
mar 15
8407
2
dic 23
17891