Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

How to solve error "missing parameter marker" in module import_odbc?

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
2 Respuestas
21215 Vistas
Avatar
René

Hello I try to use the module import_odbc to to import data from an MSSQL-Server to OpenERP. I created a data source successfully but always get the following error when I press the button "Run import"

ProgrammingError: ('The SQL contains 0 parameter markers, but 1 parameters were supplied', 'HY000')

Does someone know how to solve this problem? I made tests with the following sample-script from the module:


SELECT distinct [SUPPLIER_CODE] as "ref", [SUPPLIER_NAME] as "name" , 1 as "is_supplier" , [INFO] as "comment" FROM T_SUPPLIERS WHERE INACTIVE_DATE IS NULL and DATE_CHANGED >= %(sync)s


How should this statement be modified to get rid of that error?

Thanks Rene

1
Avatar
Descartar
Avatar
René
Autor Mejor respuesta

After making the following changes in import_odbc.py it works:

line 148: change "params = {'sync': sync}" to "params = sync" line 149: change "obj.sql_source" to "obj.sql_source.encode('utf-8')"

But now I have still a problem concerning the schedular. When I activate a schedular for a connection I always get the following error:


2013-05-10 07:30:11,484 13963 ERROR test openerp.addons.base.ir.ir_cron: Call of self.pool.get('import.odbc.dbtable').import_run(cr, uid, *()) failed in Job 15 Traceback (most recent call last): File "/opt/openerp/v7/server/openerp/addons/base/ir/ir_cron.py", line 136, in _callback method(cr, uid, *args) File "/home/erp/openobject-extension/import_odbc/import_odbc.py", line 120, in import_run actions = self.read(cr, uid, ids, ['id', 'exec_order']) File "/opt/openerp/v7/server/openerp/osv/orm.py", line 3603, in read select = map(lambda x: isinstance(x, dict) and x['id'] or x, select) TypeError: argument 2 to map() must support iteration


Does someone know how to solve this?

0
Avatar
Descartar
Daniel Reis

Can you confirm if change in line 148 is necessary ?

René
Autor

yes, change in line 148 is necessary, otherwise there is always another error-message "('Python type dict not supported. param=1', 'HY097')"

Avatar
Daniel Reis
Mejor respuesta

I believe that the sync date parameter is inserted using a ?.

Try:

SELECT distinct [SUPPLIER_CODE] as "ref", [SUPPLIER_NAME] as "name" , 1 as "is_supplier" , [INFO] as "comment" FROM T_SUPPLIERS WHERE INACTIVE_DATE IS NULL and DATE_CHANGED >= ?
0
Avatar
Descartar
René
Autor

this I already tried but the error remains the same. I tried also with two different drivers (FreeTDS and Microsoft ODBC Driver) but always the same problem....

Daniel Reis

Does it work without the DATE_CHANGED >= ? part?

René
Autor

unfortunytely this does also not work, even if there is no parameter marker at all. When I use the Microsoft-Driver I always get the following error, where the sql-statement is also shown correctly, but the parameter marker is not recognized: ProgrammingError: (ProgrammingError) ('The SQL contains 0 parameter markers, but 1 parameters were supplied', 'HY000') u'SELECT distinct [SUPPLIER_CODE] as "ref", [SUPPLIER_NAME] as "name" , 1 as "is_supplier" , [INFO] as "comment" FROM T_SUPPLIERS WHERE INACTIVE_DATE IS NULL and DATE_CHANGED >= ?' {'sync': datetime.datetime(2013, 4, 17, 20, 58, 31)}

René
Autor

In my opinion it must be a problem in the model import_odbc when used in v7. Did someone already try if import_odbc is also working in v7? Can someone help?

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Sitio web hecho con

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now