From b62263b7950770884f131f5f32c5a5dd61adebf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Au=C3=A9lien=20DUMAINE?= Date: Thu, 10 Jul 2014 17:23:30 +0200 Subject: [PATCH 01/51] Initial check-in of the module pos_payment_terminal. --- pos_payment_terminal/__init__.py | 1 + pos_payment_terminal/__openerp__.py | 45 ++++++++++ pos_payment_terminal/pos_payment_terminal.py | 36 ++++++++ pos_payment_terminal/pos_payment_terminal.xml | 10 +++ .../pos_payment_terminal_view.xml | 25 ++++++ .../static/src/js/pos_payment_terminal.js | 86 +++++++++++++++++++ .../static/src/xml/pos_payment_terminal.xml | 16 ++++ 7 files changed, 219 insertions(+) create mode 100755 pos_payment_terminal/__init__.py create mode 100755 pos_payment_terminal/__openerp__.py create mode 100644 pos_payment_terminal/pos_payment_terminal.py create mode 100755 pos_payment_terminal/pos_payment_terminal.xml create mode 100644 pos_payment_terminal/pos_payment_terminal_view.xml create mode 100755 pos_payment_terminal/static/src/js/pos_payment_terminal.js create mode 100644 pos_payment_terminal/static/src/xml/pos_payment_terminal.xml diff --git a/pos_payment_terminal/__init__.py b/pos_payment_terminal/__init__.py new file mode 100755 index 00000000..45b85bcf --- /dev/null +++ b/pos_payment_terminal/__init__.py @@ -0,0 +1 @@ +import pos_payment_terminal diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py new file mode 100755 index 00000000..67cb8a08 --- /dev/null +++ b/pos_payment_terminal/__openerp__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'POS Payment Terminal', + 'version': '0.1', + 'category': 'Point Of Sale', + 'summary': 'Manage Payment Terminal device from POS front end', + 'description': """ +POS Payment Terminal +==================== + +This module adds support for Payment Terminal in the Point of Sale. This module is designed to be installed on the *main Odoo server*. On the *POSbox*, you should install the module *hw_x* depending on the protocol implemented in your device. Ingenico devices support the Telium protocol implemented in the *hw_telium_payment_terminal* module. + +This module support two payment methods : cards and checks. The payment method should be configured on the main Odoo server, in the menu Point of Sale > Configuration > Payment Methods. + +This module has been developped during a POS code sprint at Akretion France from July 7th to July 10th 2014. This module is part of the POS project of the Odoo Community Association http://odoo-community.org/. You are invited to become a member and/or get involved in the Association ! + +Please contact Alexis de Lattre from Akretion for any help or question about this module. + """, + 'author': 'Aurélien DUMAINE', + 'depends': ['point_of_sale'], + 'data' : ['pos_payment_terminal.xml', + 'pos_payment_terminal_view.xml'], + 'qweb': ['static/src/xml/pos_payment_terminal.xml'], +} diff --git a/pos_payment_terminal/pos_payment_terminal.py b/pos_payment_terminal/pos_payment_terminal.py new file mode 100644 index 00000000..3b4853ad --- /dev/null +++ b/pos_payment_terminal/pos_payment_terminal.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SP (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp import models, fields + +class account_journal(models.Model): + _name = 'account.journal' + _inherit = 'account.journal' + + payment_mode = fields.Selection((('card', 'Card'), ('check', 'Check')), 'Payment mode', help="Select the payment mode sent to the payment terminal") + +class pos_config(models.Model): + _name = 'pos.config' + _inherit = 'pos.config' + + iface_payment_terminal = fields.Boolean('Payment Terminal', help="A payment terminal is available on the Proxy") + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/pos_payment_terminal/pos_payment_terminal.xml b/pos_payment_terminal/pos_payment_terminal.xml new file mode 100755 index 00000000..32d81264 --- /dev/null +++ b/pos_payment_terminal/pos_payment_terminal.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/pos_payment_terminal/pos_payment_terminal_view.xml b/pos_payment_terminal/pos_payment_terminal_view.xml new file mode 100644 index 00000000..e55d2a34 --- /dev/null +++ b/pos_payment_terminal/pos_payment_terminal_view.xml @@ -0,0 +1,25 @@ + + + + + pos.config.form.view.inherit + pos.config + + + + + + + + + POS journal inherit + account.journal + + + + + + + + + diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js new file mode 100755 index 00000000..6f7a866f --- /dev/null +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -0,0 +1,86 @@ +openerp.pos_payment_terminal = function(instance){ + module = instance.point_of_sale; + + module.ProxyDevice = module.ProxyDevice.extend({ + payment_terminal_transaction_start: function(line, currency_iso, currency_iso_numeric){ + var data = {'amount' : line.get_amount(), + 'currency_iso' : currency_iso, + 'currency_iso_numeric' : currency_iso_numeric, + 'payment_mode' : line.cashregister.journal.payment_mode}; + alert(JSON.stringify(data)); + this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); + }, + }); + + //TODO make the button bigger and with better name + + var _super_PaymentScreenWidget_init_ = module.PaymentScreenWidget.prototype.init; + module.PaymentScreenWidget.prototype.init = function(parent, options){ + _super_PaymentScreenWidget_init_.call(this, parent, options); + self = this; + this.payment_terminal_transaction_start = function(event){ + var node = this; + while(node && !node.classList.contains('paymentline')){ + node = node.parentNode; + } + if(node){ + if (self.pos.config.iface_payment_terminal) + self.pos.proxy.payment_terminal_transaction_start(node.line, self.pos.currency.name, self.pos.currency.iso_numeric); + } + event.stopPropagation(); + }; + }; + + var _super_renderPaymentline_ = module.PaymentScreenWidget.prototype.render_paymentline; + module.PaymentScreenWidget.prototype.render_paymentline = function(line){ + var el_node = _super_renderPaymentline_.call(this, line); + if (line.cashregister.journal.payment_mode && this.pos.config.iface_payment_terminal){ + if (!this.pos.currency.name){ + var self = this; + var currencies = new instance.web.Model('res.currency').query(['name', 'iso_numeric']) + .filter([['id','=',this.pos.currency.id]]) + .all().then(function (currency) { + self.pos.currency.name = currency[0].name; + self.pos.currency.iso_numeric = currency[0].iso_numeric; + }); + } + el_node.querySelector('.payment-terminal-transaction-start') + .addEventListener('click', this.payment_terminal_transaction_start); + //.addEventListener('click', this.pos.proxy.payment_terminal_transaction_start(line, this.pos.currency.name, this.pos.currency.iso_numeric)); + } + return el_node; + }; + +/* + var _super_load_server_data_ = module.PosModel.prototype.load_server_data; + module.PosModel.prototype.load_server_data = function(){ + var loaded = _super_load_server_data_.call(this); + //FIXME : this is asynchronous, I can't assume the pos.currency loaded when we enter is this + this.pos.currency.name = new instance.web.Model('res.currency').query('name').filter([['id','=',this.pos_currency.id]]).all()[0] + return loaded; + }; +*/ + +/* + var _super_setSmartStatus_ = module.ProxyStatusWidget.prototype.set_smart_status; + module.ProxyStatusWidget.prototype.set_smart_status = function(status){ + _super_setSmartStatus_.call(this, status); + if(status.status === 'connected'){ + var warning = false; + var msg = '' + if(this.pos.config.iface_customer_display){ + var customer_display = status.drivers.customer_display ? status.drivers.customer_display.status : false; + if( customer_display != 'connected' && customer_display != 'connecting'){ + warning = true; + msg = msg ? msg + ' & ' : msg; + msg += _t('Customer display'); + } + } + msg = msg ? msg + ' ' + _t('Offline') : msg; + this.set_status(warning ? 'warning' : 'connected', msg); + }else{ + this.set_status(status.status,''); + } + }; +*/ +}; diff --git a/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml b/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml new file mode 100644 index 00000000..8467a816 --- /dev/null +++ b/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + From bb38bbf7988bff9492946fcda53ee162347bb54e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 10 Jul 2014 20:40:01 +0200 Subject: [PATCH 02/51] Add dependancy on currency_iso_numeric. --- pos_payment_terminal/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py index 67cb8a08..a6d5c5de 100755 --- a/pos_payment_terminal/__openerp__.py +++ b/pos_payment_terminal/__openerp__.py @@ -38,7 +38,7 @@ This module has been developped during a POS code sprint at Akretion France from Please contact Alexis de Lattre from Akretion for any help or question about this module. """, 'author': 'Aurélien DUMAINE', - 'depends': ['point_of_sale'], + 'depends': ['point_of_sale', 'currency_iso_numeric'], 'data' : ['pos_payment_terminal.xml', 'pos_payment_terminal_view.xml'], 'qweb': ['static/src/xml/pos_payment_terminal.xml'], From 692f5abefbe92ae31ddaf6e57db31ae0de55d6dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Au=C3=A9lien=20DUMAINE?= Date: Fri, 11 Jul 2014 03:03:11 +0200 Subject: [PATCH 03/51] pos_customer_display bugfix : new massage on deleting orderLine and fixing unit_price computation on adding orderLine --- pos_payment_terminal/static/src/js/pos_payment_terminal.js | 1 - 1 file changed, 1 deletion(-) diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 6f7a866f..4281a9c0 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -46,7 +46,6 @@ openerp.pos_payment_terminal = function(instance){ } el_node.querySelector('.payment-terminal-transaction-start') .addEventListener('click', this.payment_terminal_transaction_start); - //.addEventListener('click', this.pos.proxy.payment_terminal_transaction_start(line, this.pos.currency.name, this.pos.currency.iso_numeric)); } return el_node; }; From ed9fddb74a4cf9bb68a30841a9655bdb1a813511 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 12 Jul 2014 00:29:04 +0200 Subject: [PATCH 04/51] Fix copyright headers PEP8 stuff --- pos_payment_terminal/__init__.py | 2 +- pos_payment_terminal/__openerp__.py | 16 ++++++++-------- pos_payment_terminal/pos_payment_terminal.py | 18 ++++++++++++------ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/pos_payment_terminal/__init__.py b/pos_payment_terminal/__init__.py index 45b85bcf..9e67b3d9 100755 --- a/pos_payment_terminal/__init__.py +++ b/pos_payment_terminal/__init__.py @@ -1 +1 @@ -import pos_payment_terminal +from . import pos_payment_terminal diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py index a6d5c5de..9241fd02 100755 --- a/pos_payment_terminal/__openerp__.py +++ b/pos_payment_terminal/__openerp__.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). +# POS Payment Terminal module for Odoo +# Copyright (C) 2014 Aurélien DUMAINE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -29,17 +29,17 @@ POS Payment Terminal ==================== -This module adds support for Payment Terminal in the Point of Sale. This module is designed to be installed on the *main Odoo server*. On the *POSbox*, you should install the module *hw_x* depending on the protocol implemented in your device. Ingenico devices support the Telium protocol implemented in the *hw_telium_payment_terminal* module. +This module adds support for Payment Terminal in the Point of Sale. This module is designed to be installed on the *main Odoo server*. On the *POSbox*, you should install the module *hw_x* depending on the protocol implemented in your device. Ingenico and Sagem devices support the Telium protocol implemented in the *hw_telium_payment_terminal* module. This module support two payment methods : cards and checks. The payment method should be configured on the main Odoo server, in the menu Point of Sale > Configuration > Payment Methods. This module has been developped during a POS code sprint at Akretion France from July 7th to July 10th 2014. This module is part of the POS project of the Odoo Community Association http://odoo-community.org/. You are invited to become a member and/or get involved in the Association ! - -Please contact Alexis de Lattre from Akretion for any help or question about this module. """, 'author': 'Aurélien DUMAINE', 'depends': ['point_of_sale', 'currency_iso_numeric'], - 'data' : ['pos_payment_terminal.xml', - 'pos_payment_terminal_view.xml'], - 'qweb': ['static/src/xml/pos_payment_terminal.xml'], + 'data': [ + 'pos_payment_terminal.xml', + 'pos_payment_terminal_view.xml', + ], + 'qweb': ['static/src/xml/pos_payment_terminal.xml'], } diff --git a/pos_payment_terminal/pos_payment_terminal.py b/pos_payment_terminal/pos_payment_terminal.py index 3b4853ad..e6dc9ff7 100644 --- a/pos_payment_terminal/pos_payment_terminal.py +++ b/pos_payment_terminal/pos_payment_terminal.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SP (). +# POS Payment Terminal module for Odoo +# Copyright (C) 2014 Aurélien DUMAINE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -21,16 +21,22 @@ from openerp import models, fields + class account_journal(models.Model): _name = 'account.journal' _inherit = 'account.journal' - - payment_mode = fields.Selection((('card', 'Card'), ('check', 'Check')), 'Payment mode', help="Select the payment mode sent to the payment terminal") + + payment_mode = fields.Selection( + (('card', 'Card'), ('check', 'Check')), 'Payment mode', + help="Select the payment mode sent to the payment terminal") + class pos_config(models.Model): _name = 'pos.config' _inherit = 'pos.config' - - iface_payment_terminal = fields.Boolean('Payment Terminal', help="A payment terminal is available on the Proxy") + + iface_payment_terminal = fields.Boolean( + 'Payment Terminal', + help="A payment terminal is available on the Proxy") # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 0bfe0aaf8ad7b7f221001bb986f1f582247b5992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Au=C3=A9lien=20DUMAINE?= Date: Sun, 20 Jul 2014 22:36:24 +0200 Subject: [PATCH 05/51] pos_payment_terminal : bigger button for start transaction with touchscreen --- pos_payment_terminal/pos_payment_terminal_view.xml | 6 ++++++ pos_payment_terminal/static/src/js/pos_payment_terminal.js | 2 +- .../static/src/xml/pos_payment_terminal.xml | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pos_payment_terminal/pos_payment_terminal_view.xml b/pos_payment_terminal/pos_payment_terminal_view.xml index e55d2a34..dbcca88c 100644 --- a/pos_payment_terminal/pos_payment_terminal_view.xml +++ b/pos_payment_terminal/pos_payment_terminal_view.xml @@ -21,5 +21,11 @@ + + diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 4281a9c0..9013da8d 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -7,7 +7,7 @@ openerp.pos_payment_terminal = function(instance){ 'currency_iso' : currency_iso, 'currency_iso_numeric' : currency_iso_numeric, 'payment_mode' : line.cashregister.journal.payment_mode}; - alert(JSON.stringify(data)); +// alert(JSON.stringify(data)); this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); }, }); diff --git a/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml b/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml index 8467a816..ce7459c4 100644 --- a/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml +++ b/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml @@ -1,12 +1,13 @@ - + From aae5e059acb46d2ae833b0b72736eb532a686716 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 22 Oct 2014 21:47:15 +0200 Subject: [PATCH 06/51] pos_payment_terminal: add missing css file pos_customer_display: FIX JS code and make it more robust --- .../static/src/css/pos_payment_terminal.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pos_payment_terminal/static/src/css/pos_payment_terminal.css diff --git a/pos_payment_terminal/static/src/css/pos_payment_terminal.css b/pos_payment_terminal/static/src/css/pos_payment_terminal.css new file mode 100644 index 00000000..bfec68ef --- /dev/null +++ b/pos_payment_terminal/static/src/css/pos_payment_terminal.css @@ -0,0 +1,12 @@ +.pos .payment-terminal-transaction-start button { + width: 150px; + height: 60px; + font-size: 18px; + cursor: pointer; + text-align:center; + box-sizing: border-box; + -moz-box-sizing: border-box; + left: 105%; + bottom: 10px; + position: absolute; +} From 0996c84a28ee417db27ca759beeaa3c575fd4414 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 23 Oct 2014 14:51:40 +0200 Subject: [PATCH 07/51] Remove currency_iso_numeric (replaced by pycountry) Adapt JS code of pos_payment_terminal Some cleanup --- pos_payment_terminal/__openerp__.py | 2 +- pos_payment_terminal/pos_payment_terminal.py | 4 - .../static/src/js/pos_payment_terminal.js | 97 ++++++------------- 3 files changed, 32 insertions(+), 71 deletions(-) diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py index 9241fd02..0595a779 100755 --- a/pos_payment_terminal/__openerp__.py +++ b/pos_payment_terminal/__openerp__.py @@ -36,7 +36,7 @@ This module support two payment methods : cards and checks. The payment method s This module has been developped during a POS code sprint at Akretion France from July 7th to July 10th 2014. This module is part of the POS project of the Odoo Community Association http://odoo-community.org/. You are invited to become a member and/or get involved in the Association ! """, 'author': 'Aurélien DUMAINE', - 'depends': ['point_of_sale', 'currency_iso_numeric'], + 'depends': ['point_of_sale'], 'data': [ 'pos_payment_terminal.xml', 'pos_payment_terminal_view.xml', diff --git a/pos_payment_terminal/pos_payment_terminal.py b/pos_payment_terminal/pos_payment_terminal.py index e6dc9ff7..a54252ad 100644 --- a/pos_payment_terminal/pos_payment_terminal.py +++ b/pos_payment_terminal/pos_payment_terminal.py @@ -23,7 +23,6 @@ from openerp import models, fields class account_journal(models.Model): - _name = 'account.journal' _inherit = 'account.journal' payment_mode = fields.Selection( @@ -32,11 +31,8 @@ class account_journal(models.Model): class pos_config(models.Model): - _name = 'pos.config' _inherit = 'pos.config' iface_payment_terminal = fields.Boolean( 'Payment Terminal', help="A payment terminal is available on the Proxy") - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 9013da8d..419a0b20 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -2,84 +2,49 @@ openerp.pos_payment_terminal = function(instance){ module = instance.point_of_sale; module.ProxyDevice = module.ProxyDevice.extend({ - payment_terminal_transaction_start: function(line, currency_iso, currency_iso_numeric){ - var data = {'amount' : line.get_amount(), - 'currency_iso' : currency_iso, - 'currency_iso_numeric' : currency_iso_numeric, - 'payment_mode' : line.cashregister.journal.payment_mode}; -// alert(JSON.stringify(data)); - this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); + payment_terminal_transaction_start: function(line, currency_iso){ + var data = {'amount' : line.get_amount(), + 'currency_iso' : currency_iso, + 'payment_mode' : line.cashregister.journal.payment_mode}; +// alert(JSON.stringify(data)); + this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); }, - }); + }); - //TODO make the button bigger and with better name + //TODO make the button bigger and with better name var _super_PaymentScreenWidget_init_ = module.PaymentScreenWidget.prototype.init; module.PaymentScreenWidget.prototype.init = function(parent, options){ _super_PaymentScreenWidget_init_.call(this, parent, options); - self = this; - this.payment_terminal_transaction_start = function(event){ - var node = this; - while(node && !node.classList.contains('paymentline')){ - node = node.parentNode; - } - if(node){ - if (self.pos.config.iface_payment_terminal) - self.pos.proxy.payment_terminal_transaction_start(node.line, self.pos.currency.name, self.pos.currency.iso_numeric); - } - event.stopPropagation(); - }; - }; + self = this; + this.payment_terminal_transaction_start = function(event){ + var node = this; + while (node && !node.classList.contains('paymentline')){ + node = node.parentNode; + } + if (node && !_.isEmpty(node.line) && self.pos.config.iface_payment_terminal){ + self.pos.proxy.payment_terminal_transaction_start(node.line, self.pos.currency.name); + } + event.stopPropagation(); + }; + }; var _super_renderPaymentline_ = module.PaymentScreenWidget.prototype.render_paymentline; module.PaymentScreenWidget.prototype.render_paymentline = function(line){ var el_node = _super_renderPaymentline_.call(this, line); if (line.cashregister.journal.payment_mode && this.pos.config.iface_payment_terminal){ - if (!this.pos.currency.name){ - var self = this; - var currencies = new instance.web.Model('res.currency').query(['name', 'iso_numeric']) - .filter([['id','=',this.pos.currency.id]]) - .all().then(function (currency) { - self.pos.currency.name = currency[0].name; - self.pos.currency.iso_numeric = currency[0].iso_numeric; - }); - } + if (!this.pos.currency.name){ + var self = this; + var currencies = new instance.web.Model('res.currency').query(['name']) + .filter([['id','=',this.pos.currency.id]]) + .all().then(function (currency) { + self.pos.currency.name = currency[0].name; + }); + } el_node.querySelector('.payment-terminal-transaction-start') - .addEventListener('click', this.payment_terminal_transaction_start); - } - return el_node; - }; - -/* - var _super_load_server_data_ = module.PosModel.prototype.load_server_data; - module.PosModel.prototype.load_server_data = function(){ - var loaded = _super_load_server_data_.call(this); - //FIXME : this is asynchronous, I can't assume the pos.currency loaded when we enter is this - this.pos.currency.name = new instance.web.Model('res.currency').query('name').filter([['id','=',this.pos_currency.id]]).all()[0] - return loaded; - }; -*/ - -/* - var _super_setSmartStatus_ = module.ProxyStatusWidget.prototype.set_smart_status; - module.ProxyStatusWidget.prototype.set_smart_status = function(status){ - _super_setSmartStatus_.call(this, status); - if(status.status === 'connected'){ - var warning = false; - var msg = '' - if(this.pos.config.iface_customer_display){ - var customer_display = status.drivers.customer_display ? status.drivers.customer_display.status : false; - if( customer_display != 'connected' && customer_display != 'connecting'){ - warning = true; - msg = msg ? msg + ' & ' : msg; - msg += _t('Customer display'); - } - } - msg = msg ? msg + ' ' + _t('Offline') : msg; - this.set_status(warning ? 'warning' : 'connected', msg); - }else{ - this.set_status(status.status,''); + .addEventListener('click', this.payment_terminal_transaction_start); } + return el_node; }; -*/ + }; From 6a166aa6442fecb908d3e9981020e8b9470252c2 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 17 Nov 2014 13:09:21 +0100 Subject: [PATCH 08/51] Add Spanish translation by Alejandro Amador (thanks for your contribution !) Move CSS definition from pos_payment_terminal_view.xml to pos_payment_terminal.xml Small cleanups --- pos_payment_terminal/__init__.py | 0 pos_payment_terminal/__openerp__.py | 0 pos_payment_terminal/pos_payment_terminal.xml | 22 +++++++++++++------ .../pos_payment_terminal_view.xml | 11 ++++------ 4 files changed, 19 insertions(+), 14 deletions(-) mode change 100755 => 100644 pos_payment_terminal/__init__.py mode change 100755 => 100644 pos_payment_terminal/__openerp__.py mode change 100755 => 100644 pos_payment_terminal/pos_payment_terminal.xml diff --git a/pos_payment_terminal/__init__.py b/pos_payment_terminal/__init__.py old mode 100755 new mode 100644 diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py old mode 100755 new mode 100644 diff --git a/pos_payment_terminal/pos_payment_terminal.xml b/pos_payment_terminal/pos_payment_terminal.xml old mode 100755 new mode 100644 index 32d81264..6f46ad01 --- a/pos_payment_terminal/pos_payment_terminal.xml +++ b/pos_payment_terminal/pos_payment_terminal.xml @@ -1,10 +1,18 @@ - - - + + + + + + + diff --git a/pos_payment_terminal/pos_payment_terminal_view.xml b/pos_payment_terminal/pos_payment_terminal_view.xml index dbcca88c..f04d4648 100644 --- a/pos_payment_terminal/pos_payment_terminal_view.xml +++ b/pos_payment_terminal/pos_payment_terminal_view.xml @@ -1,8 +1,9 @@ + - pos.config.form.view.inherit + pos.payment.terminal.config.form pos.config @@ -11,8 +12,9 @@ + - POS journal inherit + pos.payment.terminal.journal.form account.journal @@ -22,10 +24,5 @@ - From cc1e3934fcb07ae89bf6810d3770723d902a2baa Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 30 Dec 2014 17:28:59 +0100 Subject: [PATCH 09/51] [FIX] Vicious bug that is invisible alone, but becomes visible when used with the module pos_pay_invoice --- pos_payment_terminal/static/src/js/pos_payment_terminal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 419a0b20..f63f6f3e 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -16,7 +16,7 @@ openerp.pos_payment_terminal = function(instance){ var _super_PaymentScreenWidget_init_ = module.PaymentScreenWidget.prototype.init; module.PaymentScreenWidget.prototype.init = function(parent, options){ _super_PaymentScreenWidget_init_.call(this, parent, options); - self = this; + var self = this; this.payment_terminal_transaction_start = function(event){ var node = this; while (node && !node.classList.contains('paymentline')){ From 086644359178ab9a51c63dc63d34449ba04c9189 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 6 Jan 2015 23:26:30 +0100 Subject: [PATCH 10/51] PEP8 --- pos_payment_terminal/__openerp__.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py index 0595a779..ab46d83e 100644 --- a/pos_payment_terminal/__openerp__.py +++ b/pos_payment_terminal/__openerp__.py @@ -29,11 +29,22 @@ POS Payment Terminal ==================== -This module adds support for Payment Terminal in the Point of Sale. This module is designed to be installed on the *main Odoo server*. On the *POSbox*, you should install the module *hw_x* depending on the protocol implemented in your device. Ingenico and Sagem devices support the Telium protocol implemented in the *hw_telium_payment_terminal* module. +This module adds support for credit card reader and checks printer +in the Point of Sale. This module is designed to be installed on the +*main Odoo server*. On the *POSbox*, you should install the module +*hw_x* depending on the protocol implemented in your device. Ingenico +and Sagem devices support the Telium protocol implemented in the +*hw_telium_payment_terminal* module. -This module support two payment methods : cards and checks. The payment method should be configured on the main Odoo server, in the menu Point of Sale > Configuration > Payment Methods. +This module support two payment methods : cards and checks. The payment +method should be configured on the main Odoo server, in the menu Point +of Sale > Configuration > Payment Methods. -This module has been developped during a POS code sprint at Akretion France from July 7th to July 10th 2014. This module is part of the POS project of the Odoo Community Association http://odoo-community.org/. You are invited to become a member and/or get involved in the Association ! +This module has been developped during a POS code sprint at Akretion +France from July 7th to July 10th 2014. This module is part of the POS +project of the Odoo Community Association http://odoo-community.org/. +You are invited to become a member and/or get involved in the +Association ! """, 'author': 'Aurélien DUMAINE', 'depends': ['point_of_sale'], From ce2f7a82132648a617afa5d9794b2de0ff1c5898 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Fri, 6 Feb 2015 15:30:44 +0100 Subject: [PATCH 11/51] Add license key in __openerp__.py --- pos_payment_terminal/__openerp__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py index ab46d83e..0abb8ee8 100644 --- a/pos_payment_terminal/__openerp__.py +++ b/pos_payment_terminal/__openerp__.py @@ -47,6 +47,7 @@ You are invited to become a member and/or get involved in the Association ! """, 'author': 'Aurélien DUMAINE', + 'license': 'AGPL-3', 'depends': ['point_of_sale'], 'data': [ 'pos_payment_terminal.xml', From 469db563b8f38beada04d90ec289ba963952892e Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Mon, 2 Mar 2015 15:37:13 +0100 Subject: [PATCH 12/51] Add OCA as author of OCA addons In order to get visibility on https://www.odoo.com/apps the OCA board has decided to add the OCA as author of all the addons maintained as part of the association. --- pos_payment_terminal/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py index 0abb8ee8..1f9f2f51 100644 --- a/pos_payment_terminal/__openerp__.py +++ b/pos_payment_terminal/__openerp__.py @@ -46,7 +46,7 @@ project of the Odoo Community Association http://odoo-community.org/. You are invited to become a member and/or get involved in the Association ! """, - 'author': 'Aurélien DUMAINE', + 'author': "Aurélien DUMAINE,Odoo Community Association (OCA)", 'license': 'AGPL-3', 'depends': ['point_of_sale'], 'data': [ From fcdd3ed17b335440fdb9362b779bd92eb481bdf9 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 30 Apr 2015 12:52:27 +0200 Subject: [PATCH 13/51] pos_payment_terminal: Add POT file, FR translation and demo data --- pos_payment_terminal/__openerp__.py | 1 + pos_payment_terminal/i18n/fr.po | 49 +++++++++++++++++++ .../i18n/pos_payment_terminal.pot | 49 +++++++++++++++++++ .../pos_payment_terminal_demo.xml | 10 ++++ 4 files changed, 109 insertions(+) create mode 100644 pos_payment_terminal/i18n/fr.po create mode 100644 pos_payment_terminal/i18n/pos_payment_terminal.pot create mode 100644 pos_payment_terminal/pos_payment_terminal_demo.xml diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py index 1f9f2f51..cc29b533 100644 --- a/pos_payment_terminal/__openerp__.py +++ b/pos_payment_terminal/__openerp__.py @@ -53,5 +53,6 @@ Association ! 'pos_payment_terminal.xml', 'pos_payment_terminal_view.xml', ], + 'demo': ['pos_payment_terminal_demo.xml'], 'qweb': ['static/src/xml/pos_payment_terminal.xml'], } diff --git a/pos_payment_terminal/i18n/fr.po b/pos_payment_terminal/i18n/fr.po new file mode 100644 index 00000000..f247bbc6 --- /dev/null +++ b/pos_payment_terminal/i18n/fr.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_terminal +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-04-30 10:04+0000\n" +"PO-Revision-Date: 2015-04-30 10:04+0000\n" +"Last-Translator: Alexis de Lattre \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Card" +msgstr "Carte" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Check" +msgstr "Chèque" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_account_journal +msgid "Journal" +msgstr "Journal" + +#. module: pos_payment_terminal +#: field:account.journal,payment_mode:0 +msgid "Payment mode" +msgstr "Mode de paiement" + +#. module: pos_payment_terminal +#: help:account.journal,payment_mode:0 +msgid "Select the payment mode sent to the payment terminal" +msgstr "Sélectionner le mode de paiement envoyé au terminal de paiement" + +#. module: pos_payment_terminal +#. openerp-web +#: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:8 +#, python-format +msgid "Start transaction" +msgstr "Démarrer la transaction" + diff --git a/pos_payment_terminal/i18n/pos_payment_terminal.pot b/pos_payment_terminal/i18n/pos_payment_terminal.pot new file mode 100644 index 00000000..18c841e4 --- /dev/null +++ b/pos_payment_terminal/i18n/pos_payment_terminal.pot @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_terminal +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-04-30 10:03+0000\n" +"PO-Revision-Date: 2015-04-30 10:03+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Card" +msgstr "" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Check" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_account_journal +msgid "Journal" +msgstr "" + +#. module: pos_payment_terminal +#: field:account.journal,payment_mode:0 +msgid "Payment mode" +msgstr "" + +#. module: pos_payment_terminal +#: help:account.journal,payment_mode:0 +msgid "Select the payment mode sent to the payment terminal" +msgstr "" + +#. module: pos_payment_terminal +#. openerp-web +#: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:8 +#, python-format +msgid "Start transaction" +msgstr "" + diff --git a/pos_payment_terminal/pos_payment_terminal_demo.xml b/pos_payment_terminal/pos_payment_terminal_demo.xml new file mode 100644 index 00000000..edf218ae --- /dev/null +++ b/pos_payment_terminal/pos_payment_terminal_demo.xml @@ -0,0 +1,10 @@ + + + + + + check + + + + From 98225aeb8702f486d0df67da5a64a7de9bf2c1b4 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 30 Apr 2015 12:56:11 +0200 Subject: [PATCH 14/51] Better XML header --- pos_payment_terminal/pos_payment_terminal_demo.xml | 4 ++-- pos_payment_terminal/pos_payment_terminal_view.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pos_payment_terminal/pos_payment_terminal_demo.xml b/pos_payment_terminal/pos_payment_terminal_demo.xml index edf218ae..e51595b8 100644 --- a/pos_payment_terminal/pos_payment_terminal_demo.xml +++ b/pos_payment_terminal/pos_payment_terminal_demo.xml @@ -1,6 +1,6 @@ - + - + check diff --git a/pos_payment_terminal/pos_payment_terminal_view.xml b/pos_payment_terminal/pos_payment_terminal_view.xml index f04d4648..8a72bd1a 100644 --- a/pos_payment_terminal/pos_payment_terminal_view.xml +++ b/pos_payment_terminal/pos_payment_terminal_view.xml @@ -1,4 +1,4 @@ - + From 7be4cd50e2480f6169fbeaf5066c784dd28d6b3d Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sun, 17 May 2015 01:51:59 +0200 Subject: [PATCH 15/51] pos_customer_display: Add button "Display Total to Customer" and port to new API pos_payment_terminal: code cleanup --- .../static/src/js/pos_payment_terminal.js | 2 -- .../static/src/xml/pos_payment_terminal.xml | 19 +++++++------------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index f63f6f3e..250e3d99 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -11,8 +11,6 @@ openerp.pos_payment_terminal = function(instance){ }, }); - //TODO make the button bigger and with better name - var _super_PaymentScreenWidget_init_ = module.PaymentScreenWidget.prototype.init; module.PaymentScreenWidget.prototype.init = function(parent, options){ _super_PaymentScreenWidget_init_.call(this, parent, options); diff --git a/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml b/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml index ce7459c4..48ff65a6 100644 --- a/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml +++ b/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml @@ -2,16 +2,11 @@ - - - - - - - - - + + + + + + + From 3ebc6c7d80ade140a2f3dce82987cebc875d2f9d Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 9 Jun 2015 00:26:50 +0200 Subject: [PATCH 16/51] pos_payment_terminal: smiplify JS code Move description from __openerp__.py to README.rst Update demo data --- pos_payment_terminal/README.rst | 55 +++++++++++++++++++ pos_payment_terminal/__openerp__.py | 24 +------- pos_payment_terminal/pos_payment_terminal.py | 5 +- .../pos_payment_terminal_demo.xml | 4 ++ .../static/src/js/pos_payment_terminal.js | 54 +++++++----------- 5 files changed, 84 insertions(+), 58 deletions(-) create mode 100644 pos_payment_terminal/README.rst diff --git a/pos_payment_terminal/README.rst b/pos_payment_terminal/README.rst new file mode 100644 index 00000000..7dc931f6 --- /dev/null +++ b/pos_payment_terminal/README.rst @@ -0,0 +1,55 @@ +POS Payment Terminal +==================== + +This module adds support for credit card reader and checks printer +in the Point of Sale. + +This module has been developped during a POS code sprint at Akretion +France from July 7th to July 10th 2014. This module is part of the POS +project of the Odoo Community Association http://odoo-community.org/. +You are invited to become a member and/or get involved in the +Association ! + +Installation +============ + +This module is designed to be installed on the +*main Odoo server*. On the *POSbox*, you should install the module +*hw_x* depending on the protocol implemented in your device. +`Ingenico ` +and old Sagem devices support the Telium protocol implemented in the +*hw_telium_payment_terminal* module. + +Configuration +============= + +This module support two payment modes : *card* and *check*. The payment +mode should be configured on the main Odoo server, in the menu *Point +of Sale > Configuration > Payment Methods*, under the *Point of Sale* tab. + +Usage +===== + +In the frontend of the POS, when you select a payment method that has a payment mode *card* or *check*, you will have a *Start Transaction* button : if you click on that button, the amount, the currency and the payment mode will be sent to the POSbox. + +Credits +======= + +Contributors +------------ + +* Aurelien Dumaine +* Alexis de Lattre + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py index cc29b533..79327d62 100644 --- a/pos_payment_terminal/__openerp__.py +++ b/pos_payment_terminal/__openerp__.py @@ -3,6 +3,7 @@ # # POS Payment Terminal module for Odoo # Copyright (C) 2014 Aurélien DUMAINE +# Copyright (C) 2015 Akretion (www.akretion.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -25,28 +26,7 @@ 'version': '0.1', 'category': 'Point Of Sale', 'summary': 'Manage Payment Terminal device from POS front end', - 'description': """ -POS Payment Terminal -==================== - -This module adds support for credit card reader and checks printer -in the Point of Sale. This module is designed to be installed on the -*main Odoo server*. On the *POSbox*, you should install the module -*hw_x* depending on the protocol implemented in your device. Ingenico -and Sagem devices support the Telium protocol implemented in the -*hw_telium_payment_terminal* module. - -This module support two payment methods : cards and checks. The payment -method should be configured on the main Odoo server, in the menu Point -of Sale > Configuration > Payment Methods. - -This module has been developped during a POS code sprint at Akretion -France from July 7th to July 10th 2014. This module is part of the POS -project of the Odoo Community Association http://odoo-community.org/. -You are invited to become a member and/or get involved in the -Association ! - """, - 'author': "Aurélien DUMAINE,Odoo Community Association (OCA)", + 'author': "Aurélien DUMAINE,Akretion,Odoo Community Association (OCA)", 'license': 'AGPL-3', 'depends': ['point_of_sale'], 'data': [ diff --git a/pos_payment_terminal/pos_payment_terminal.py b/pos_payment_terminal/pos_payment_terminal.py index a54252ad..1d2bd4ec 100644 --- a/pos_payment_terminal/pos_payment_terminal.py +++ b/pos_payment_terminal/pos_payment_terminal.py @@ -3,6 +3,7 @@ # # POS Payment Terminal module for Odoo # Copyright (C) 2014 Aurélien DUMAINE +# Copyright (C) 2015 Akretion (www.akretion.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -22,7 +23,7 @@ from openerp import models, fields -class account_journal(models.Model): +class AccountJournal(models.Model): _inherit = 'account.journal' payment_mode = fields.Selection( @@ -30,7 +31,7 @@ class account_journal(models.Model): help="Select the payment mode sent to the payment terminal") -class pos_config(models.Model): +class PosConfig(models.Model): _inherit = 'pos.config' iface_payment_terminal = fields.Boolean( diff --git a/pos_payment_terminal/pos_payment_terminal_demo.xml b/pos_payment_terminal/pos_payment_terminal_demo.xml index e51595b8..1788dae4 100644 --- a/pos_payment_terminal/pos_payment_terminal_demo.xml +++ b/pos_payment_terminal/pos_payment_terminal_demo.xml @@ -6,5 +6,9 @@ check + + + + diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 250e3d99..39ae910f 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -1,3 +1,12 @@ +/* + POS Payment Terminal module for Odoo + Copyright (C) 2014 Aurélien DUMAINE + Copyright (C) 2014-2015 Akretion (www.akretion.com) + @author: Aurélien DUMAINE + @author: Alexis de Lattre + The licence is in the file __openerp__.py +*/ + openerp.pos_payment_terminal = function(instance){ module = instance.point_of_sale; @@ -6,43 +15,20 @@ openerp.pos_payment_terminal = function(instance){ var data = {'amount' : line.get_amount(), 'currency_iso' : currency_iso, 'payment_mode' : line.cashregister.journal.payment_mode}; -// alert(JSON.stringify(data)); this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); }, }); - var _super_PaymentScreenWidget_init_ = module.PaymentScreenWidget.prototype.init; - module.PaymentScreenWidget.prototype.init = function(parent, options){ - _super_PaymentScreenWidget_init_.call(this, parent, options); - var self = this; - this.payment_terminal_transaction_start = function(event){ - var node = this; - while (node && !node.classList.contains('paymentline')){ - node = node.parentNode; - } - if (node && !_.isEmpty(node.line) && self.pos.config.iface_payment_terminal){ - self.pos.proxy.payment_terminal_transaction_start(node.line, self.pos.currency.name); - } - event.stopPropagation(); - }; - }; - - var _super_renderPaymentline_ = module.PaymentScreenWidget.prototype.render_paymentline; - module.PaymentScreenWidget.prototype.render_paymentline = function(line){ - var el_node = _super_renderPaymentline_.call(this, line); - if (line.cashregister.journal.payment_mode && this.pos.config.iface_payment_terminal){ - if (!this.pos.currency.name){ - var self = this; - var currencies = new instance.web.Model('res.currency').query(['name']) - .filter([['id','=',this.pos.currency.id]]) - .all().then(function (currency) { - self.pos.currency.name = currency[0].name; - }); - } - el_node.querySelector('.payment-terminal-transaction-start') - .addEventListener('click', this.payment_terminal_transaction_start); - } - return el_node; - }; + module.PaymentScreenWidget.include({ + render_paymentline: function(line){ + el_node = this._super(line); + var self = this; + if (line.cashregister.journal.payment_mode && this.pos.config.iface_payment_terminal){ + el_node.querySelector('.payment-terminal-transaction-start') + .addEventListener('click', function(){self.pos.proxy.payment_terminal_transaction_start(line, self.pos.currency.name)}); + } + return el_node; + }, + }); }; From 219fbc94bda53edd701634bed7aa3a8353592fe3 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 12 Jun 2015 12:28:05 +0200 Subject: [PATCH 17/51] FIX my previous commit: sent currency to POSbox --- pos_payment_terminal/static/src/js/pos_payment_terminal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 39ae910f..2c154a62 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -25,7 +25,7 @@ openerp.pos_payment_terminal = function(instance){ var self = this; if (line.cashregister.journal.payment_mode && this.pos.config.iface_payment_terminal){ el_node.querySelector('.payment-terminal-transaction-start') - .addEventListener('click', function(){self.pos.proxy.payment_terminal_transaction_start(line, self.pos.currency.name)}); + .addEventListener('click', function(){self.pos.proxy.payment_terminal_transaction_start(line, self.pos.config.currency_id[1])}); } return el_node; }, From 1156a4c2c884820c4ce1625d48311f25888beef5 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 7 Jul 2015 00:04:04 +0200 Subject: [PATCH 18/51] [FIX] bug #36 : take advantage of the recent update in the odoo codebase to properly get the 'name' of the currency --- pos_payment_terminal/README.rst | 4 ++++ pos_payment_terminal/static/src/js/pos_payment_terminal.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pos_payment_terminal/README.rst b/pos_payment_terminal/README.rst index 7dc931f6..6c1c22da 100644 --- a/pos_payment_terminal/README.rst +++ b/pos_payment_terminal/README.rst @@ -20,6 +20,10 @@ This module is designed to be installed on the and old Sagem devices support the Telium protocol implemented in the *hw_telium_payment_terminal* module. +This module requires an up-to-date version of Odoo v8 that includes +`this pull request ` which was +merged in the *8.0* branch of Odoo on Github on July 2nd 2015. + Configuration ============= diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 2c154a62..39ae910f 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -25,7 +25,7 @@ openerp.pos_payment_terminal = function(instance){ var self = this; if (line.cashregister.journal.payment_mode && this.pos.config.iface_payment_terminal){ el_node.querySelector('.payment-terminal-transaction-start') - .addEventListener('click', function(){self.pos.proxy.payment_terminal_transaction_start(line, self.pos.config.currency_id[1])}); + .addEventListener('click', function(){self.pos.proxy.payment_terminal_transaction_start(line, self.pos.currency.name)}); } return el_node; }, From 30fca9df5050d7fded7ad42a4d96ca825f73706f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 9 Oct 2015 10:01:54 +0200 Subject: [PATCH 19/51] [UPD] prefix versions with 8.0 --- pos_payment_terminal/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py index 79327d62..361ed37c 100644 --- a/pos_payment_terminal/__openerp__.py +++ b/pos_payment_terminal/__openerp__.py @@ -23,7 +23,7 @@ { 'name': 'POS Payment Terminal', - 'version': '0.1', + 'version': '8.0.0.1.0', 'category': 'Point Of Sale', 'summary': 'Manage Payment Terminal device from POS front end', 'author': "Aurélien DUMAINE,Akretion,Odoo Community Association (OCA)", From f66490b2ca4499e84a79e1667e64ede22fa426d6 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 14 Oct 2015 02:32:34 +0200 Subject: [PATCH 20/51] [MIG] Make modules uninstallable --- pos_payment_terminal/__openerp__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__openerp__.py index 361ed37c..6538c81d 100644 --- a/pos_payment_terminal/__openerp__.py +++ b/pos_payment_terminal/__openerp__.py @@ -35,4 +35,5 @@ ], 'demo': ['pos_payment_terminal_demo.xml'], 'qweb': ['static/src/xml/pos_payment_terminal.xml'], + 'installable': False, } From 831f3c87ad493486c4a209b20cea25740b751cc5 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 16:04:41 +0200 Subject: [PATCH 21/51] [MIG] Rename manifest files --- pos_payment_terminal/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pos_payment_terminal/{__openerp__.py => __manifest__.py} (100%) diff --git a/pos_payment_terminal/__openerp__.py b/pos_payment_terminal/__manifest__.py similarity index 100% rename from pos_payment_terminal/__openerp__.py rename to pos_payment_terminal/__manifest__.py From 16e6a85f653d825c9009aca859ebc282d4f32139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20DUMAINE?= Date: Tue, 17 May 2016 03:35:29 +0200 Subject: [PATCH 22/51] begin of porting pos_payment_terminal to Odoo 9.0 --- pos_payment_terminal/__manifest__.py | 6 +- pos_payment_terminal/pos_payment_terminal.xml | 18 ---- .../pos_payment_terminal_view.xml | 2 +- .../static/src/js/pos_payment_terminal.js | 96 +++++++++++++++---- .../static/src/xml/pos_payment_terminal.xml | 13 ++- 5 files changed, 91 insertions(+), 44 deletions(-) delete mode 100644 pos_payment_terminal/pos_payment_terminal.xml diff --git a/pos_payment_terminal/__manifest__.py b/pos_payment_terminal/__manifest__.py index 6538c81d..acfd1668 100644 --- a/pos_payment_terminal/__manifest__.py +++ b/pos_payment_terminal/__manifest__.py @@ -23,17 +23,17 @@ { 'name': 'POS Payment Terminal', - 'version': '8.0.0.1.0', + 'version': '9.0.0.1.0', 'category': 'Point Of Sale', 'summary': 'Manage Payment Terminal device from POS front end', 'author': "Aurélien DUMAINE,Akretion,Odoo Community Association (OCA)", 'license': 'AGPL-3', 'depends': ['point_of_sale'], 'data': [ - 'pos_payment_terminal.xml', 'pos_payment_terminal_view.xml', + 'static/src/xml/templates.xml', ], 'demo': ['pos_payment_terminal_demo.xml'], 'qweb': ['static/src/xml/pos_payment_terminal.xml'], - 'installable': False, + 'installable': True, } diff --git a/pos_payment_terminal/pos_payment_terminal.xml b/pos_payment_terminal/pos_payment_terminal.xml deleted file mode 100644 index 6f46ad01..00000000 --- a/pos_payment_terminal/pos_payment_terminal.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - diff --git a/pos_payment_terminal/pos_payment_terminal_view.xml b/pos_payment_terminal/pos_payment_terminal_view.xml index 8a72bd1a..509ee3dc 100644 --- a/pos_payment_terminal/pos_payment_terminal_view.xml +++ b/pos_payment_terminal/pos_payment_terminal_view.xml @@ -18,7 +18,7 @@ account.journal - + diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 39ae910f..82bdc8b4 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -1,34 +1,96 @@ /* POS Payment Terminal module for Odoo - Copyright (C) 2014 Aurélien DUMAINE + Copyright (C) 2014-2016 Aurélien DUMAINE Copyright (C) 2014-2015 Akretion (www.akretion.com) @author: Aurélien DUMAINE @author: Alexis de Lattre The licence is in the file __openerp__.py */ -openerp.pos_payment_terminal = function(instance){ - module = instance.point_of_sale; +odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { + "use strict"; + + var screens = require('point_of_sale.screens'); + var devices = require('point_of_sale.devices'); + var models = require('point_of_sale.models'); +// var gui = require('point_of_sale.gui'); + var core = require('web.core'); + var _t = core._t; + var QWeb = core.qweb; + +/* + //TODO : surcharger models.exports.PosModel.load_server_data pour récupérer le champ 'payement_mode' des journaux + var _r_ = models.exports.PosModel.prototype.load_server_data; + models.exports.PosModel.prototype.load_server_data = function(){ + var self = this; + for (var i = 0; i < self.models.length; i++){ + if (self.models[i].model== 'account.journal'){ + self.models[i].fields.push('payment_mode'); + } + } + _r_.call(this); + }); +*/ + devices.ProxyDevice.include({ + payment_terminal_transaction_start: function(line_cid, currency_iso){ + var lines = this.pos.get_order().get_paymentlines(); + var line; + for ( var i = 0; i < lines.length; i++ ) { + if (lines[i].cid === line_cid) { + line = lines[i]; + } + } - module.ProxyDevice = module.ProxyDevice.extend({ - payment_terminal_transaction_start: function(line, currency_iso){ var data = {'amount' : line.get_amount(), 'currency_iso' : currency_iso, 'payment_mode' : line.cashregister.journal.payment_mode}; +alert(JSON.stringify(data)); this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); }, }); - module.PaymentScreenWidget.include({ - render_paymentline: function(line){ - el_node = this._super(line); - var self = this; - if (line.cashregister.journal.payment_mode && this.pos.config.iface_payment_terminal){ - el_node.querySelector('.payment-terminal-transaction-start') - .addEventListener('click', function(){self.pos.proxy.payment_terminal_transaction_start(line, self.pos.currency.name)}); - } - return el_node; - }, - }); -}; +// TODO : overload instead of redefine +// var _render_paymentlines_ = screens.PaymentScreenWidget.prototype.render_paymentlines; + screens.PaymentScreenWidget.prototype.render_paymentlines = function(){ +// _render_paymentlines_.call(this); + var self = this; + var order = this.pos.get_order(); + if (!order) { + return; + } + + var lines = order.get_paymentlines(); + var due = order.get_due(); + var extradue = 0; + if (due && lines.length && due !== order.get_due(lines[lines.length-1])) { + extradue = due; + } + + + this.$('.paymentlines-container').empty(); + var lines = $(QWeb.render('PaymentScreen-Paymentlines', { + widget: this, + order: order, + paymentlines: lines, + extradue: extradue, + })); + + lines.on('click','.delete-button',function(){ + self.click_delete_paymentline($(this).data('cid')); + }); + + lines.on('click','.paymentline',function(){ + self.click_paymentline($(this).data('cid')); + }); + + lines.on('click','.payment-terminal-transaction-start',function(){ + self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name); + }); + + + lines.appendTo(this.$('.paymentlines-container')); + //if (line.cashregister.journal.payment_mode && this.pos.config.iface_payment_terminal){ + + }; +}); diff --git a/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml b/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml index 48ff65a6..2d5aa824 100644 --- a/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml +++ b/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml @@ -1,11 +1,14 @@ - - + + + - - - + From 26869337e762889b14f48f07604bcdad241eff1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20DUMAINE?= Date: Tue, 17 May 2016 05:31:45 +0200 Subject: [PATCH 23/51] overload render_paymentlines --- .../static/src/js/pos_payment_terminal.js | 38 +++++++++---------- .../static/src/xml/pos_payment_terminal.xml | 7 +--- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 82bdc8b4..ff81aa82 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -18,23 +18,12 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { var _t = core._t; var QWeb = core.qweb; -/* - //TODO : surcharger models.exports.PosModel.load_server_data pour récupérer le champ 'payement_mode' des journaux - var _r_ = models.exports.PosModel.prototype.load_server_data; - models.exports.PosModel.prototype.load_server_data = function(){ - var self = this; - for (var i = 0; i < self.models.length; i++){ - if (self.models[i].model== 'account.journal'){ - self.models[i].fields.push('payment_mode'); - } - } - _r_.call(this); - }); -*/ + models.load_fields("account.journal",['payment_mode']); + devices.ProxyDevice.include({ payment_terminal_transaction_start: function(line_cid, currency_iso){ - var lines = this.pos.get_order().get_paymentlines(); var line; + var lines = this.pos.get_order().get_paymentlines(); for ( var i = 0; i < lines.length; i++ ) { if (lines[i].cid === line_cid) { line = lines[i]; @@ -44,16 +33,23 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { var data = {'amount' : line.get_amount(), 'currency_iso' : currency_iso, 'payment_mode' : line.cashregister.journal.payment_mode}; -alert(JSON.stringify(data)); +//alert(JSON.stringify(data)); this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); }, }); // TODO : overload instead of redefine -// var _render_paymentlines_ = screens.PaymentScreenWidget.prototype.render_paymentlines; - screens.PaymentScreenWidget.prototype.render_paymentlines = function(){ -// _render_paymentlines_.call(this); +// BUG : its works fine when redefine but calls 5 times the function is overload + screens.PaymentScreenWidget.include({ + render_paymentlines : function(){ + this._super.apply(this, arguments); + var self = this; + this.$('.paymentlines-container').on('click','.payment-terminal-transaction-start',function(){ + self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name); + }); + +/* var self = this; var order = this.pos.get_order(); if (!order) { @@ -88,9 +84,9 @@ alert(JSON.stringify(data)); self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name); }); - lines.appendTo(this.$('.paymentlines-container')); - //if (line.cashregister.journal.payment_mode && this.pos.config.iface_payment_terminal){ +*/ + }, - }; + }); }); diff --git a/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml b/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml index 2d5aa824..b0b197bd 100644 --- a/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml +++ b/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml @@ -2,12 +2,7 @@ - - + From 964600afa814e9e00bb71868562a319582986edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20DUMAINE?= Date: Sat, 21 May 2016 17:19:34 +0200 Subject: [PATCH 24/51] FIX : multiple calls to action on 'start transaction' click event --- .../static/src/css/pos_payment_terminal.css | 2 +- .../static/src/js/pos_payment_terminal.js | 59 ++++--------------- 2 files changed, 12 insertions(+), 49 deletions(-) diff --git a/pos_payment_terminal/static/src/css/pos_payment_terminal.css b/pos_payment_terminal/static/src/css/pos_payment_terminal.css index bfec68ef..d3f4284c 100644 --- a/pos_payment_terminal/static/src/css/pos_payment_terminal.css +++ b/pos_payment_terminal/static/src/css/pos_payment_terminal.css @@ -1,4 +1,4 @@ -.pos .payment-terminal-transaction-start button { +.payment-terminal-transaction-start button { width: 150px; height: 60px; font-size: 18px; diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index ff81aa82..7cae07fb 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -33,60 +33,23 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { var data = {'amount' : line.get_amount(), 'currency_iso' : currency_iso, 'payment_mode' : line.cashregister.journal.payment_mode}; -//alert(JSON.stringify(data)); + //console.log(JSON.stringify(data)); this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); }, }); -// TODO : overload instead of redefine -// BUG : its works fine when redefine but calls 5 times the function is overload screens.PaymentScreenWidget.include({ - render_paymentlines : function(){ - this._super.apply(this, arguments); - var self = this; - this.$('.paymentlines-container').on('click','.payment-terminal-transaction-start',function(){ - self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name); - }); - -/* - var self = this; - var order = this.pos.get_order(); - if (!order) { - return; - } - - var lines = order.get_paymentlines(); - var due = order.get_due(); - var extradue = 0; - if (due && lines.length && due !== order.get_due(lines[lines.length-1])) { - extradue = due; - } - - - this.$('.paymentlines-container').empty(); - var lines = $(QWeb.render('PaymentScreen-Paymentlines', { - widget: this, - order: order, - paymentlines: lines, - extradue: extradue, - })); - - lines.on('click','.delete-button',function(){ - self.click_delete_paymentline($(this).data('cid')); - }); - - lines.on('click','.paymentline',function(){ - self.click_paymentline($(this).data('cid')); - }); - - lines.on('click','.payment-terminal-transaction-start',function(){ - self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name); - }); - - lines.appendTo(this.$('.paymentlines-container')); -*/ - }, + render_paymentlines : function(){ + this._super.apply(this, arguments); + var self = this; + this.$('.paymentlines-container').unbind('click').on('click','.payment-terminal-transaction-start',function(event){ + // Why this "on" thing links severaltime the button to the action if I don't use "unlink" to reset the button links before ? + //console.log(event.target); + self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name); + }); + + }, }); }); From 396ef9a3303345ec1f028809a04137d2c10d75d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20DUMAINE?= Date: Sun, 10 Jul 2016 21:08:52 +0200 Subject: [PATCH 25/51] Add static/src/xml/templates.xml --- pos_payment_terminal/static/src/xml/templates.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pos_payment_terminal/static/src/xml/templates.xml diff --git a/pos_payment_terminal/static/src/xml/templates.xml b/pos_payment_terminal/static/src/xml/templates.xml new file mode 100644 index 00000000..01939637 --- /dev/null +++ b/pos_payment_terminal/static/src/xml/templates.xml @@ -0,0 +1,13 @@ + + + + + + + + From 42d415406dd0c96c5236310a84c491d4ac6d614c Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 10 Oct 2016 21:14:04 +0200 Subject: [PATCH 26/51] FIX crash on demo data --- pos_payment_terminal/pos_payment_terminal_demo.xml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pos_payment_terminal/pos_payment_terminal_demo.xml b/pos_payment_terminal/pos_payment_terminal_demo.xml index 1788dae4..fb3dbd39 100644 --- a/pos_payment_terminal/pos_payment_terminal_demo.xml +++ b/pos_payment_terminal/pos_payment_terminal_demo.xml @@ -1,14 +1,8 @@ - - - - - check - + - - + From 342f831a64584192fa518c34e466753461d4ce15 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 10 Oct 2016 22:50:58 +0200 Subject: [PATCH 27/51] Port pos_payment_terminal to v10 --- pos_payment_terminal/README.rst | 31 +++++++++++---- pos_payment_terminal/__init__.py | 4 +- pos_payment_terminal/__manifest__.py | 33 ++++------------ .../{ => demo}/pos_payment_terminal_demo.xml | 0 pos_payment_terminal/models/__init__.py | 4 ++ .../models/account_journal.py | 15 +++++++ pos_payment_terminal/models/pos_config.py | 15 +++++++ pos_payment_terminal/pos_payment_terminal.py | 39 ------------------- .../pos_payment_terminal_view.xml | 28 ------------- .../static/src/js/pos_payment_terminal.js | 25 ++++++------ .../static/src/xml/templates.xml | 13 ------- .../views/account_journal.xml | 15 +++++++ pos_payment_terminal/views/pos_config.xml | 15 +++++++ .../views/pos_payment_terminal_template.xml | 11 ++++++ 14 files changed, 120 insertions(+), 128 deletions(-) rename pos_payment_terminal/{ => demo}/pos_payment_terminal_demo.xml (100%) create mode 100644 pos_payment_terminal/models/__init__.py create mode 100644 pos_payment_terminal/models/account_journal.py create mode 100644 pos_payment_terminal/models/pos_config.py delete mode 100644 pos_payment_terminal/pos_payment_terminal.py delete mode 100644 pos_payment_terminal/pos_payment_terminal_view.xml delete mode 100644 pos_payment_terminal/static/src/xml/templates.xml create mode 100644 pos_payment_terminal/views/account_journal.xml create mode 100644 pos_payment_terminal/views/pos_config.xml create mode 100644 pos_payment_terminal/views/pos_payment_terminal_template.xml diff --git a/pos_payment_terminal/README.rst b/pos_payment_terminal/README.rst index 6c1c22da..b8139ea0 100644 --- a/pos_payment_terminal/README.rst +++ b/pos_payment_terminal/README.rst @@ -1,3 +1,8 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +==================== POS Payment Terminal ==================== @@ -20,10 +25,6 @@ This module is designed to be installed on the and old Sagem devices support the Telium protocol implemented in the *hw_telium_payment_terminal* module. -This module requires an up-to-date version of Odoo v8 that includes -`this pull request ` which was -merged in the *8.0* branch of Odoo on Github on July 2nd 2015. - Configuration ============= @@ -36,6 +37,18 @@ Usage In the frontend of the POS, when you select a payment method that has a payment mode *card* or *check*, you will have a *Start Transaction* button : if you click on that button, the amount, the currency and the payment mode will be sent to the POSbox. +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/184/10.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + Credits ======= @@ -48,12 +61,14 @@ Contributors Maintainer ---------- -.. image:: http://odoo-community.org/logo.png +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. diff --git a/pos_payment_terminal/__init__.py b/pos_payment_terminal/__init__.py index 9e67b3d9..cde864ba 100644 --- a/pos_payment_terminal/__init__.py +++ b/pos_payment_terminal/__init__.py @@ -1 +1,3 @@ -from . import pos_payment_terminal +# -*- coding: utf-8 -*- + +from . import models diff --git a/pos_payment_terminal/__manifest__.py b/pos_payment_terminal/__manifest__.py index acfd1668..850a8e84 100644 --- a/pos_payment_terminal/__manifest__.py +++ b/pos_payment_terminal/__manifest__.py @@ -1,39 +1,22 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# POS Payment Terminal module for Odoo -# Copyright (C) 2014 Aurélien DUMAINE -# Copyright (C) 2015 Akretion (www.akretion.com) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - +# © 2014-2016 Aurélien DUMAINE +# © 2015-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'POS Payment Terminal', - 'version': '9.0.0.1.0', + 'version': '10.0.0.1.0', 'category': 'Point Of Sale', 'summary': 'Manage Payment Terminal device from POS front end', 'author': "Aurélien DUMAINE,Akretion,Odoo Community Association (OCA)", 'license': 'AGPL-3', 'depends': ['point_of_sale'], 'data': [ - 'pos_payment_terminal_view.xml', - 'static/src/xml/templates.xml', + 'views/pos_config.xml', + 'views/account_journal.xml', + 'views/pos_payment_terminal_template.xml', ], - 'demo': ['pos_payment_terminal_demo.xml'], + 'demo': ['demo/pos_payment_terminal_demo.xml'], 'qweb': ['static/src/xml/pos_payment_terminal.xml'], 'installable': True, } diff --git a/pos_payment_terminal/pos_payment_terminal_demo.xml b/pos_payment_terminal/demo/pos_payment_terminal_demo.xml similarity index 100% rename from pos_payment_terminal/pos_payment_terminal_demo.xml rename to pos_payment_terminal/demo/pos_payment_terminal_demo.xml diff --git a/pos_payment_terminal/models/__init__.py b/pos_payment_terminal/models/__init__.py new file mode 100644 index 00000000..3b0e3a1a --- /dev/null +++ b/pos_payment_terminal/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import pos_config +from . import account_journal diff --git a/pos_payment_terminal/models/account_journal.py b/pos_payment_terminal/models/account_journal.py new file mode 100644 index 00000000..6f7c9678 --- /dev/null +++ b/pos_payment_terminal/models/account_journal.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# © 2014-2016 Aurélien DUMAINE +# © 2015-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import models, fields + + +class AccountJournal(models.Model): + _inherit = 'account.journal' + + payment_mode = fields.Selection( + [('card', 'Card'), ('check', 'Check')], 'Payment Mode', + help="Select the payment mode sent to the payment terminal") diff --git a/pos_payment_terminal/models/pos_config.py b/pos_payment_terminal/models/pos_config.py new file mode 100644 index 00000000..2d7da41a --- /dev/null +++ b/pos_payment_terminal/models/pos_config.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# © 2014-2016 Aurélien DUMAINE +# © 2015-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import models, fields + + +class PosConfig(models.Model): + _inherit = 'pos.config' + + iface_payment_terminal = fields.Boolean( + 'Payment Terminal', + help="A payment terminal is available on the Proxy") diff --git a/pos_payment_terminal/pos_payment_terminal.py b/pos_payment_terminal/pos_payment_terminal.py deleted file mode 100644 index 1d2bd4ec..00000000 --- a/pos_payment_terminal/pos_payment_terminal.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# POS Payment Terminal module for Odoo -# Copyright (C) 2014 Aurélien DUMAINE -# Copyright (C) 2015 Akretion (www.akretion.com) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp import models, fields - - -class AccountJournal(models.Model): - _inherit = 'account.journal' - - payment_mode = fields.Selection( - (('card', 'Card'), ('check', 'Check')), 'Payment mode', - help="Select the payment mode sent to the payment terminal") - - -class PosConfig(models.Model): - _inherit = 'pos.config' - - iface_payment_terminal = fields.Boolean( - 'Payment Terminal', - help="A payment terminal is available on the Proxy") diff --git a/pos_payment_terminal/pos_payment_terminal_view.xml b/pos_payment_terminal/pos_payment_terminal_view.xml deleted file mode 100644 index 509ee3dc..00000000 --- a/pos_payment_terminal/pos_payment_terminal_view.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - pos.payment.terminal.config.form - pos.config - - - - - - - - - - pos.payment.terminal.journal.form - account.journal - - - - - - - - - - diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 7cae07fb..984d09b3 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -1,10 +1,10 @@ /* POS Payment Terminal module for Odoo Copyright (C) 2014-2016 Aurélien DUMAINE - Copyright (C) 2014-2015 Akretion (www.akretion.com) + Copyright (C) 2014-2016 Akretion (www.akretion.com) @author: Aurélien DUMAINE @author: Alexis de Lattre - The licence is in the file __openerp__.py + License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { @@ -13,12 +13,11 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { var screens = require('point_of_sale.screens'); var devices = require('point_of_sale.devices'); var models = require('point_of_sale.models'); -// var gui = require('point_of_sale.gui'); var core = require('web.core'); var _t = core._t; var QWeb = core.qweb; - models.load_fields("account.journal",['payment_mode']); + models.load_fields('account.journal', ['payment_mode']); devices.ProxyDevice.include({ payment_terminal_transaction_start: function(line_cid, currency_iso){ @@ -40,16 +39,14 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { screens.PaymentScreenWidget.include({ - render_paymentlines : function(){ - this._super.apply(this, arguments); - var self = this; - this.$('.paymentlines-container').unbind('click').on('click','.payment-terminal-transaction-start',function(event){ + render_paymentlines : function(){ + this._super.apply(this, arguments); + var self = this; + this.$('.paymentlines-container').unbind('click').on('click', '.payment-terminal-transaction-start', function(event){ // Why this "on" thing links severaltime the button to the action if I don't use "unlink" to reset the button links before ? - //console.log(event.target); - self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name); - }); - - }, - + //console.log(event.target); + self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name); + }); + }, }); }); diff --git a/pos_payment_terminal/static/src/xml/templates.xml b/pos_payment_terminal/static/src/xml/templates.xml deleted file mode 100644 index 01939637..00000000 --- a/pos_payment_terminal/static/src/xml/templates.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/pos_payment_terminal/views/account_journal.xml b/pos_payment_terminal/views/account_journal.xml new file mode 100644 index 00000000..0e62aa9f --- /dev/null +++ b/pos_payment_terminal/views/account_journal.xml @@ -0,0 +1,15 @@ + + + + + pos.payment.terminal.journal.form + account.journal + + + + + + + + + diff --git a/pos_payment_terminal/views/pos_config.xml b/pos_payment_terminal/views/pos_config.xml new file mode 100644 index 00000000..6339b396 --- /dev/null +++ b/pos_payment_terminal/views/pos_config.xml @@ -0,0 +1,15 @@ + + + + + pos.payment.terminal.config.form + pos.config + + + + + + + + + diff --git a/pos_payment_terminal/views/pos_payment_terminal_template.xml b/pos_payment_terminal/views/pos_payment_terminal_template.xml new file mode 100644 index 00000000..976acc2d --- /dev/null +++ b/pos_payment_terminal/views/pos_payment_terminal_template.xml @@ -0,0 +1,11 @@ + + + + + + From cf89cb871f9b5d934617be50aecb8c4a9ff36aa7 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Fri, 16 Dec 2016 22:17:30 -0500 Subject: [PATCH 28/51] OCA Transbot updated translations from Transifex --- pos_payment_terminal/i18n/fr.po | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/pos_payment_terminal/i18n/fr.po b/pos_payment_terminal/i18n/fr.po index f247bbc6..10cd970c 100644 --- a/pos_payment_terminal/i18n/fr.po +++ b/pos_payment_terminal/i18n/fr.po @@ -1,19 +1,22 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * pos_payment_terminal -# +# * pos_payment_terminal +# +# Translators: +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-04-30 10:04+0000\n" -"PO-Revision-Date: 2015-04-30 10:04+0000\n" -"Last-Translator: Alexis de Lattre \n" -"Language-Team: \n" +"POT-Creation-Date: 2016-12-13 19:51+0000\n" +"PO-Revision-Date: 2016-12-13 19:51+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: pos_payment_terminal #: selection:account.journal,payment_mode:0 @@ -31,19 +34,23 @@ msgid "Journal" msgstr "Journal" #. module: pos_payment_terminal -#: field:account.journal,payment_mode:0 -msgid "Payment mode" -msgstr "Mode de paiement" +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode +msgid "Payment Mode" +msgstr "" #. module: pos_payment_terminal -#: help:account.journal,payment_mode:0 +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode msgid "Select the payment mode sent to the payment terminal" msgstr "Sélectionner le mode de paiement envoyé au terminal de paiement" #. module: pos_payment_terminal #. openerp-web -#: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:8 +#: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:6 #, python-format msgid "Start transaction" msgstr "Démarrer la transaction" +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_pos_config +msgid "pos.config" +msgstr "" From e5233328581cdb90ae55c48f0e4ee86267c87fc2 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Fri, 6 Jan 2017 23:26:42 -0500 Subject: [PATCH 29/51] OCA Transbot updated translations from Transifex --- pos_payment_terminal/i18n/fr.po | 5 +-- pos_payment_terminal/i18n/hr_HR.po | 56 ++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 pos_payment_terminal/i18n/hr_HR.po diff --git a/pos_payment_terminal/i18n/fr.po b/pos_payment_terminal/i18n/fr.po index 10cd970c..31a75bb9 100644 --- a/pos_payment_terminal/i18n/fr.po +++ b/pos_payment_terminal/i18n/fr.po @@ -4,13 +4,14 @@ # # Translators: # OCA Transbot , 2016 +# leemannd , 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-12-13 19:51+0000\n" "PO-Revision-Date: 2016-12-13 19:51+0000\n" -"Last-Translator: OCA Transbot , 2016\n" +"Last-Translator: leemannd , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -36,7 +37,7 @@ msgstr "Journal" #. module: pos_payment_terminal #: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode msgid "Payment Mode" -msgstr "" +msgstr "Moyen de paiement" #. module: pos_payment_terminal #: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode diff --git a/pos_payment_terminal/i18n/hr_HR.po b/pos_payment_terminal/i18n/hr_HR.po new file mode 100644 index 00000000..471ebd45 --- /dev/null +++ b/pos_payment_terminal/i18n/hr_HR.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_terminal +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-12-13 19:51+0000\n" +"PO-Revision-Date: 2016-12-13 19:51+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr_HR\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Card" +msgstr "Kartica" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Check" +msgstr "Ček" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_account_journal +msgid "Journal" +msgstr "Dnevnik" + +#. module: pos_payment_terminal +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode +msgid "Payment Mode" +msgstr "Način plaćanja" + +#. module: pos_payment_terminal +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode +msgid "Select the payment mode sent to the payment terminal" +msgstr "Odaberite način plaćanja korišten na naplatnom terminalu" + +#. module: pos_payment_terminal +#. openerp-web +#: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:6 +#, python-format +msgid "Start transaction" +msgstr "Započni transakciju" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_pos_config +msgid "pos.config" +msgstr "pos.config" From 72c0e4aaedf5a4883f87b2bc12e4f71263e6058f Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 10 Jun 2017 07:30:45 +0200 Subject: [PATCH 30/51] OCA Transbot updated translations from Transifex --- pos_payment_terminal/i18n/nl_NL.po | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pos_payment_terminal/i18n/nl_NL.po diff --git a/pos_payment_terminal/i18n/nl_NL.po b/pos_payment_terminal/i18n/nl_NL.po new file mode 100644 index 00000000..b919656f --- /dev/null +++ b/pos_payment_terminal/i18n/nl_NL.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_terminal +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-30 02:44+0000\n" +"PO-Revision-Date: 2017-05-30 02:44+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl_NL\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Card" +msgstr "" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Check" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_account_journal +msgid "Journal" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode +msgid "Payment Mode" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode +msgid "Select the payment mode sent to the payment terminal" +msgstr "" + +#. module: pos_payment_terminal +#. openerp-web +#: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:6 +#, python-format +msgid "Start transaction" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_pos_config +msgid "pos.config" +msgstr "pos.config" From c5caf6ce0c4e4a5882f3fd98bb9122a2d92a6af0 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 15 Jul 2017 07:34:25 +0200 Subject: [PATCH 31/51] OCA Transbot updated translations from Transifex --- pos_payment_terminal/i18n/es.po | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pos_payment_terminal/i18n/es.po diff --git a/pos_payment_terminal/i18n/es.po b/pos_payment_terminal/i18n/es.po new file mode 100644 index 00000000..e9e52c29 --- /dev/null +++ b/pos_payment_terminal/i18n/es.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_terminal +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-12 02:44+0000\n" +"PO-Revision-Date: 2017-07-12 02:44+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Card" +msgstr "" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Check" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_account_journal +msgid "Journal" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode +msgid "Payment Mode" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode +msgid "Select the payment mode sent to the payment terminal" +msgstr "" + +#. module: pos_payment_terminal +#. openerp-web +#: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:6 +#, python-format +msgid "Start transaction" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_pos_config +msgid "pos.config" +msgstr "Configuración del TPV" From 99c2df8a7fe25967c84a64683ee8c6111743e8f1 Mon Sep 17 00:00:00 2001 From: Invitu Date: Fri, 9 Feb 2018 07:26:50 -1000 Subject: [PATCH 32/51] [FIX] fixes currencies with decimals <>2 --- pos_payment_terminal/static/src/js/pos_payment_terminal.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 984d09b3..ba99956a 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -20,7 +20,7 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { models.load_fields('account.journal', ['payment_mode']); devices.ProxyDevice.include({ - payment_terminal_transaction_start: function(line_cid, currency_iso){ + payment_terminal_transaction_start: function(line_cid, currency_iso, currency_decimals){ var line; var lines = this.pos.get_order().get_paymentlines(); for ( var i = 0; i < lines.length; i++ ) { @@ -31,6 +31,7 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { var data = {'amount' : line.get_amount(), 'currency_iso' : currency_iso, + 'currency_decimals' : currency_decimals, 'payment_mode' : line.cashregister.journal.payment_mode}; //console.log(JSON.stringify(data)); this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); @@ -45,7 +46,7 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { this.$('.paymentlines-container').unbind('click').on('click', '.payment-terminal-transaction-start', function(event){ // Why this "on" thing links severaltime the button to the action if I don't use "unlink" to reset the button links before ? //console.log(event.target); - self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name); + self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name, self.pos.currency.decimals); }); }, }); From c082ab64ea12a72c15e248f796d30fccb93224e3 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 3 Mar 2018 09:42:07 +0100 Subject: [PATCH 33/51] OCA Transbot updated translations from Transifex --- pos_payment_terminal/i18n/es.po | 19 +++++------ pos_payment_terminal/i18n/fr.po | 8 ++--- pos_payment_terminal/i18n/it.po | 56 +++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 13 deletions(-) create mode 100644 pos_payment_terminal/i18n/it.po diff --git a/pos_payment_terminal/i18n/es.po b/pos_payment_terminal/i18n/es.po index e9e52c29..9c518cfe 100644 --- a/pos_payment_terminal/i18n/es.po +++ b/pos_payment_terminal/i18n/es.po @@ -4,13 +4,14 @@ # # Translators: # OCA Transbot , 2017 +# enjolras , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-12 02:44+0000\n" -"PO-Revision-Date: 2017-07-12 02:44+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-03-01 02:01+0000\n" +"PO-Revision-Date: 2018-03-01 02:01+0000\n" +"Last-Translator: enjolras , 2018\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,34 +22,34 @@ msgstr "" #. module: pos_payment_terminal #: selection:account.journal,payment_mode:0 msgid "Card" -msgstr "" +msgstr "Tarjeta" #. module: pos_payment_terminal #: selection:account.journal,payment_mode:0 msgid "Check" -msgstr "" +msgstr "Talón" #. module: pos_payment_terminal #: model:ir.model,name:pos_payment_terminal.model_account_journal msgid "Journal" -msgstr "" +msgstr "Diario" #. module: pos_payment_terminal #: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode msgid "Payment Mode" -msgstr "" +msgstr "Forma de pago" #. module: pos_payment_terminal #: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode msgid "Select the payment mode sent to the payment terminal" -msgstr "" +msgstr "Seleccione la forma de pega enviada al terminal de pago" #. module: pos_payment_terminal #. openerp-web #: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:6 #, python-format msgid "Start transaction" -msgstr "" +msgstr "Iniciar transacción" #. module: pos_payment_terminal #: model:ir.model,name:pos_payment_terminal.model_pos_config diff --git a/pos_payment_terminal/i18n/fr.po b/pos_payment_terminal/i18n/fr.po index 31a75bb9..11ab64d8 100644 --- a/pos_payment_terminal/i18n/fr.po +++ b/pos_payment_terminal/i18n/fr.po @@ -3,14 +3,14 @@ # * pos_payment_terminal # # Translators: -# OCA Transbot , 2016 +# OCA Transbot , 2017 # leemannd , 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-12-13 19:51+0000\n" -"PO-Revision-Date: 2016-12-13 19:51+0000\n" +"POT-Creation-Date: 2018-03-01 02:01+0000\n" +"PO-Revision-Date: 2018-03-01 02:01+0000\n" "Last-Translator: leemannd , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" @@ -54,4 +54,4 @@ msgstr "Démarrer la transaction" #. module: pos_payment_terminal #: model:ir.model,name:pos_payment_terminal.model_pos_config msgid "pos.config" -msgstr "" +msgstr "pos.config" diff --git a/pos_payment_terminal/i18n/it.po b/pos_payment_terminal/i18n/it.po new file mode 100644 index 00000000..8792ffc9 --- /dev/null +++ b/pos_payment_terminal/i18n/it.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_terminal +# +# Translators: +# Francesco Fresta , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-01 02:01+0000\n" +"PO-Revision-Date: 2018-03-01 02:01+0000\n" +"Last-Translator: Francesco Fresta , 2018\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Card" +msgstr "" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Check" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_account_journal +msgid "Journal" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode +msgid "Payment Mode" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode +msgid "Select the payment mode sent to the payment terminal" +msgstr "" + +#. module: pos_payment_terminal +#. openerp-web +#: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:6 +#, python-format +msgid "Start transaction" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_pos_config +msgid "pos.config" +msgstr "pos.config" From e2838e41c9a48f59359aefb609ca24e1c05e16c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Fri, 15 Jun 2018 23:33:59 +0200 Subject: [PATCH 34/51] remove obsolete .pot files [ci skip] --- .../i18n/pos_payment_terminal.pot | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 pos_payment_terminal/i18n/pos_payment_terminal.pot diff --git a/pos_payment_terminal/i18n/pos_payment_terminal.pot b/pos_payment_terminal/i18n/pos_payment_terminal.pot deleted file mode 100644 index 18c841e4..00000000 --- a/pos_payment_terminal/i18n/pos_payment_terminal.pot +++ /dev/null @@ -1,49 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * pos_payment_terminal -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-04-30 10:03+0000\n" -"PO-Revision-Date: 2015-04-30 10:03+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 -msgid "Card" -msgstr "" - -#. module: pos_payment_terminal -#: selection:account.journal,payment_mode:0 -msgid "Check" -msgstr "" - -#. module: pos_payment_terminal -#: model:ir.model,name:pos_payment_terminal.model_account_journal -msgid "Journal" -msgstr "" - -#. module: pos_payment_terminal -#: field:account.journal,payment_mode:0 -msgid "Payment mode" -msgstr "" - -#. module: pos_payment_terminal -#: help:account.journal,payment_mode:0 -msgid "Select the payment mode sent to the payment terminal" -msgstr "" - -#. module: pos_payment_terminal -#. openerp-web -#: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:8 -#, python-format -msgid "Start transaction" -msgstr "" - From d3df8f845e33e891cd8322ee4620b0659a15e87d Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 22 Jun 2018 16:06:03 +0000 Subject: [PATCH 35/51] [UPD] Update pos_payment_terminal.pot --- pos_payment_terminal/i18n/es.po | 4 +- pos_payment_terminal/i18n/fr.po | 4 +- pos_payment_terminal/i18n/hr_HR.po | 10 ++-- pos_payment_terminal/i18n/it.po | 4 +- pos_payment_terminal/i18n/nl_NL.po | 7 +-- .../i18n/pos_payment_terminal.pot | 52 +++++++++++++++++++ 6 files changed, 68 insertions(+), 13 deletions(-) create mode 100644 pos_payment_terminal/i18n/pos_payment_terminal.pot diff --git a/pos_payment_terminal/i18n/es.po b/pos_payment_terminal/i18n/es.po index 9c518cfe..1f2a1ec7 100644 --- a/pos_payment_terminal/i18n/es.po +++ b/pos_payment_terminal/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * pos_payment_terminal -# +# # Translators: # OCA Transbot , 2017 # enjolras , 2018 @@ -13,10 +13,10 @@ msgstr "" "PO-Revision-Date: 2018-03-01 02:01+0000\n" "Last-Translator: enjolras , 2018\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: pos_payment_terminal diff --git a/pos_payment_terminal/i18n/fr.po b/pos_payment_terminal/i18n/fr.po index 11ab64d8..1f814fc1 100644 --- a/pos_payment_terminal/i18n/fr.po +++ b/pos_payment_terminal/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * pos_payment_terminal -# +# # Translators: # OCA Transbot , 2017 # leemannd , 2017 @@ -13,10 +13,10 @@ msgstr "" "PO-Revision-Date: 2018-03-01 02:01+0000\n" "Last-Translator: leemannd , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: pos_payment_terminal diff --git a/pos_payment_terminal/i18n/hr_HR.po b/pos_payment_terminal/i18n/hr_HR.po index 471ebd45..aa8f3348 100644 --- a/pos_payment_terminal/i18n/hr_HR.po +++ b/pos_payment_terminal/i18n/hr_HR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * pos_payment_terminal -# +# # Translators: # Bole , 2017 msgid "" @@ -11,12 +11,14 @@ msgstr "" "POT-Creation-Date: 2016-12-13 19:51+0000\n" "PO-Revision-Date: 2016-12-13 19:51+0000\n" "Last-Translator: Bole , 2017\n" -"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/" +"hr_HR/)\n" +"Language: hr_HR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr_HR\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: pos_payment_terminal #: selection:account.journal,payment_mode:0 diff --git a/pos_payment_terminal/i18n/it.po b/pos_payment_terminal/i18n/it.po index 8792ffc9..db1d4f75 100644 --- a/pos_payment_terminal/i18n/it.po +++ b/pos_payment_terminal/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * pos_payment_terminal -# +# # Translators: # Francesco Fresta , 2018 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2018-03-01 02:01+0000\n" "Last-Translator: Francesco Fresta , 2018\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: pos_payment_terminal diff --git a/pos_payment_terminal/i18n/nl_NL.po b/pos_payment_terminal/i18n/nl_NL.po index b919656f..9d417f99 100644 --- a/pos_payment_terminal/i18n/nl_NL.po +++ b/pos_payment_terminal/i18n/nl_NL.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * pos_payment_terminal -# +# # Translators: # Peter Hageman , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-05-30 02:44+0000\n" "PO-Revision-Date: 2017-05-30 02:44+0000\n" "Last-Translator: Peter Hageman , 2017\n" -"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: pos_payment_terminal diff --git a/pos_payment_terminal/i18n/pos_payment_terminal.pot b/pos_payment_terminal/i18n/pos_payment_terminal.pot new file mode 100644 index 00000000..c5443309 --- /dev/null +++ b/pos_payment_terminal/i18n/pos_payment_terminal.pot @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_payment_terminal +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Card" +msgstr "" + +#. module: pos_payment_terminal +#: selection:account.journal,payment_mode:0 +msgid "Check" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_account_journal +msgid "Journal" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model.fields,field_description:pos_payment_terminal.field_account_journal_payment_mode +msgid "Payment Mode" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model.fields,help:pos_payment_terminal.field_account_journal_payment_mode +msgid "Select the payment mode sent to the payment terminal" +msgstr "" + +#. module: pos_payment_terminal +#. openerp-web +#: code:addons/pos_payment_terminal/static/src/xml/pos_payment_terminal.xml:6 +#, python-format +msgid "Start transaction" +msgstr "" + +#. module: pos_payment_terminal +#: model:ir.model,name:pos_payment_terminal.model_pos_config +msgid "pos.config" +msgstr "" + From 49b8f9040a5fcc41004fa9146d7da7cdc2ae40e3 Mon Sep 17 00:00:00 2001 From: hparfr Date: Mon, 8 Oct 2018 12:04:25 +0200 Subject: [PATCH 36/51] Fix JS loading : module should only be loaded in pos Fix indentation --- .../views/pos_payment_terminal_template.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pos_payment_terminal/views/pos_payment_terminal_template.xml b/pos_payment_terminal/views/pos_payment_terminal_template.xml index 976acc2d..0b619aff 100644 --- a/pos_payment_terminal/views/pos_payment_terminal_template.xml +++ b/pos_payment_terminal/views/pos_payment_terminal_template.xml @@ -1,10 +1,10 @@ -