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

Popup window in pos

Suscribirse

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

Se marcó esta pregunta
javascriptposodoo10
3 Respuestas
18095 Vistas
Avatar
Linto

Hi,
I have created a popup window in pos. When I click on the payment method a popup window will be shown with a textarea.
But the issue is, I am unable to input any value to the textarea using the keyboard. 
I can input value to the text area using 'ctrl+v' , but no other keys in the keyboard is working.
The code I used is below,

this.gui.show_popup('textarea',{
'title': _t('Swipe your card'),
'confirm': function(value) {
        //-------- my code--------------- } });

Any help appreciated. 

Thank you.

0
Avatar
Descartar
Avatar
Linto
Autor Mejor respuesta

Hi Saravana,

I found a solution for this. The reason why it is not possible to input any value is, there is a keyboard key down handler function in 'PaymentScreenWidget'. This is a keydown handler that prevents backspace from doing a back navigation. It also makes sure that keys that do not generate a keypress in Chrom{e,ium} (eg. delete, backspace, ...) get passed to the keypress handler.

I have made some changes in that function and now I can input values using my keyboard.

2
Avatar
Descartar
Avatar
Boniface Irungu
Mejor respuesta

Hi

POS functions keyboard_keydown_handler() and keyboard_handler() blocks typing of content using your keyboard with the pop-up window. To fix this ;

Create  your pos_custom.js file and override the functions from the PaymentScreenWidget. See below code

odoo.define('pos_custom', function (require) {
"use strict";
//
var core = require('web.core');
var utils = require('web.utils');
//
var module = require('point_of_sale.models'); //Includes all Base Classes of point of sale
var round_di = utils.round_decimals;
var round_pr = utils.round_precision;
//Screens
var screens = require('point_of_sale.screens') // Require Base screens class
//
var QWeb = core.qweb;
var _t = core._t;
//
  //Extend payment screen and add more functionality
 screens.PaymentScreenWidget.include({

click_paymentmethods: function(id) {
var self = this ;
var cashregister = null;
for ( var i = 0; i < this.pos.cashregisters.length; i++ ) {
if ( this.pos.cashregisters[i].journal_id[0] === id ){
cashregister = this.pos.cashregisters[i];
break;
}
}
//debug
console.log("Payment Register ID >> " +cashregister.journal.id) ;
console.log("Payment Register Type >>> "+cashregister.journal.payment_mode) ;
//
if(cashregister.journal.payment_mode === 'mpesa'){
var phone_no = '123456' ;
// alert("Enter Client Phone Number >> ") ;
self.gui.show_popup('textinput',{
title: _t("Enter Client Phone Number") ,
confirm: function(){
//get value
var value = this.$('#text-input').val();
//alert(value);
//console.log("Value Captured ",value);
if(value){
console.log("Perform Validation of MPESA Code") ;
//Add Payment Line after success validation of the code
self.pos.get_order().add_paymentline( cashregister );
self.reset_input();
self.render_paymentlines();
}else{
// console.log("Cannot validate Code..");
self.gui.show_popup('error',{
'title': _t('Error: Payment Validation Error'),
'body': _t('Sorry Cannot validate the payment. Try again later'),
});
}

},
}) ;
}else {
//Add Payment Line after success validation of the code
self.pos.get_order().add_paymentline( cashregister );
self.reset_input();
self.render_paymentlines();
}

},
init: function(parent, options) {
var self = this;
this._super(parent, options);
//Overide methods
this.keyboard_keydown_handler = function(event){

if (event.keyCode === 8 || event.keyCode === 46) { // Backspace and Delete
event.preventDefault();
self.keyboard_handler(event);
}
};

this.keyboard_handler = function(event){
var key = '';

if (event.type === "keypress") {
if (event.keyCode === 13) { // Enter
self.validate_order();
} else if ( event.keyCode === 190 || // Dot
event.keyCode === 110 || // Decimal point (numpad)
event.keyCode === 188 || // Comma
event.keyCode === 46 ) { // Numpad dot
key = self.decimal_point;
} else if (event.keyCode >= 48 && event.keyCode <= 57) { // Numbers
key = '' + (event.keyCode - 48);
} else if (event.keyCode === 45) { // Minus
key = '-';
} else if (event.keyCode === 43) { // Plus
key = '+';
}else{
return ;
}
} else { // keyup/keydown
if (event.keyCode === 46) { // Delete
key = 'CLEAR';
} else if (event.keyCode === 8) { // Backspace
key = 'BACKSPACE';
}
}

self.payment_input(key);
// event.preventDefault();
/* if (event.type === "keypress") {
return ;
}*/
};
//End method override
} ,

}) ;

});



Thanks..



0
Avatar
Descartar
Avatar
Saravana Kumar
Mejor respuesta

I too have the same problem in odoo v9.

I created a new payment method for card payment. when choosing this payment option, a popup will arise to get the card details from the user. here i can't key in the details in the input fields. ( ctrl+v is working ).

i tested the odoo base popup widgets like TextInputPopupWidget and TextIAreaPopupWidget both are not working and can't key in the values.

Any solutions.?

0
Avatar
Descartar
¿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
How to reload orderlines when changing customer in POS Resuelto
javascript pos odoo10
Avatar
Avatar
1
jul 19
10577
TypeError: cur is undefined Odoo 11 Pos
javascript pos odoo odoo10
Avatar
0
dic 18
3540
How to change Odoo POS URL in button click in POS
javascript pos controller odoo10
Avatar
Avatar
1
oct 18
7005
does odoo 17 allow to add button to Navbar header in point of sale session inside it to get dynamic data
javascript pos
Avatar
Avatar
1
nov 24
2228
How to add product in POS programmatically Resuelto
javascript pos
Avatar
Avatar
Avatar
Avatar
4
oct 24
5237
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