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

Electronic scale pos interface

Suscribirse

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

Se marcó esta pregunta
posscale
8810 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.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
OpenERP 7 - POS - Electronic Scale, How To ? Resuelto
pos scale
Avatar
Avatar
1
oct 25
6158
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
5741
Odoo POS, change default unity of measurement to lbs from kg
pos scale weight
Avatar
0
jun 17
4966
How to implement weighting scales in POS v7.0?
pos v7 scale
Avatar
Avatar
1
mar 15
5395
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.

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