From 4af7c9f482af501e314604a9431f58db43b8393f Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Thu, 5 Sep 2019 16:36:24 +0200 Subject: [PATCH] [9.0][FIX] pos_payment_terminal: Fix last changes from 10.0 --- pos_payment_terminal/models/pos_order.py | 3 ++- pos_payment_terminal/static/src/js/pos_payment_terminal.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pos_payment_terminal/models/pos_order.py b/pos_payment_terminal/models/pos_order.py index a0d0b66b..7313ff5e 100644 --- a/pos_payment_terminal/models/pos_order.py +++ b/pos_payment_terminal/models/pos_order.py @@ -4,7 +4,7 @@ from collections import defaultdict import logging -from odoo import models, api +from openerp import models, api _logger = logging.getLogger(__name__) @@ -40,6 +40,7 @@ class PosOrder(models.Model): _logger.error("Error matching transactions to payments: %s", e.args[0]) + @api.model def _process_order(self, pos_order): if pos_order.get('transactions'): self._match_transactions_to_payments(pos_order) 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 a0b24a39..493f74f7 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -80,7 +80,7 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { screens.PaymentScreenWidget.include({ render_paymentlines : function(){ this._super.apply(this, arguments); - var self = this; + 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); @@ -91,11 +91,12 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { }, order_changes: function(){ this._super.apply(this, arguments); + var self = this; var order = this.pos.get_order(); if (!order) { return; } else if (order.in_transaction) { - self.$('.next').html(''); + self.$('.next').html(''); } else { self.$('.next').html('Validate '); }