Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
20923 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Tekijä

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

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
3
marrask. 23
50272
0
maalisk. 15
4197
4
tammik. 24
12943
2
maalisk. 15
8301
2
jouluk. 23
17710