Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar 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
  • Proyecto
  • 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

Electronic scale pos interface

Suscribirse

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

Se marcó esta pregunta
posscale
8846 Vistas
Avatar
Erbeia

Hello, I'm creating a proxy server to manage the interface between the pos module and the electronic scale. I receive well the http get request on my server, but I don't understand in wich format I have to answer with the actual weight... Can somebody tell me the correct answer format for this json request?

Here is the request I receive:

/pos/weighting_start?jsonp=jQuery18302055237984620708_1361460794237&id=r360&r=%7B%22jsonrpc%22%3A%222.0%22%2C%22method%22%3A%22call%22%2C%22params%22%3A%7B%22context%22%3A%7B%7D%7D%2C%22id%22%3A%22r360%22%7D&_=1361460812032

Url = {htp://localhost:6655/pos/weighting_start?jsonp=jQuery18302055237984620708_1361460794237&id=r360&r={"jsonrpc":"2.0","method":"call","params":{"context":{}},"id":"r360"}&_=1361460812032}

For the javascript code, it's the original device.js (..\server\openerp\addons\point_of_sale\static\src\js):

//returns the weight on the scale. 
        // is called at regular interval (up to 10x/sec) between a weighting_start()
        // and a weighting_end()
        weighting_read_kg: function(){
            var self = this;
            if(this.bypass_proxy){
                return this.weight;
            }else{
                this.message('weighting_read_kg',{})
                    .done(function(weight){
                        if(self.weighting && !self.bypass_proxy){
                            self.weight = weight;
                        }
                    });
                return this.weight;
            }
        },

I'm making the server in C#.

I have every data I need but don't know how to format them... Here is the reponse code:

private void HttpWebServer_SendData()
        {
            if (context == null) return;

            string responseString = RxString;
            byte[] buffer = Encoding.UTF8.GetBytes(responseString);
            context.Response.ContentLength64 = buffer.Length;

            context.Response.Headers.Set(HttpResponseHeader.Server, "Serial to http Server");

            System.IO.Stream output = context.Response.OutputStream;
            output.Write(buffer, 0, buffer.Length);
            output.Close();
        }

where RxString is the actual weight, ex: "120.5"

Thank you

2
Avatar
Descartar
Yaroslav

Can you post your json structure? That way you will get more opportunities to have some answer. Maybe you just have a minor error on the json structure or alike and it will be easier to detect it.

Yaroslav

Edit your question and add there the code. Use the Edit option, it's the small pencil under the question, aligned to the right.

Erbeia
Autor

Sorry, I'll do this

Erbeia
Autor

Nobody can give me an example of proxy answer that the POS 7.0 is waiting in the weighting_read_kg loop?

Erbeia
Autor

Here is the JQuery - JSON Exchange I get: Request: {http://localhost:6655/pos/weighting_start?jsonp=jQuery183021106903867513827_1362069234058&id=r360&r={"jsonrpc":"2.0","method":"call","params":{"context":{}},"id":"r360"}&_=1362069249742}

Response: "{\"jsonrpc\": \"2.0\", \"result\": 12.5, \"id\": \"r360\"}"

I still get a script error in the POS frontend.

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

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

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
OpenERP 7 - POS - Electronic Scale, How To ? Resuelto
pos scale
Avatar
Avatar
1
oct 25
6166
Can Odoo POS scan tickets from scales that weight meat and cheese?
pos scale separate
Avatar
1
jul 25
99
Scale with Odoo 11 POSand POSBox
pos scale posbox
Avatar
Avatar
2
dic 18
5757
Odoo POS, change default unity of measurement to lbs from kg
pos scale weight
Avatar
0
jun 17
4970
How to implement weighting scales in POS v7.0?
pos v7 scale
Avatar
Avatar
1
mar 15
5412
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información 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 totalmente integrado.

Website made with

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